Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Sep 14, 2024
1 parent 45ea26f commit a9e39e8
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 8 deletions.
15 changes: 8 additions & 7 deletions tasks/query/instance/instancequerytask.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ....util.ui.uiutils import UIUtils
from ....util.doc.docconfig import DocConfig
from ....util.sparqlutils import SPARQLUtils
from ....util.layerutils import LayerUtils
from qgis.core import Qgis, QgsVectorLayer, QgsCoordinateReferenceSystem
Expand Down Expand Up @@ -65,28 +66,28 @@ def finished(self, result):
itemchecked = QStandardItem()
itemchecked.setFlags(Qt.ItemIsUserCheckable | Qt.ItemIsEnabled)
itemchecked.setCheckState(Qt.Checked)
if rel in SPARQLUtils.geoproperties:
if SPARQLUtils.geoproperties[rel] == "DatatypeProperty":
if rel in DocConfig.geoproperties:
if DocConfig.geoproperties[rel] == "DatatypeProperty":
itemchecked.setIcon(UIUtils.geodatatypepropertyicon)
itemchecked.setToolTip("Geo Datatype Property")
itemchecked.setText("GeoDP")
elif SPARQLUtils.geoproperties[rel] == "ObjectProperty":
elif DocConfig.geoproperties[rel] == "ObjectProperty":
itemchecked.setIcon(UIUtils.geoobjectpropertyicon)
itemchecked.setToolTip("Geo Object Property")
itemchecked.setText("GeoOP")
elif rel in SPARQLUtils.georelationproperties:
elif rel in DocConfig.georelationproperties:
itemchecked.setIcon(UIUtils.georelationpropertyicon)
itemchecked.setToolTip("Geo Relation Property")
itemchecked.setText("GeoRelP")
elif rel in SPARQLUtils.commentproperties:
elif rel in DocConfig.commentproperties:
itemchecked.setIcon(UIUtils.commentannotationpropertyicon)
itemchecked.setToolTip("Description Property")
itemchecked.setText("Description Property")
elif rel in SPARQLUtils.labelproperties:
elif rel in DocConfig.labelproperties:
itemchecked.setIcon(UIUtils.labelannotationpropertyicon)
itemchecked.setToolTip("Label Property")
itemchecked.setText("Label Property")
elif rel in SPARQLUtils.relationproperties:
elif rel in DocConfig.relationproperties:
itemchecked.setIcon(UIUtils.relationobjectpropertyicon)
itemchecked.setToolTip("Relation Property")
itemchecked.setText("Relation Property")
Expand Down
68 changes: 67 additions & 1 deletion util/doc/docconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ class DocConfig:
".wav": "audio"
}


classtreequery = """PREFIX owl: <http://www.w3.org/2002/07/owl#>\n
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n
Expand All @@ -524,4 +525,69 @@ class DocConfig:
?subject != owl:ObjectProperty &&\n
?subject != owl:NamedIndividual &&\n
?subject != owl:Ontology) )\n
}"""
}"""

georelationproperties={
"http://www.opengis.net/ont/geosparql#sfEquals": {"type": "ObjectProperty", "relation": "equals"},
"http://www.opengis.net/ont/geosparql#sfContains": {"type": "ObjectProperty", "relation": "contains"},
"http://www.opengis.net/ont/geosparql#sfCrosses": {"type": "ObjectProperty", "relation": "crosses"},
"http://www.opengis.net/ont/geosparql#sfDisjoint": {"type": "ObjectProperty", "relation": "disjoint"},
"http://www.opengis.net/ont/geosparql#sfOverlaps": {"type": "ObjectProperty", "relation": "overlaps"},
"http://www.opengis.net/ont/geosparql#sfIntersects": {"type": "ObjectProperty", "relation": "intersects"},
"http://www.opengis.net/ont/geosparql#sfWithin": {"type": "ObjectProperty", "relation": "within"},
"http://www.opengis.net/ont/geosparql#sfTouches": {"type": "ObjectProperty", "relation": "touches"},
"http://www.opengis.net/ont/geosparql#ehCovers": {"type": "ObjectProperty", "relation": "covers"},
"http://www.opengis.net/ont/geosparql#ehContains": {"type": "ObjectProperty", "relation": "contains"},
"http://www.opengis.net/ont/geosparql#ehCoveredBy": {"type": "ObjectProperty", "relation": "coveredby"},
"http://www.opengis.net/ont/geosparql#ehInside": {"type": "ObjectProperty", "relation": "inside"},
"http://www.opengis.net/ont/geosparql#ehMeet": {"type": "ObjectProperty", "relation": "touches"},
"http://www.opengis.net/ont/geosparql#ehOverlap": {"type": "ObjectProperty", "relation": "contains"},
"http://www.opengis.net/ont/geosparql#rcc8eq": {"type": "ObjectProperty", "relation": "equals"},
"http://www.opengis.net/ont/geosparql#rcc8dc": {"type": "ObjectProperty", "relation": "disjoint"},
"http://www.opengis.net/ont/geosparql#rcc8po": {"type": "ObjectProperty", "relation": "partially overlaps"},
"https://schema.org/containedIn": {"type": "ObjectProperty", "relation": "containedIn"},
"http://www.wikidata.org/prop/direct/P150": {"type": "ObjectProperty", "relation": "contains"},
"http://www.wikidata.org/prop/direct/P131": {"type": "ObjectProperty", "relation": "containedIn"},
"http://www.wikidata.org/prop/direct/P17": {"type": "ObjectProperty", "relation": "containedIn"},
"http://www.wikidata.org/prop/direct/P361": {"type": "ObjectProperty", "relation": "within"},
"http://www.wikidata.org/prop/direct/P706": {"type": "ObjectProperty", "relation": "within"},
"http://geovocab.org/EQ":{"type":"ObjectProperty","relation":"equals"},
"http://geovocab.org/DR": {"type": "ObjectProperty", "relation": "disjoint"},
"http://geovocab.org/O": {"type": "ObjectProperty", "relation": "overlaps"},
"http://geovocab.org/PO": {"type": "ObjectProperty", "relation": "partially overlaps"},
"http://geovocab.org/P": {"type": "ObjectProperty", "relation": "within"},
"http://www.cidoc-crm.org/cidoc-crm/P89_falls_within":{"type": "ObjectProperty", "relation": "contains"},
"http://www.cidoc-crm.org/cidoc-crm/P121_overlaps_with": {"type": "ObjectProperty", "relation": "overlaps"},
"http://www.cidoc-crm.org/cidoc-crm/P122_borders_with": {"type": "ObjectProperty", "relation": "touches"},
"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/containedBy": {"type": "ObjectProperty",
"relation": "containedBy"},
"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/contains": {"type":"ObjectProperty","relation":"contains"},
"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/equals": {"type": "ObjectProperty",
"relation": "equals"},
"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/disjoint": {"type": "ObjectProperty","relation": "disjoint"},
"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/partiallyOverlaps": {"type": "ObjectProperty",
"relation": "partially overlaps"},
"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/touches": {"type": "ObjectProperty","relation": "touches"},
"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/within": {"type": "ObjectProperty",
"relation": "within"},
"https://schema.org/geoContains": {"type": "ObjectProperty", "relation": "contains"},
"https://schema.org/geoCoveredBy": {"type": "ObjectProperty", "relation": "coveredby"},
"https://schema.org/geoCovers": {"type": "ObjectProperty", "relation": "covers"},
"https://schema.org/geoDisjoint": {"type": "ObjectProperty", "relation": "disjoint"},
"https://schema.org/geoEquals": {"type": "ObjectProperty", "relation": "equals"},
"https://schema.org/geoIntersects": {"type": "ObjectProperty", "relation": "intersection"},
"https://schema.org/geoOverlaps": {"type": "ObjectProperty", "relation": "overlaps"},
"https://schema.org/geoTouches": {"type": "ObjectProperty", "relation": "touches"},
"https://schema.org/geoWithin": {"type": "ObjectProperty", "relation": "within"}
}

relationproperties={
"http://www.w3.org/2000/01/rdf-schema#seeAlso":"ObjectProperty",
"http://www.w3.org/2000/01/rdf-schema#subClassOf": "ObjectProperty",
"http://www.w3.org/2004/02/skos/core#related": "ObjectProperty",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "ObjectProperty",
"http://www.w3.org/2004/02/skos/core#exactMatch":"ObjectProperty",
"http://www.w3.org/2004/02/skos/core#closeMatch": "ObjectProperty",
"http://www.w3.org/2004/02/skos/core#broader": "ObjectProperty",
"http://www.w3.org/2004/02/skos/core#narrower": "ObjectProperty",
}

0 comments on commit a9e39e8

Please sign in to comment.