I am trying to get specific countries informations from geonames using "Linked Data HTW Chur sparql endpoint" (url: http://linkeddata.fh-htwchur.ch/lodestar/sparql ):
PREFIX gn: <http://www.geonames.org/ontology#>
PREFIX wgs84_pos: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX dcterms: <http://purl.org/dc/terms/>
select distinct ?country ?population ?lattitude ?longitude ?creationDate ?modificationDate
from <http://sws.geonames.org>
where { ?country gn:name ?country_name;
gn:population ?population;
wgs84_pos:lat ?lattitude;
wgs84_pos:long ?longitude;
dcterms:created ?creationDate;
dcterms:modified ?modificationDate
}
The query works if I remove "dcterms:created" and "dctermes:modified" but I need both to extract the data item creation date and the last modification date
If someone could please help me
You have to distinguish between the concept and the document about this concept.
Example for the United States:
https://sws.geonames.org/6252001/(concept, i.e., the actual country)https://sws.geonames.org/6252001/about.rdf(GeoNames document about this concept)These URIs refer to each other via
rdfs:isDefinedBy/foaf:primaryTopic.The
dcterms:createdproperty gives the date when the document was created, not when the country was created. The same applies todcterms:modified.If you don’t need to refer to the "document about the concept" in your results, you could use property paths to get the values:
Otherwise you can use another variable for it: