## 3 About Geographic Names and Gazetteers
### Existing Systems
#### 3.4.2 GeoSPARQL  
GeoSPARQL [23] is a standard for the representation and querying of geospatially-linked data for the Semantic Web from the Open Geospatial Consortium (OGC) [24]. It can be seen as an extension of SPARQL [25]. The definition of a small ontology based on well-understood OGC standards is intended to provide a standardized exchange basis for geospatial Resource Description Framework (RDF) [26] data, which can support both quantitative and qualitative spatial reasoning and querying with the SPARQL database query language.  
However, with SPARQL, some simple geographic queries, _i.e._, without geometric information and spatial relationships, can be launched. For instance: \"What are all of the country capitals in Africa?\"  
* PREFIX abc: \(<\)[[http://example.com/exampleOntology#](http://example.com/exampleOntology#)]([http://example.com/exampleOntology#](http://example.com/exampleOntology#))\(>\)
* SELECT?capital?country
* WHERE {
*?x abc:cityname?capital ;
* abc:isCapitalOf?y.
*?y abc:countryname?country ;
* abc:isInContinent abc:Africa.  
However, with GeoSPARQL, not only geometric attributes (shapes), but also Egenhofer/RCC topological relations can be invoked.  
In addition, the following functions are integrated: distance, buffer, convex hull, intersection, union, difference, _etc_. The general structure and an example are given in Figure 8, in which WKT means \"well known text\" as defined by OGC. To get the Washington Monument, one has to write a small filter as a minimum bounding rectangle (MBR) as exemplified in the GeoSPARQL user guide (by using an MBR, the search space is reduced not to run the query against the whole database):  
* PREFIX geo: \(<\)[[http://www.opengis.net/ont/geosparql#](http://www.opengis.net/ont/geosparql#)]([http://www.opengis.net/ont/geosparql#](http://www.opengis.net/ont/geosparql#))\(>\)
* PREFIX geof: \(<\)[[http://www.opengis.net/def/function/geosparql/](http://www.opengis.net/def/function/geosparql/)]([http://www.opengis.net/def/function/geosparql/](http://www.opengis.net/def/function/geosparql/))\(>\)
* PREFIX sf: \(<\)[[http://www.opengis.net/ont/sf#](http://www.opengis.net/ont/sf#)]([http://www.opengis.net/ont/sf#](http://www.opengis.net/ont/sf#))\(>\)
* PREFIX ex: \(<\)[[http://example.org/PointOfInterest#](http://example.org/PointOfInterest#)]([http://example.org/PointOfInterest#](http://example.org/PointOfInterest#))\(>\)
* SELECT?a
* WHERE {
*?a geo:hasGeometry
*?ageo.
*?ageo geo:asWKT
*?alit
* FILTER( geof:sfWithin(?alit, \"Polygon((-77.089005 38.913574,-77.029953 38.913574,-77.029953 38.886321,-77.089005 38.886321,-77.089005 38.913574)))\"\(\wedge\)\"\(\wedge\)\"sf:wktLiteral)) }  
For instance, a query for getting the airports near London is as follows:  
* PREFIX co: \(<\)[[http://www.geonames.org/countries/#](http://www.geonames.org/countries/#)]([http://www.geonames.org/countries/#](http://www.geonames.org/countries/#))\(>\)
If somebody is looking for all land parcels with some type of commercial zoning that touches some arterial street, the query is the following:  
SELECT?parcel?hwy  
WHERE {?parcel rdf:type :Commercial.  
?parcel rdf:type ogc:GeometryObject.  
?hwy rdf:type :Arterial_Street.  
?hwy rdf:type ogc:GeometryObject.  
?parcel ogc:touches?hwy }  
Now that the notions of gazetteers and geographic ontologies in multiple languages are clarified, let us work with those elements to enrich them.