Skip to content

Commit

Permalink
void rdfa work
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 22, 2024
1 parent 8d184cc commit dcec273
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 @@ -457,10 +457,10 @@ def generateOntDocForNameSpace(self, prefixnamespace,dataformat="HTML"):
indexhtml+="<p>This page shows information about linked data resources in HTML. Choose the classtree navigation or search to browse the data</p>"+templates["vowltemplate"].replace("{{vowlpath}}", "minivowl_result.js")
if self.startconcept!=None and path==outpath and self.startconcept in uritotreeitem:
if self.createColl:
indexhtml+="<p>Start exploring the graph here: <img src=\""+tree["types"][uritotreeitem[self.startconcept][-1]["type"]]["icon"]+"\" height=\"25\" width=\"25\" alt=\""+uritotreeitem[self.startconcept][-1]["type"]+"\"/><a href=\""+DocUtils.generateRelativeLinkFromGivenDepth(prefixnamespace,0,str(self.startconcept),True)+"\">"+DocUtils.shortenURI(self.startconcept)+"</a></p>"
indexhtml+="<p>Start exploring the graph here: <img src=\""+tree["types"][uritotreeitem[self.startconcept][-1]["type"]]["icon"]+"\" height=\"25\" width=\"25\" alt=\""+uritotreeitem[self.startconcept][-1]["type"]+"\"/><a property=\"http://rdfs.org/ns/void#rootResource\" resource=\""+str(self.startconcept)+"\" href=\""+DocUtils.generateRelativeLinkFromGivenDepth(prefixnamespace,0,str(self.startconcept),True)+"\">"+DocUtils.shortenURI(self.startconcept)+"</a></p>"
else:
indexhtml+="<p>Start exploring the graph here: <img src=\""+tree["types"][uritotreeitem[self.startconcept][-1]["type"]]["icon"]+"\" height=\"25\" width=\"25\" alt=\""+uritotreeitem[self.startconcept][-1]["type"]+"\"/><a href=\""+DocUtils.generateRelativeLinkFromGivenDepth(prefixnamespace,0,str(self.startconcept),True)+"\">"+DocUtils.shortenURI(self.startconcept)+"</a></p>"
indexhtml+="<table class=\"description\" style =\"height: 100%; overflow: auto\" border=1 id=indextable><thead><tr><th>Class</th><th>Number of instances</th><th>Instance Example</th></tr></thead><tbody>"
indexhtml+="<p>Start exploring the graph here: <img src=\""+tree["types"][uritotreeitem[self.startconcept][-1]["type"]]["icon"]+"\" height=\"25\" width=\"25\" alt=\""+uritotreeitem[self.startconcept][-1]["type"]+"\"/><a property=\"http://rdfs.org/ns/void#rootResource\" resource=\""+str(self.startconcept)+"\" href=\""+DocUtils.generateRelativeLinkFromGivenDepth(prefixnamespace,0,str(self.startconcept),True)+"\">"+DocUtils.shortenURI(self.startconcept)+"</a></p>"
indexhtml+="<table about=\""+str(voidds)+"\" typeof=\"http://rdfs.org/ns/void#Dataset\" class=\"description\" style =\"height: 100%; overflow: auto\" border=1 id=indextable><thead><tr><th>Class</th><th>Number of instances</th><th>Instance Example</th></tr></thead><tbody>"
for item in tree["core"]["data"]:
if (item["type"]=="geoclass" or item["type"]=="class" or item["type"]=="featurecollection" or item["type"]=="geocollection") and "instancecount" in item and item["instancecount"]>0:
exitem=None
Expand All @@ -474,7 +474,7 @@ def generateOntDocForNameSpace(self, prefixnamespace,dataformat="HTML"):
indexhtml+="<tr><td><img src=\""+tree["types"][item["type"]]["icon"]+"\" height=\"25\" width=\"25\" alt=\""+item["type"]+"\"/><a property=\"http://rdfs.org/ns/void#exampleResource\" href=\""+DocUtils.shortenURI(str(item["id"]))+"_collection/index.html\" target=\"_blank\">"+str(item["text"])+"</a></td>"
else:
indexhtml+="<tr><td><img src=\""+tree["types"][item["type"]]["icon"]+"\" height=\"25\" width=\"25\" alt=\""+item["type"]+"\"/><a property=\"http://rdfs.org/ns/void#exampleResource\" href=\""+str(item["id"])+"\" target=\"_blank\">"+str(item["text"])+"</a></td>"
indexhtml+="<td property=\"http://rdfs.org/ns/void#classPartition\" resource=\""+str(voidds)+"_"+str(DocUtils.shortenURI(item["type"]))+"\"><span about=\""+str(voidds)+"_"+str(DocUtils.shortenURI(item["type"]))+"\" property=\"http://rdfs.org/ns/void#class\" resource=\""+str(item["type"])+"\"></span><span about=\""+str(voidds)+"_"+str(DocUtils.shortenURI(item["type"]))+"\" property=\"http://rdfs.org/ns/void#entities\" content=\""+str(item["instancecount"])+"\" datatype=\"http://www.w3.org/2001/XMLSchema#integer\">"+str(item["instancecount"])+"</td>"+exitem+"</tr>"
indexhtml+="<td property=\"http://rdfs.org/ns/void#classPartition\" typeof=\"http://rdfs.org/ns/void#Dataset\" resource=\""+str(voidds)+"_"+str(DocUtils.shortenURI(item["type"]))+"\"><span about=\""+str(voidds)+"_"+str(DocUtils.shortenURI(item["type"]))+"\" property=\"http://rdfs.org/ns/void#class\" resource=\""+str(item["type"])+"\"></span><span about=\""+str(voidds)+"_"+str(DocUtils.shortenURI(item["type"]))+"\" property=\"http://rdfs.org/ns/void#entities\" content=\""+str(item["instancecount"])+"\" datatype=\"http://www.w3.org/2001/XMLSchema#integer\">"+str(item["instancecount"])+"</td>"+exitem+"</tr>"
indexhtml += "</tbody></table><script>$('#indextable').DataTable();</script>"
indexhtml+=self.replaceStandardVariables(templates["footer"],"",checkdepth,str(nslink==prefixnamespace).lower()).replace("{{license}}",curlicense).replace("{{exports}}",templates["nongeoexports"]).replace("{{bibtex}}","").replace("{{stats}}",self.voidstatshtml)
#print(path)
Expand Down

0 comments on commit dcec273

Please sign in to comment.