Skip to content

Instantly share code, notes, and snippets.

@edsu
edsu / justin-lingvoj.ttl
Last active September 11, 2015 19:14
An rdfs hack to infer a language competency based on more specific lingvoj language competencies. It also would allow hasCompetency to be used when the specific ability is not known.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix lingvoj: <http://www.lingvoj.org/ontology#> .
:hasCompetency
a owl:ObjectProperty ;
rdfs:label "basic competency in a language"@en ;
rdfs:range :Lingvo ;
rdfs:domain foaf:Person .
lingvoj:basicUnderstanding rdfs:subPropertyOf :hasCompetency .
@nichtich
nichtich / EDM-v52-100730.ttl
Created March 9, 2011 16:40
Europeana Data Model v5.2 from http://is.gd/4sX8WC
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://www.europeana.eu/schemas/edm/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix abc: <http://metadata.net/harmony/abc#> .
@prefix DOLCE-Lite: <http://www.loa-cnr.it/ontologies/DOLCE-Lite.owl#> .
@prefix wgs84_pos: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ore: <http://www.openarchives.org/ore/terms/> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@titipata
titipata / wos_extract.md
Last active November 15, 2016 17:24
WoS extract

Web of Science parser

Download dependencies

import xml.etree.cElementTree as ET
from lxml import etree
from itertools import chain
import pandas as pd
@AlBaker
AlBaker / ExampleGroovySparql.groovy
Created June 27, 2011 05:30
Groovy SPARQL Example
@Grab('com.hp.hpl.jena:jena:2.6.4')
@Grab('com.hp.hpl.jena:arq:2.8.8')
import groovy.sparql.Sparql
// Can also take a Jena model as an argument
def sparql = new Sparql("http://dbpedia.org/sparql")
def query = """
SELECT ?abstract
@MajorGressingham
MajorGressingham / gist:7691723
Created November 28, 2013 13:19
JellyFish Notebook
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@ruebot
ruebot / config.ttl
Created April 27, 2016 21:42
Fuseki Configuration with inference
@prefix : <#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@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#> .
[] rdf:type fuseki:Server ;
fuseki:services (
<#fedoraService>
10.1002 Wiley Blackwell (John Wiley & Sons) 111 River Street Hoboken, NJ 07030 USA
10.1155 Hindawi Publishing Corporation Nasr City Free Zone Cairo, 11816 Egypt
10.1142 World Scientific No 5 Toh Tuck Link 596224 Singapore
10.1111 Wiley Blackwell (Blackwell Publishing) 111 River Street Hoboken, NJ 07030 USA
10.3109 Informa UK (Informa Healthcare)
10.1007 Springer-Verlag Van Godewijckstraat 30 Dordrecht, GX 3311 The Netherlands
10.1016 Elsevier 360 Park Ave South New York, NY 10010 USA
10.3402 Co-Action Publishing Haggebyholmsvagen 5 Balsta, 74694 Sweden
10.1017 Cambridge University Press The Edinburgh Bldg Shaftesbury Rd Cambridge, CB2 2RU UK
10.1080 Informa UK (Taylor & Francis) 4 Park Square Milton Park, Abingdon, OXON OX14 4RN UK
@haf
haf / gist:2843680
Created May 31, 2012 14:19
Get SSH working on Vagrant/Windows/Git

If you are using vagrant, you probably-statistically are using git. Make sure you have its binary folder on your path, because that path contains 'ssh.exe'.

Now, modify C:\vagrant\vagrant\embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\ssh.rb to comment out the faulty Windows check and add a real SSH check:

# if Util::Platform.windows?
  # raise Errors::SSHUnavailableWindows, :host => ssh_info[:host],
                                       # :port => ssh_info[:port],
                                       # :username => ssh_info[:username],
 # :key_path =&gt; ssh_info[:private_key_path]
@TastyToast
TastyToast / handlebars-truncate-helper.js
Last active April 21, 2021 09:08
Truncate helper for Handlebars.js
Handlebars.registerHelper ('truncate', function (str, len) {
if (str.length > len) {
var new_str = str.substr (0, len+1);
while (new_str.length) {
var ch = new_str.substr ( -1 );
new_str = new_str.substr ( 0, -1 );
if (ch == ' ') {
break;
"""
Sample code to traverse RDF list with RDFLIB.
author: Manuel Salvadores (msalvadores@gmail.com)
rdf containers are a pain in general, quite annoying to handle them.
To get all the authors for a given article like in your case you could do
something like the code I am posting below.