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 c46fc43 commit eb8c755
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/sparqlunicorn_ontdoc/docgeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,9 @@ def generateOntDocForNameSpace(self, prefixnamespace,dataformat="HTML"):
else:
ExporterUtils.exportToFunction[ex](subgraph,path + "index."+str(ex),subjectstorender,classlist,ex)
relpath=DocUtils.generateRelativePathFromGivenDepth(checkdepth)
indexhtml=self.replaceStandardVariables(templates["htmltemplate"],"",checkdepth,str(nslink==prefixnamespace).lower())
indexhtml=self.replaceStandardVariables(templates["htmltemplate"],voidds,checkdepth,str(nslink==prefixnamespace).lower())
indexhtml = indexhtml.replace("{{iconprefixx}}",(relpath+"icons/" if self.offlinecompat else "")).replace("{{baseurl}}", prefixnamespace).replace("{{relativedepth}}",str(checkdepth)).replace("{{relativepath}}",relpath).replace("{{toptitle}}","Index page for " + nslink).replace("{{title}}","Index page for " + nslink).replace("{{startscriptpath}}", scriptlink).replace("{{stylepath}}", stylelink).replace("{{vowlpath}}", vowllink)\
.replace("{{classtreefolderpath}}",classtreelink).replace("{{baseurlhtml}}", nslink).replace("{{proprelationpath}}",proprelations).replace("{{nonnslink}}","").replace("{{scriptfolderpath}}", sfilelink).replace("{{exports}}",templates["nongeoexports"]).replace("{{bibtex}}","")
.replace("{{classtreefolderpath}}",classtreelink).replace("{{baseurlhtml}}", nslink).replace("{{proprelationpath}}",proprelations).replace("{{nonnslink}}","").replace("{{scriptfolderpath}}", sfilelink).replace("{{exports}}",templates["nongeoexports"]).replace("{{bibtex}}","").replace("{{subjectencoded}}",urllib.parse.quote(str(voidds)))
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:
Expand All @@ -471,10 +471,10 @@ def generateOntDocForNameSpace(self, prefixnamespace,dataformat="HTML"):
break
if exitem!=None:
if self.createColl:
indexhtml+="<tr><td><img src=\""+tree["types"][item["type"]]["icon"]+"\" height=\"25\" width=\"25\" alt=\""+item["type"]+"\"/><a href=\""+DocUtils.shortenURI(str(item["id"]))+"_collection/index.html\" target=\"_blank\">"+str(item["text"])+"</a></td>"
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 href=\""+str(item["id"])+"\" target=\"_blank\">"+str(item["text"])+"</a></td>"
indexhtml+="<td>"+str(item["instancecount"])+"</td>"+exitem+"</tr>"
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 property=\"http://rdfs.org/ns/void#class\" content=\<span 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
2 changes: 1 addition & 1 deletion src/sparqlunicorn_ontdoc/export/data/voidexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ def toHTML(stats,deploypath):
result="<details><summary>Dataset Statistics <a href=\""+str(deploypath)+"/void.ttl"+"\" target=\"_blank\">[VOID]</a></summary>"
result+="<table border=\"1\"><thead><th>Property</th><th>Value</th></thead><tbody>"
for stat in stats:
result+="<tr><td><a href=\""+str(stat)+"\" target=\"_blank\">"+str(DocUtils.shortenURI(stat))+"</a></td><td>"+str(stats[stat])+"&nbsp;<a href=\"http://www.w3.org/2001/XMLSchema#integer\" style=\"color:#666;\"><small>(xsd:integer)</small></a></td></tr>"
result+="<tr><td><a href=\""+str(stat)+"\" target=\"_blank\">"+str(DocUtils.shortenURI(stat))+"</a></td><td><span property=\""+str(stat)+"\" content=\""+str(stats[stat])+"\" datatype=\"http://www.w3.org/2001/XMLSchema#integer\">"+str(stats[stat])+"</span>&nbsp;<a href=\"http://www.w3.org/2001/XMLSchema#integer\" style=\"color:#666;\"><small>(xsd:integer)</small></a></td></tr>"
result+="</tbody></table></details>"
return result

0 comments on commit eb8c755

Please sign in to comment.