diff --git a/src/sparqlunicorn_ontdoc/docgeneration.py b/src/sparqlunicorn_ontdoc/docgeneration.py index 559ad403..e50374da 100644 --- a/src/sparqlunicorn_ontdoc/docgeneration.py +++ b/src/sparqlunicorn_ontdoc/docgeneration.py @@ -14,7 +14,7 @@ from export.pages.lexiconpage import LexiconPage from export.pages.observationpage import ObservationPage from export.pages.geometryviewpage import GeometryViewPage - +from export.pages.personpage import PersonPage if os.path.exists("ontdocscript"): sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))+"/ontdocscript/src/sparqlunicorn_ontdoc/") @@ -1351,6 +1351,8 @@ def createHTML(self,savepath, predobjs, subject, baseurl, subpreds, graph, searc for type in curtypes: if type in DocConfig.lexicontypes: LexiconPage().generatePageWidget(graph, subject, f, {}, False) + if type in PersonPage.pageWidgetConstraint(): + PersonPage().generatePageWidget(graph, subject, templates, f, True) self.processCollectionPages(collections,graph,subject,f) if geojsonrep != None and "geocollection" not in collections: self.geocache = GeometryViewPage().generatePageWidget(graph, templates, subject, f, uritotreeitem, diff --git a/src/sparqlunicorn_ontdoc/export/pages/bibpage.py b/src/sparqlunicorn_ontdoc/export/pages/bibpage.py index 1ee41ab5..bf2e66b1 100644 --- a/src/sparqlunicorn_ontdoc/export/pages/bibpage.py +++ b/src/sparqlunicorn_ontdoc/export/pages/bibpage.py @@ -1,5 +1,5 @@ -from src.sparqlunicorn_ontdoc.doc.docconfig import DocConfig -from src.sparqlunicorn_ontdoc.doc.docutils import DocUtils +from doc.docconfig import DocConfig +from doc.docutils import DocUtils from rdflib import URIRef class BibPage: diff --git a/src/sparqlunicorn_ontdoc/export/pages/pageutils.py b/src/sparqlunicorn_ontdoc/export/pages/pageutils.py index ca67f3cf..8c8bdd17 100644 --- a/src/sparqlunicorn_ontdoc/export/pages/pageutils.py +++ b/src/sparqlunicorn_ontdoc/export/pages/pageutils.py @@ -24,7 +24,7 @@ def retrieveCollectionConstraints(self): for const in self.pageTypes[type].collectionConstraint(): self.collectionConstraints[const]=self.pageTypes[type] for const in self.pageTypes[type].pageWidgetConstraint(): - self.collectionConstraints[const]=self.pageTypes[type] + self.widgetConstraints[const]=self.pageTypes[type] except: print("PageType Constraints parsing failed") diff --git a/src/sparqlunicorn_ontdoc/export/pages/personpage.py b/src/sparqlunicorn_ontdoc/export/pages/personpage.py index 764db815..de2ff40d 100644 --- a/src/sparqlunicorn_ontdoc/export/pages/personpage.py +++ b/src/sparqlunicorn_ontdoc/export/pages/personpage.py @@ -1,14 +1,19 @@ -from src.sparqlunicorn_ontdoc.doc.docconfig import DocConfig - +from doc.docconfig import DocConfig +from doc.docutils import DocUtils class PersonPage: vcardprops={ "http://xmlns.com/foaf/0.1/birthday":"BDAY", - "http://xmlns.com/foaf/0.1/family_name":"N", + "http://xmlns.com/foaf/0.1/familyName":"N", + "http://xmlns.com/foaf/0.1/family_name": "N", + "http://xmlns.com/foaf/0.1/firstName": "N", + "http://xmlns.com/foaf/0.1/lastName": "N", "http://xmlns.com/foaf/0.1/fullName":"FN", - "http://xmlns.com/foaf/0.1/givenname":"N", + "http://xmlns.com/foaf/0.1/givenname": "N", + "http://xmlns.com/foaf/0.1/givenName":"N", "http://xmlns.com/foaf/0.1/homePage":"URL", + "http://xmlns.com/foaf/0.1/gender": "GENDER", "http://xmlns.com/foaf/0.1/img":"PHOTO", "http://xmlns.com/foaf/0.1/logo":"LOGO", "http://xmlns.com/foaf/0.1/mbox":"EMAIL", @@ -71,15 +76,22 @@ def extractPersonMetadata(self,subject,graph): return thevcard def vcardToHTML(self,vcard): - result="" - + result="" + for prop in vcard: + result+="" + if "http" in vcard[prop]: + result+="" + else: + result += "" + result+="
PropertyValue
"+str(DocUtils.shortenURI(prop))+""+str(DocUtils.shortenURI(vcard[prop]))+"
" + str(vcard[prop]) + "
" return result - - def collectionConstraint(self): + @staticmethod + def collectionConstraint(): return DocConfig.collectionclasses - def pageWidgetConstraint(self): + @staticmethod + def pageWidgetConstraint(): return ["http://xmlns.com/foaf/0.1/Person","http://www.w3.org/2006/vcard/ns#Individual","http://schema.org/Person","http://dbpedia.org/ontology/Person","http://www.wikidata.org/entity/Q5"] def generatePageWidget(self, graph, subject, templates, f=None, pageWidget=False):