Sparql Query on GeoNames Ontology using Nearby

1.5k views Asked by At

I'm trying several queries on the site : http://geosparql.org/

I'm very interested in trying the clause : NEARBY, for example this query using NEARBY in this way:

PREFIX spatial:<http://jena.apache.org/spatial#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX gn:<http://www.geonames.org/ontology#>

Select * 
WHERE{
?object spatial:nearby(40.74 -73.989 1 'mi').
?object rdfs:label ?label
}LIMIT 10

When i execute the query on site http://geosparql.org/ all is ok but now i desire download the GeoNames Ontology and execute it on my PC.

here i have found the ontology for download: http://www.geonames.org/ontology/documentation.html

He tells me that The Ontology for GeoNames is available in OWL :

http://www.geonames.org/ontology/ontology_v3.1.rd

I download it but when i open ontology with software Protegè or with Sparql Droid on my smarphone Android and execute same query I get no data maybe the ontology is empty?

How do I fill the ontology, in order to run this query?

Thank you very much to those who will help me.

2

There are 2 answers

2
Joshua Taylor On

The ontology is the vocabulary (i.e., definition of classes, properties, etc.) An ontology doesn't necessarily include the individuals (e.g., the places, locations, etc.) that you might be interested in. In this case, I think you've downloaded the ontology, which is relatively small, but you're probably interested in the data dumps that that page describes later. I think the fourth option is the one that you want:

Entry Points into the GeoNames Semantic Web

There are several ways how you can enter the GeoNames Semantic Web :

  • RDF dump with 10113356 features and about 150 mio rdf triples (2015 04 21). The dump has one rdf document per toponym on every line of the file. Note: The file is pretty large. Make sure the tool you use to uncompress is able to deal with the size and does not stop after 2GB, an issue that happens with some old (windows) tool versions.
0
Rourou Taa On

Open the web page geonames then Clic on the given OWl URI Geonames Ontology the geonames onto is then downloaded. open protégé then menu File> Open and import the owl document the ontology concepts is then added to protégé; use it to add your own instanc