diff --git a/kwg_geoenrichment/kwg_geoenrichment.py b/kwg_geoenrichment/kwg_geoenrichment.py index db58935..6da11c1 100644 --- a/kwg_geoenrichment/kwg_geoenrichment.py +++ b/kwg_geoenrichment/kwg_geoenrichment.py @@ -54,8 +54,8 @@ # Import the code for the dialog _SPARQL_ENDPOINT_DICT = { - "KnowWhereGraph": "https://stko-kwg.geog.ucsb.edu/graphdb/repositories/KWG", - "KnowWhereGraph - Stage": "https://staging.knowwheregraph.org/graphdb/repositories/KWG" + "KnowWhere Graph V2 (stable)": "https://stko-kwg.geog.ucsb.edu/graphdb/repositories/KWG-V2-Vienna", + "KnowWhere Graph V3 (beta)": "https://stko-kwg.geog.ucsb.edu/sparql" } class kwg_geoenrichment: diff --git a/kwg_geoenrichment/kwg_sparqlquery.py b/kwg_geoenrichment/kwg_sparqlquery.py index d7d82c4..900544d 100644 --- a/kwg_geoenrichment/kwg_sparqlquery.py +++ b/kwg_geoenrichment/kwg_sparqlquery.py @@ -45,6 +45,7 @@ def getEntityValuesFromGeometry(self, try: while keepPaginating: + geoPrefix = "kwg-ont" if sparql_endpoint=="https://stko-kwg.geog.ucsb.edu/graphdb/repositories/KWG-V2-Vienna" else "geo" queryString = """ select distinct ?entity where { values ?userWKT {"%s"^^geo:wktLiteral}. @@ -54,7 +55,7 @@ def getEntityValuesFromGeometry(self, ?arGeo2 geo:asWKT ?arWKT2. FILTER(geof:sfIntersects(?userWKT, ?arWKT2) || geof:sfWithin(?userWKT, ?arWKT2)). - ?adminRegion3 kwg-ont:sfWithin ?adminRegion2. + ?adminRegion3 %s:sfWithin ?adminRegion2. ?adminRegion3 a kwg-ont:AdministrativeRegion_3. ?adminRegion3 geo:hasGeometry ?arGeo3. ?arGeo3 geo:asWKT ?arWKT3. @@ -69,7 +70,7 @@ def getEntityValuesFromGeometry(self, {?entity ?p ?s2Cell.} union {?s2Cell ?p ?entity.} ?entity a geo:Feature. } - """ % (wkt_literal) + """ % (wkt_literal, geoPrefix) query = queryPrefix + queryString query += "ORDER BY ?entity "