Skip to content

Instantly share code, notes, and snippets.

@arockwell
Created July 15, 2011 20:47
Show Gist options
  • Select an option

  • Save arockwell/1085524 to your computer and use it in GitHub Desktop.

Select an option

Save arockwell/1085524 to your computer and use it in GitHub Desktop.
Concatenating rdf/xml files together into one ntriple
#!/usr/bin/python
from rdflib import Graph
import os
path="rdf"
dirList=os.listdir(path)
for fname in dirList:
g = Graph()
g.parse("rdf/" + str(fname))
print g.serialize(format='nt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment