Skip to content

Instantly share code, notes, and snippets.

@cmarat
Last active August 29, 2015 13:59
Show Gist options
  • Save cmarat/10657634 to your computer and use it in GitHub Desktop.
Save cmarat/10657634 to your computer and use it in GitHub Desktop.
import csv
import rdflib
g = rdflib.Graph()
label = rdflib.namespace.RDFS['label']
d = csv.reader(open('belief.csv').readlines())
# skip headers
d.next()
for literal, code in d:
g.add((rdflib.URIRef(code), label, rdflib.Literal(literal, lang='nl')))
g.serialize('belief.nt', format='nt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment