You will find a list of 120 queries related to Geonames



You will find a list of 120 queries related to Geonames dataset. Please help in translating these
queries to SPARQL.
To explain the conversion process lets use the following example
Let’s say the query is
“Find names of schools in the State of Ohio”.
Now, to frame the query please do the following
1. Identify what is being looked for. In this case it is names of Schools we are looking for, so our
query variable is the school and we will require a constraint for the same. So if the concept is
school ,we will have a constraint in the query
a. ?school
geo:name ?schoolname
Where geo:name denotes the Geonames property of English Name of the place.
2.
Geonames assigns feature codes to uniquely distinguish various kinds of entities such as
between New York City and New York State. So next thing to do would be insert a constraint for
the same.For this please use a table which is provided.However,if you are not sure if the the
feature code is listed here,please leave this triple constraint. For the example above,the
following constraint will work
?school
geo:featureCode
geo: S.SCH
It basically says school are entities in Geonames with feature code S.SCH
3. The next thing is identifying where the feature of interest is located.In this case,it is located in a
state. So similar to above, use a constraint
?state
geo:featureCode
geo:A.ADM1
Where A.ADM1 is a code for identifying state in the Geonames taxonomy. And ?state is the
concept denoting the state. Again,if you are not sure of the feature code to use, please leave it
empty or if you have time and energy check it on Wikipedia and then verify with the table.
4. Next is specifying the state has name “Ohio”
?state geo:name “Ohio”
5. Finally we specify the relationship the school is in Ohio, for this please use the property
geo:parentFeature
So over here it will be
?school geo:parentFeature ?state
Finally putting everything together we have
Select ?schoolname
WHERE
{
?school geo:name ?schoolname.
?school geo:featureCode geo:S.SCH.
?state geo:featureCode
geo:A.ADM1
?state geo:name “Ohio”.
?school geo:parentFeature ?state
}
If there is any confusion please feel free to call me/shoot me an email anytime.
If you need help with SPARQL, you can use the following resources
http://www.dajobe.org/2005/04-sparql/SPARQLreference-1.8-us.pdf
Feature Code
Entity Type
State,Province,..
Country
Desert , Sand Dune
Continent
Capital of State
Capital of Country
a tract of land, smaller than a continent,
surrounded by water at high water such as Island
A group of islands or an archiplego
an area distinguished by one or more observable
physical or cultural characteristics
a city, town, village, or other agglomeration of
buildings where people live and work
Parks,areas etc such as national parks
a large inland body of standing water such as a
lake
A river or stream.
A marshy depression or a low area surrounded by
higher land and usually characterized by interior
drainage
A bay such as in an ocean
Historical places not in use any more
A statue or a fountain like structure
section of populated place
Code
A.ADM1
A.PCLI
T.DUNE
L.CONT
P.PPLA
P.PPLC
T.ISL
T.ISLS
L.RGN
P.PPL
L
H.LK
H.STM
T.DPR
H.BAY
S.RUIN
S.MNMT
P.PPLX
an elevation standing high above the surrounding
area with small summit area, steep slopes and
local relief of 300m or more such as Volcano
Airport
T.MT
S.AIRP
If you think something should be provided here,please have a look at the ontology on
http://www.geonames.org/ontology/ontology_v2.0_Lite.rdf and check for entities appearing after
<!-- Instances -->