Skip to content

Instantly share code, notes, and snippets.

lawlesst /
Last active Aug 29, 2015
VIVO modifications to display data pulled from

Sample files for pulling data into a VIVO instance from Linked Data Fragments, Wikidata, and Wikipedia.

lawlesst /
Created Jun 1, 2015
Read triples dumped from Jena SDB via SQL and convert to n-triples
Used chardet library to find encoding - it reported:
{'confidence': 0.7158930206047512, 'encoding': 'ISO-8859-2'}
Use line writing to print ntriples as they are read to avoid
memory issues with storing all statements in an in memory
RDFLib Graph.
lawlesst / fuseki-fulltext-config.ttl
Last active Apr 27, 2020
Minimal working Fuseki TDB with with full text search.
View fuseki-fulltext-config.ttl
@prefix : <http://localhost/jena_example/#> .
@prefix rdf: <> .
@prefix rdfs: <> .
@prefix tdb: <> .
@prefix ja: <> .
@prefix text: <> .
@prefix fuseki: <> .
## Example of a TDB dataset and text index
## Initialize TDB
lawlesst /
Last active Aug 29, 2015
University linking with OrgRef and VIVOs

##University Linking

Using OrgRef to link universities represented in VIVOs to DBPedia and to each other.

  • Exploring how VIVO instances could share data like this and reuse URIs.
  • Crawled eight VIVO instances and pulled back data about Universities.
  • Matched each site to OrgRef using simple string normalization and equality.
  • Matched OrgRef to DBPedia using the Wikipedia Page IDs included by OrgRef.
  • Matched VIVOs to DBPedia
  • Loaded data into a Linked Data Fragments server:
lawlesst /
Last active Oct 15, 2018
Example code for working with Stardog from Python.
Example code for connecting to Stardog ( with
Python's RDFLib (
See longer description:
#!/bin/sh -e
set -x # Print commands and their arguments as they are executed.
ant clean distribute -Dskiptests=true
#ant distribute -Dskiptests=true
lawlesst /
Created Jul 30, 2014
Minimum subclass of ShibbolethRemoteUserMiddleware.
from shibboleth.middleware import ShibbolethRemoteUserMiddleware, ShibbolethValidationError
class MyAppAuthenticationMiddleware(ShibbolethRemoteUserMiddleware):
Handle login via Shibboleth and permissions for viewing and
editing profiles and resources.
header = "Shibboleth-localId"
View tracject_indexer.rb
# Set up a reader and a writer
# First we need to require the reader/writer we want
require 'traject'
require 'traject/marc4j_reader'
require 'traject/debug_writer'
settings do
provide "reader_class_name", "Traject::Marc4JReader"
provide "marc_source.encoding", "UTF-8"
Mint random number based IRIs.
BU = Namespace('')
def get_next_uri(self, prefix='n', number=1, used_uris=[], max=99999):
Mint new URIs in the VIVO pattern (e.g. n1234).
View pubmed-disambig.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.