Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 23, 2024
1 parent 73d33d2 commit 5389c39
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/sparqlunicorn_ontdoc/docgeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,25 +988,26 @@ def getSubjectPagesForNonGraphURIs(self,uristorender,graph,prefixnamespace,corpu
nonnsuris=len(uristorender)
counter=0
for uri in uristorender:
label=""
for tup in graph.predicate_objects(URIRef(uri)):
if str(tup[0]) in DocConfig.labelproperties:
label = str(tup[1])
if uri in uritotreeitem:
res = DocUtils.replaceNameSpacesInLabel(self.prefixes,str(uri))
label=DocUtils.getLabelForObject(URIRef(str(uri)), graph,self.labellang)
if res!=None and label!="":
uritotreeitem[uri][-1]["text"]=label+" (" + res["uri"] + ")"
elif label!="":
uritotreeitem[uri][-1]["text"]=label+" ("+DocUtils.shortenURI(uri)+")"
else:
uritotreeitem[uri][-1]["text"]=DocUtils.shortenURI(uri)
uritotreeitem[uri][-1]["id"]=prefixnamespace+"nonns_"+DocUtils.shortenURI(uri)+".html"
labeltouri[label]=prefixnamespace+"nonns_"+DocUtils.shortenURI(uri)+".html"
if counter%10==0:
self.updateProgressBar(counter, nonnsuris, "NonNS URIs")
self.createHTML(outpath+"nonns_"+DocUtils.shortenURI(uri)+".html", None, URIRef(uri), baseurl, graph.subject_predicates(URIRef(uri),True), graph, str(corpusid) + "_search.js", str(corpusid) + "_classtree.js", None, self.license, None, Graph(),uristorender,True,label)
counter+=1
label=""
if prefixnamespace not in uri:
for tup in graph.predicate_objects(URIRef(uri)):
if str(tup[0]) in DocConfig.labelproperties:
label = str(tup[1])
if uri in uritotreeitem:
res = DocUtils.replaceNameSpacesInLabel(self.prefixes,str(uri))
label=DocUtils.getLabelForObject(URIRef(str(uri)), graph,self.labellang)
if res!=None and label!="":
uritotreeitem[uri][-1]["text"]=label+" (" + res["uri"] + ")"
elif label!="":
uritotreeitem[uri][-1]["text"]=label+" ("+DocUtils.shortenURI(uri)+")"
else:
uritotreeitem[uri][-1]["text"]=DocUtils.shortenURI(uri)
uritotreeitem[uri][-1]["id"]=prefixnamespace+"nonns_"+DocUtils.shortenURI(uri)+".html"
labeltouri[label]=prefixnamespace+"nonns_"+DocUtils.shortenURI(uri)+".html"
if counter%10==0:
self.updateProgressBar(counter, nonnsuris, "NonNS URIs")
self.createHTML(outpath+"nonns_"+DocUtils.shortenURI(uri)+".html", None, URIRef(uri), baseurl, graph.subject_predicates(URIRef(uri),True), graph, str(corpusid) + "_search.js", str(corpusid) + "_classtree.js", None, self.license, None, Graph(),uristorender,True,label)
counter+=1
return labeltouri

def polygonToPath(self,svg):
Expand Down

0 comments on commit 5389c39

Please sign in to comment.