Skip to content

Commit

Permalink
labels for owl restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 20, 2024
1 parent 30ffc1b commit 21bf377
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sparqlunicorn_ontdoc/docgeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,19 @@ def generateOntDocForNameSpace(self, prefixnamespace,dataformat="HTML"):
subjectstorender.add(sub)
label=DocUtils.shortenURI(str(sub))
restriction=False
ressubcls=""
for tup in self.graph.predicate_objects(sub):
if str(tup[0]) in DocConfig.labelproperties:
labeltouri[str(tup[1])] = str(sub)
uritolabel[str(sub)] = {"label":str(tup[1])}
label=str(tup[1])
elif str(tup[1]) == "http://www.w3.org/2002/07/owl#Restriction":
restriction = True
#elif str(tup[1]) == "http://www.w3.org/2000/01/rdf-schema#subClassOf":
# self.graph.add((sub, URIRef("http://www.w3.org/2000/01/rdf-schema#label"),
# Literal(label + " [Restriction]", lang="en")))
elif str(tup[0]) == "http://www.w3.org/2000/01/rdf-schema#subClassOf":
ressubcls=str(tup[1])
if isinstance(sub,BNode) and restriction:
self.graph.add((sub, URIRef("http://www.w3.org/2000/01/rdf-schema#label"),
Literal(label + " [Restriction]", lang="en")))
Literal(label + " [Restriction of "+str(ressubcls)+"]", lang="en")))
numsubjects+=1
numinds=len(subjectstorender)
if os.path.exists(outpath + corpusid + '_search.js'):
Expand Down

0 comments on commit 21bf377

Please sign in to comment.