In [10]:
import glob
import os
import rdflib
from rdflib.namespace import DC, FOAF, RDFS, RDF, XSD
In [11]:
acdhi = rdflib.Namespace("https://id.acdh.oeaw.ac.at/")
acdh = rdflib.Namespace("https://vocabs.acdh.oeaw.ac.at/#")
dcterms = rdflib.Namespace("http://purl.org/dc/terms/")
cidoc = rdflib.Namespace("http://www.cidoc-crm.org/cidoc-crm/")
crmdig = rdflib.Namespace("http://www.ics.forth.gr/isl/CRMdig/")
In [12]:
files = [x for x in os.listdir(".") if x.endswith('rdf') or x.endswith('ttl')]
In [13]:
graph = rdflib.Graph()
for x in files:
try:
graph.parse(x)
except:
graph.parse(x, format='ttl')
In [14]:
graph.__len__()
Out[14]:
In [15]:
hansi = graph.serialize(destination='merged/temp.nt', format='nt')
In [16]:
test = rdflib.Graph()
In [18]:
test.parse('merged/temp.nt', format='nt')
Out[18]:
In [ ]: