Asiyah,

Your query does not show Alaska or Delaware because there are no "cities"
in those states (at least as far as that query is concerned).

For example the dbpedia resource for <
http://dbpedia.org/resource/Wilmington,_Delaware> has the following types:

<http://dbpedia.org/ontology/Place>
<http://dbpedia.org/ontology/PopulatedPlace>
<http://dbpedia.org/ontology/Settlement>

but there is no <http://dbpedia.org/ontology/City>, so your query does not
match it.

DBpedia extracts information from Wikipedia, and if you edit the Wikipedia
page for Wilmington, Delaware you will see that it uses the {{infobox
settlement}} template but doesn't give a `settlement_type`, so DBpedia's
mapping only calls it a generic Settlement -- there's nothing to say City.

What next?

  * You could find another criteria for your cities (possibly just
Settlement)
  * You could make the city `OPTIONAL` in your query
  * You could fix enough of the Wikipedia pages that you get the results
you want


Good luck!

On 30 January 2015 at 16:02, Asiyah Yu Lin <linik...@gmail.com> wrote:

> Dear all,
>
> I need the US cities, counties and states information.
> I have searched DBpedia for quite a while to search all the US states,
> cities. I am using :
>
> SELECT DISTINCT *
> WHERE {
> ?city dbpedia-owl:isPartOf ?state .
> ?city dbpedia-owl:type    dbpedia:City.
> ?state rdf:type yago:StatesOfTheUnitedStates
> }
>
>
> There are only 47 states and 8463 cities there.
> No New_Jersey, Alaska, Delaware, in the result.
>
> Can someone help me with the query?
> How can I find all the states and their cities and counties?
>
> Many thanks,
> Asiyah
>
>
-- 
Rob Hunter
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to