Skip to content

Instantly share code, notes, and snippets.

@lawlesst
lawlesst / ldf-hdt-heroku.md
Last active Sep 26, 2015
Notes on running ldf-server on Heroku with an HDT backend
View ldf-hdt-heroku.md

September 25, 2015

Steps to run ldf-server on Heroku with an HDT backend.

  • Read the Node troubleshooting guide from Heroku for background.
  • Run the commands in the Start with a Blank Slate section of the guide.
  • Add package.json to your git repository if it isn't already.
  • For my project, I had to explicitly add hdt - 1.2.2 as a dependendency.

package.json

@lawlesst
lawlesst / petl.md
Last active Sep 27, 2015
Quick intro to petl for VIVO Apps & Tools working group.
View petl.md
@lawlesst
lawlesst / README.md
Last active Aug 29, 2015
VIVO modifications to display data pulled from ldf-vivo.herokuapp.com.
View README.md

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

@lawlesst
lawlesst / read_dumped_triples.py
Created Jun 1, 2015
Read triples dumped from Jena SDB via SQL and convert to n-triples
View read_dumped_triples.py
"""
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
lawlesst / fuseki-fulltext-config.ttl
Last active Nov 15, 2021
Minimal working Fuseki TDB with with full text search.
View fuseki-fulltext-config.ttl
@prefix : <http://localhost/jena_example/#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix text: <http://jena.apache.org/text#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
## Example of a TDB dataset and text index
## Initialize TDB
@lawlesst
lawlesst / readme.md
Last active Aug 29, 2015
University linking with OrgRef and VIVOs
View readme.md

##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: http://ldf-vivo.herokuapp.com/orgref
@lawlesst
lawlesst / rdflib_stardog.py
Last active Jul 14, 2021
Example code for working with Stardog from Python.
View rdflib_stardog.py
"""
Example code for connecting to Stardog (http://stardog.com/) with
Python's RDFLib (http://github.com/rdflib).
See longer description: http://lawlesst.github.io/notebook/rdflib-stardog.html
"""
View deploy-vitro-jetty.sh
#!/bin/sh -e
set -x # Print commands and their arguments as they are executed.
JETTY_HOME=/dock/jetty7.6.14
VITRO_HOME=/tmp/vitrohome
STAGE_DIR=/tmp/vbuild
ant clean distribute -Dskiptests=true
#ant distribute -Dskiptests=true
@lawlesst
lawlesst / middleware.py
Created Jul 30, 2014
Minimum subclass of ShibbolethRemoteUserMiddleware.
View middleware.py
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"