0

I have checked the ontology of GeoSPARQL and I have found this:

<gn:Code rdf:about="#A.ADMD"
                 skos:notation="A.ADMD">
    <skos:definition xml:lang="en">an administrative division of a country, undifferentiated as to administrative level</skos:definition>
    <skos:inScheme rdf:resource="#A"/>
    <skos:prefLabel xml:lang="en">administrative division</skos:prefLabel>
</gn:Code>

I would like to write a query for Mexico, that would fetch me this information, something like this:

PREFIX gn: <http://www.geonames.org/ontology#>
PREFIX co: <http://www.geonames.org/countries/#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT  ?admd
WHERE { 
     ?admd rdf:about gn:MX . 
}

but I am getting nothing. Can anybody help?

I test in GeoSPARQL endpoint and in stSPARQL endpoint.


EDIT.0:

This:

select * {
    "#A.ADMD" ?predicate ?object
}

won't return anything.


EDIT.1:

Only this ?administration gn:A.ADMD gn:MX gives me a result in the stSPARQL endpoint, but it's all "Dimos Chania", which I am pretty sure it's wrong. I am almost sure I have to run the query at the GeoSPARQL endpoint, but I am getting nothing back as a result!


EDIT.2:

What I am want to ask, is give me the administrative levels of Mexico, so I thought that if we were able to have a query that would fetch A.ADMD, then I would be able to do so for ADM1..ADM5.

So, I executed this query in the GeoSPARQL endpoint:

PREFIX gn:<http://www.geonames.org/ontology#>

Select * 
WHERE{
  ?administration gn:A.ADMD gn:MX
}

and I got nothing back.

gsamaras
  • 71,951
  • 46
  • 188
  • 305
  • Possible duplicate of [How can one extract rdf:about or rdf:ID properties from triples using SPARQL?](http://stackoverflow.com/questions/2760896/how-can-one-extract-rdfabout-or-rdfid-properties-from-triples-using-sparql) – Jeen Broekstra Dec 05 '15 at 04:09
  • @JeenBroekstra that was helpful, but I couldn't get anything with `"A.ADMD" ?predicate ?object` and variations! – gsamaras Dec 05 '15 at 16:16
  • 2
    @gsamaras A string can't be the subject of a triple in RDF, so you'll get no results with that query. I think you need to be trying `gn:MX gn:A.ADMD ?administration` or `?administration gn:A.ADMD gn:MX`. – Joshua Taylor Dec 05 '15 at 17:22
  • @JoshuaTaylor I just tried on GeoSPARQL, but got nothing back!! – gsamaras Dec 05 '15 at 21:02
  • @gsamaras it's not really clear what you're actually asking. The problem in your original question was that you were querying `rdf:about` as if it was a predicate (which it isn't). If you have a new/followup question, please ask it as a new question (or edit this one to make it more clear what exactly the problem is now). Please be clear about what what queries you've tried, what the expected outcome was, and what the _actual_ outcome was. – Jeen Broekstra Dec 05 '15 at 22:20
  • @JeenBroekstra sorry about that. I updated my question. What I want is to ask about Mexico and get back its administrative levels. What was proposed so far, simply returned nothing. – gsamaras Dec 06 '15 at 20:38
  • @gsamaras Just to be clear, the second endpoint you mention has the note, **"The dataset is based on the Greek Administrative Geography (Kallikratis)."** I see why it has Greek data; do you have any reason to suppose that it has information about Mexico? – Joshua Taylor Dec 07 '15 at 19:33
  • No @JoshuaTaylor, that's why I have GeoSPARQL as the first endpoint. I just used the other one in a desperate action, since I am do not know what to do! However, I see that I have keep you busy for too long, so I will probably mark the question as a dupe. Thanks! :) – gsamaras Dec 07 '15 at 19:39
  • @gsamaras Do you have any reason to suppose that the GeoSPARQL endpoint has any of that information either, though? I don't see any use of that property in there, either. – Joshua Taylor Dec 07 '15 at 20:30
  • 1
    By the way, if you just want to retrieve the 32 administrative districts of Mexico, you could use [DBpedia's endpoint](http://dbpedia.org/sparql) and run a query like: [`select ?x { ?x dbo:type dbr:Administrative_divisions_of_Mexico }`](http://goo.gl/rw3vCG). – Joshua Taylor Dec 07 '15 at 20:36
  • @JoshuaTaylor not at all. Mexico was just an example I picked, because that endpoint had an example about cities of Mexico. DBpedia's example you gave, gives me names, where I want levels, such as Municipality, state or like I have in my question AMD1, etc.. Never mind, I will investigate, thanks. :) – gsamaras Dec 07 '15 at 20:58

0 Answers0