Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 30, 2024
1 parent e1016e4 commit 6e0a97a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/sparqlunicorn_ontdoc/docgeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ def generateOntDocForNameSpace(self, prefixnamespace,dataformat="HTML"):
tree["core"]["data"].append(tr)
voidstats["http://rdfs.org/ns/void#classes"]=len(classidset)
voidstats["http://rdfs.org/ns/void#triples"] = len(self.graph)
for stat in voidstats:
if (URIRef(voidds),URIRef(stat),None) in self.graph:
self.graph.set((URIRef(voidds), URIRef(stat),
Literal(int(self.graph.value(URIRef(voidds),URIRef(stat)))+voidstats[stat], datatype="http://www.w3.org/2001/XMLSchema#integer")))
else:
self.graph.add((URIRef(voidds),URIRef(stat),Literal(voidstats[stat],datatype="http://www.w3.org/2001/XMLSchema#integer")))
voidgraph=VoidExporter.createVoidDataset(self.datasettitle,prefixnamespace,self.deploypath,self.outpath,self.licenseuri,self.modtime,self.labellang,voidstats,subjectstorender,self.graph,self.prefixes,tree,predmap,nonnscount,instancecount,self.startconcept)
self.voidstatshtml=VoidExporter.toHTML(voidstats,self.deploypath)
self.graph+=voidgraph["graph"]
Expand Down
8 changes: 1 addition & 7 deletions src/sparqlunicorn_ontdoc/export/data/voidexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class VoidExporter:

@staticmethod
def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modtime,language,stats,subjectstorender,prefixes,graph,classtree=None,propstats=None,nonnscount=None,objectmap=None,startconcept=None):
def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modtime,language,stats,subjectstorender,prefixes,classtree=None,propstats=None,nonnscount=None,objectmap=None,startconcept=None):
g=Graph()
if dsname==None or dsname=="":
dsname="dataset"
Expand Down Expand Up @@ -40,12 +40,6 @@ def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modti
if startconcept!=None and startconcept!="":
g.add((URIRef(voidds), URIRef("http://rdfs.org/ns/void#rootResource"), URIRef(startconcept.replace("index.html",""))))
g.add((URIRef(voidds), URIRef("http://rdfs.org/ns/void#exampleResource"), URIRef(startconcept.replace("index.html",""))))
for stat in stats:
if (URIRef(voidds),URIRef(stat),None) in graph:
graph.set((URIRef(voidds), URIRef(stat),
Literal(int(graph.value(URIRef(voidds),URIRef(stat)))+stats[stat], datatype="http://www.w3.org/2001/XMLSchema#integer")))
else:
g.add((URIRef(voidds),URIRef(stat),Literal(stats[stat],datatype="http://www.w3.org/2001/XMLSchema#integer")))
g.add((URIRef(voidds), URIRef("http://rdfs.org/ns/void#uriSpace"),
Literal(prefixnamespace,datatype="http://www.w3.org/2001/XMLSchema#string")))
for ns_prefix, namespace in g.namespaces():
Expand Down

0 comments on commit 6e0a97a

Please sign in to comment.