Skip to content

Commit

Permalink
add labels
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 23, 2024
1 parent 4b63387 commit b4b4fe8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sparqlunicorn_ontdoc/export/data/voidexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modti
for pred in propstats:
cururi=voidds+"_"+DocUtils.shortenURI(pred)
g.add((URIRef(voidds),URIRef("http://rdfs.org/ns/void#propertyPartition"),URIRef(cururi)))
g.add((URIRef(cururi), URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
URIRef("http://rdfs.org/ns/void#Dataset")))
g.add((URIRef(cururi), URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),URIRef("http://rdfs.org/ns/void#Dataset")))
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))
Expand All @@ -63,6 +63,7 @@ def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modti
cururi = voidds +"_"+ DocUtils.shortenURI(item["id"])
g.add((URIRef(voidds), URIRef("http://rdfs.org/ns/void#classPartition"), URIRef(cururi)))
g.add((URIRef(cururi), URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),URIRef("http://rdfs.org/ns/void#Dataset")))
g.add((URIRef(cururi), URIRef("http://www.w3.org/2000/01/rdf-schema#label"),Literal("Class Partition: " + str(DocUtils.shortenURI(item["id"])),lang="en")))
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")))
Expand All @@ -71,6 +72,7 @@ def createVoidDataset(dsname,prefixnamespace,deploypath,outpath,licenseuri,modti
for ns in nonnscount[prop]:
cururi=voidds+"_"+DocUtils.shortenURI(ns)
g.add((URIRef(cururi), URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),URIRef("http://rdfs.org/ns/void#Linkset")))
g.add((URIRef(cururi), URIRef("http://www.w3.org/2000/01/rdf-schema#label"),Literal("Linkset: "+str(DocUtils.shortenURI(voidds))+" - "+str(DocUtils.shortenURI(ns)),lang="en")))
g.add((URIRef(cururi),URIRef("http://rdfs.org/ns/void#subjectsTarget"),URIRef(voidds)))
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)))
Expand Down

0 comments on commit b4b4fe8

Please sign in to comment.