Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 13, 2024
1 parent a1a2103 commit 6b5a5e7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/sparqlunicorn_ontdoc/doc/docconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DocConfig:
collectionrelationproperties={
"http://www.w3.org/2000/01/rdf-schema#member":"ObjectProperty",
"http://www.w3.org/2004/02/skos/core#member":"ObjectProperty",
"http://www.w3.org/ns/lemon/lime#entry": "ObjectProperty",
"http://www.w3.org/ns/lemon/lexicog#entry": "ObjectProperty",
"http://www.w3.org/2006/vcard/ns#hasMember":"ObjectProperty",
"http://www.w3.org/ns/dcat#dataset":"ObjectProperty",
"http://www.w3.org/ns/dcat#resource":"ObjectProperty",
Expand Down
1 change: 0 additions & 1 deletion src/sparqlunicorn_ontdoc/docgeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,6 @@ def createHTML(self,savepath, predobjs, subject, baseurl, subpreds, graph, searc
if isinstance(tup[1],URIRef):
for item in graph.objects(tup[1],URIRef(self.typeproperty)):
thetypes.add(str(item))
curtypes.add(str(item))
if parentclass!=None:
if item not in uritotreeitem[parentclass][-1]["data"]["to"][str(tup[0])]:
uritotreeitem[parentclass][-1]["data"]["to"][str(tup[0])][item] = 0
Expand Down
1 change: 1 addition & 0 deletions src/sparqlunicorn_ontdoc/export/api/carddavexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class CardDAVExporter:
def vcardJSONToFile(self,vcard,path):
f=open(path,"w")
f.write("BEGIN:VCARD\nVERSION:4.0\n")
f.write("PROFILE:VCARD\n")
for key in vcard:
f.write(str(key).upper()+":"+str(vcard[key])+"\n")
f.write("END:VCARD\n")
Expand Down
2 changes: 1 addition & 1 deletion src/sparqlunicorn_ontdoc/export/pages/lexiconpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def generatePageWidget(self,graph,subject,f,onlybody=False):

def generateCollectionWidget(self,graph,templates,subject,f):
f.write("<table id=\"lexicon\">"+self.tableheader+"<tbody>")
for lexentry in graph.objects(subject, URIRef("http://www.w3.org/ns/lemon/lime#entry"), True):
for lexentry in graph.objects(subject, URIRef("http://www.w3.org/ns/lemon/lexicog#entry"), True):
self.generatePageWidget(graph,lexentry,f,True)
f.write("</tbody></table>")

Expand Down
12 changes: 6 additions & 6 deletions src/sparqlunicorn_ontdoc/export/pages/personpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ def extractPersonMetadata(self,subject,graph):
thevcard={}
for pprop in graph.predicate_objects(subject, True):
if str(pprop[0]) in self.vcardprops:
thevcard[self.vcardprops[str(pprop[0])]]=str(pprop[1])
thevcard[self.vcardprops[str(pprop[0])]]={"value":str(pprop[1]),"prop":str(pprop[0])}
return thevcard

def vcardToHTML(self,vcard):
result="<table id=\"person\" border=\"1\"><thead><tr><th>Property</th><th>Value</th></tr></thead><tbody>"
result="<table id=\"person\" class=\"vcard\" border=\"1\"><thead><tr><th>Property</th><th>Value</th></tr></thead><tbody>"
for prop in vcard:
result+="<tr><td><a href=\""+str(prop)+"\">"+str(DocUtils.shortenURI(prop))+"</a></td>"
result+="<tr><td><a href=\""+str(vcard[prop]["prop"])+"\">"+str(DocUtils.shortenURI(prop))+"</a></td>"
if "http" in vcard[prop]:
result+="<td><a href=\""+str(vcard[prop])+"\">"+str(DocUtils.shortenURI(vcard[prop]))+"</a></td></tr>"
result+="<td><a href=\""+str(vcard[prop]["value"])+"\" class=\""+str(prop)+"\">"+str(DocUtils.shortenURI(vcard[prop]["value"]))+"</a></td></tr>"
else:
result += "<td>" + str(vcard[prop]) + "</td></tr>"
result+="</tbody></table><script>$('#person').DataTable();</script>"
result += "<td class=\""+str(prop)+"\">" + str(vcard[prop]["value"]) + "</td></tr>"
result+="</tbody></table><script>$('#person').DataTable();</script><button id=\"vcard\">Download VCard</button>"
return result

@staticmethod
Expand Down

0 comments on commit 6b5a5e7

Please sign in to comment.