Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 24, 2024
1 parent 4637174 commit 83552eb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/sparqlunicorn_ontdoc/export/data/voidexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
class VoidExporter:

@staticmethod
def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modtime,language,stats,classtree=None,propstats=None,nonnscount=None,objectmap=None,startconcept=None):
def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modtime,language,stats,subjectstorender,classtree=None,propstats=None,nonnscount=None,objectmap=None,startconcept=None):
g=Graph()
subjects=set()
if dsname==None or dsname=="":
dsname="dataset"
voidds=prefixnamespace+dsname
Expand Down Expand Up @@ -57,7 +56,7 @@ def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modti
g.add((URIRef(cururi), URIRef("http://www.w3.org/2000/01/rdf-schema#label"),Literal("Property Partition: " + str(DocUtils.shortenURI(pred)), lang="en")))
g.add((URIRef(cururi),URIRef("http://rdfs.org/ns/void#property"),URIRef(pred)))
g.add((URIRef(cururi),URIRef("http://rdfs.org/ns/void#triples"),Literal(str(propstats[pred]["triples"]),datatype="http://www.w3.org/2001/XMLSchema#integer")))
subjects.add(URIRef(cururi))
subjectstorender.add(URIRef(cururi))
for item in classtree["core"]["data"]:
if item["type"]=="class":
cururi = voidds +"_"+ DocUtils.shortenURI(item["id"])
Expand All @@ -67,7 +66,7 @@ def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modti
g.add((URIRef(cururi), URIRef("http://rdfs.org/ns/void#class"), URIRef(item["id"])))
if item["id"] in objectmap:
g.add((URIRef(cururi), URIRef("http://rdfs.org/ns/void#entities"),Literal(str(objectmap[item["id"]]), datatype="http://www.w3.org/2001/XMLSchema#integer")))
subjects.add(URIRef(cururi))
subjectstorender.add(URIRef(cururi))
for prop in nonnscount:
for ns in nonnscount[prop]:
cururi=voidds+"_"+DocUtils.shortenURI(ns)
Expand All @@ -77,10 +76,9 @@ def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modti
g.add((URIRef(cururi), URIRef("http://rdfs.org/ns/void#objectsTarget"),URIRef(ns)))
g.add((URIRef(cururi), URIRef("http://rdfs.org/ns/void#linkPredicate"),URIRef(prop)))
g.add((URIRef(cururi), URIRef("http://rdfs.org/ns/void#triples"),Literal(str(nonnscount[prop][ns]),datatype="http://www.w3.org/2001/XMLSchema#integer")))
subjects.add(URIRef(cururi))
print("VOID SUBJECTS: "+str(subjects))
subjectstorender.add(URIRef(cururi))
g.serialize(outpath+"/void.ttl", encoding="utf-8")
return {"graph":g,"subjects":subjects}
return {"graph":g,"subjects":subjectstorender}

@staticmethod
def toHTML(stats,deploypath):
Expand Down

0 comments on commit 83552eb

Please sign in to comment.