Skip to content

Instantly share code, notes, and snippets.

@juliennonin
Last active August 6, 2020 13:24
Show Gist options
  • Save juliennonin/40b93ebc1e1f5bc73bcc8f8aac3673c5 to your computer and use it in GitHub Desktop.
Save juliennonin/40b93ebc1e1f5bc73bcc8f8aac3673c5 to your computer and use it in GitHub Desktop.
[GeoSparQL][diffuseur.datatourisme.gouv.fr][isLocatedAt] Datatourism request
PREFIX geo: <http://www.bigdata.com/rdf/geospatial#>
CONSTRUCT {
?res <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <urn:resource>.
} WHERE {
<http://www.bigdata.com/queryHints#Query> <http://www.bigdata.com/queryHints#optimizer> "None".
?res <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.datatourisme.gouv.fr/ontology/core#PointOfInterest>.
?res <https://www.datatourisme.gouv.fr/ontology/core#isLocatedAt> ?5f2bf19f87ae4.
?5f2bf19f87ae4 <http://schema.org/geo> ?poi.
{
SERVICE geo:search {
?poi geo:search "inCircle".
?poi geo:predicate <https://www.datatourisme.gouv.fr/ontology/core#latlon>.
?poi geo:spatialCircleCenter "49.104644#6.202224". # Metz
?poi geo:spatialCircleRadius "10". # default unit: km
?poi geo:searchDatatype <http://www.bigdata.com/rdf/geospatial/literals/v1#lat-lon>.
}
<http://www.bigdata.com/queryHints#SubQuery> <http://www.bigdata.com/queryHints#optimizer> "Static".
}
}
PREFIX geo: <http://www.bigdata.com/rdf/geospatial#>
CONSTRUCT {
?res <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <urn:resource>.
} WHERE {
<http://www.bigdata.com/queryHints#Query> <http://www.bigdata.com/queryHints#optimizer> "None".
?res <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.datatourisme.gouv.fr/ontology/core#PointOfInterest>.
?res <https://www.datatourisme.gouv.fr/ontology/core#isLocatedAt> ?location.
?location <http://schema.org/geo> ?poi.
{
SERVICE geo:search {
?poi geo:search "inRectangle".
?poi geo:predicate <https://www.datatourisme.gouv.fr/ontology/core#latlon>.
?poi geo:spatialRectangleSouthWest "49.111788#6.167493".
?poi geo:spatialRectangleNorthEast "49.124147#6.183120" .
?poi geo:searchDatatype <http://www.bigdata.com/rdf/geospatial/literals/v1#lat-lon>.
}
<http://www.bigdata.com/queryHints#SubQuery> <http://www.bigdata.com/queryHints#optimizer> "Static".
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment