Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 19, 2024
1 parent 26200d1 commit c1e2291
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 32 deletions.
91 changes: 62 additions & 29 deletions src/sparqlunicorn_ontdoc/doc/docconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,46 +42,79 @@ class DocConfig:
"https://www.w3.org/ns/activitystreams#OrderedCollection": "collection"
}

classToCollectionClass={
"http://www.opengis.net/ont/geosparql#SpatialObject": {"class": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection","prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/geosparql#Feature":{"class":"http://www.opengis.net/ont/geosparql#FeatureCollection","prop":"http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/geosparql#Geometry": {"class":"http://www.opengis.net/ont/geosparql#GeometryCollection","prop":"http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Point": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection","prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Envelope": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
classToCollectionClass = {
"http://www.opengis.net/ont/geosparql#SpatialObject": {
"class": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/geosparql#Feature": {
"class": "http://www.opengis.net/ont/geosparql#FeatureCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/geosparql#Geometry": {
"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Point": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Envelope": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Geometry": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Line": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#LineString": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#LinearRing": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiCurve": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiLineString": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiLineString": {
"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiPoint": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiPolygon": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiSurface": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiPolygon": {
"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#MultiSurface": {
"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Polygon": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#PolyhedralSurface": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#PolyhedralSurface": {
"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Surface": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#TIN": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.opengis.net/ont/sf#Triangle": {"class": "http://www.opengis.net/ont/geosparql#GeometryCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.w3.org/2006/vcard/ns#Individual": {"class":"http://www.w3.org/2006/vcard/ns#Group","prop":"http://www.w3.org/2006/vcard/ns#hasMember"},
"http://xmlns.com/foaf/0.1/Person": {"class":"http://www.w3.org/2006/vcard/ns#Group","prop":"http://www.w3.org/2006/vcard/ns#hasMember"},
"http://www.w3.org/ns/lemon/ontolex#LexicalEntry": {"class":"http://www.w3.org/ns/lemon/lime#Lexicon","prop":"http://www.w3.org/ns/lemon/lexicog#entry"},
"http://www.w3.org/ns/dcat#Dataset": {"class":"http://www.w3.org/ns/dcat#Catalog","prop":"http://www.w3.org/ns/dcat#dataset"},
"http://www.w3.org/ns/sosa/Observation":{"class":"http://www.w3.org/ns/sosa/ObservationCollection","prop":"http://www.w3.org/2000/01/rdf-schema#member"},
"super": "http://www.opengis.net/ont/geosparql#SpatialObjectCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://www.w3.org/2006/vcard/ns#Individual": {"class": "http://www.w3.org/2006/vcard/ns#Group",
"prop": "http://www.w3.org/2006/vcard/ns#hasMember"},
"http://xmlns.com/foaf/0.1/Person": {"class": "http://www.w3.org/2006/vcard/ns#Group",
"prop": "http://www.w3.org/2006/vcard/ns#hasMember"},
"http://www.w3.org/ns/lemon/ontolex#LexicalEntry": {"class": "http://www.w3.org/ns/lemon/lime#Lexicon",
"prop": "http://www.w3.org/ns/lemon/lexicog#entry"},
"http://www.w3.org/ns/dcat#Dataset": {"class": "http://www.w3.org/ns/dcat#Catalog",
"prop": "http://www.w3.org/ns/dcat#dataset"},
"http://www.w3.org/ns/sosa/Observation": {"class": "http://www.w3.org/ns/sosa/ObservationCollection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://purl.org/ontology/bibo/Document": {"class": "http://purl.org/ontology/bibo/Collection",
"prop": "http://www.w3.org/2000/01/rdf-schema#member"},
"http://purl.org/ontology/bibo/Article": {"class": "http://purl.org/ontology/bibo/Collection",
Expand Down
14 changes: 11 additions & 3 deletions src/sparqlunicorn_ontdoc/docgeneration.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,17 @@ def createCollections(self,graph,namespace):
graph.add((URIRef("http://www.opengis.net/ont/geosparql#GeometryCollection"), URIRef("http://www.w3.org/2000/01/rdf-schema#subClassOf"),URIRef("http://www.opengis.net/ont/geosparql#SpatialObjectCollection")))
graph.add((URIRef(colluri), URIRef(self.typeproperty),URIRef("http://www.opengis.net/ont/geosparql#GeometryCollection")))
elif cls in DocConfig.classToCollectionClass:
graph.add((URIRef(DocConfig.classToCollectionClass[cls]["class"]),
URIRef("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
URIRef("http://www.w3.org/2004/02/skos/core#Collection")))
if "super" in DocConfig.classToCollectionClass[cls]:
graph.add((URIRef(DocConfig.classToCollectionClass[cls]["class"]),
URIRef("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
URIRef(DocConfig.classToCollectionClass[cls]["super"])))
graph.add((URIRef(DocConfig.classToCollectionClass[cls]["super"]),
URIRef("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
URIRef("http://www.w3.org/2004/02/skos/core#Collection")))
else:
graph.add((URIRef(DocConfig.classToCollectionClass[cls]["class"]),
URIRef("http://www.w3.org/2000/01/rdf-schema#subClassOf"),
URIRef("http://www.w3.org/2004/02/skos/core#Collection")))
graph.add((URIRef(colluri),URIRef(self.typeproperty),URIRef(DocConfig.classToCollectionClass[cls]["class"])))
collrelprop=DocConfig.classToCollectionClass[cls]["prop"]
else:
Expand Down

0 comments on commit c1e2291

Please sign in to comment.