Weird result from DBPedia -


i'm trying query list of airports , iata code:

prefix p: <http://dbpedia.org/property/> prefix o: <http://dbpedia.org/ontology/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>  select distinct ?airport ?iata ?name  {     ?airport rdf:type o:airport ;      p:iata ?iata ;      p:name ?name  } order ?airport 

executing it looks fine, there weird blocks airport assigned wrong name, such as:

http://dbpedia.org/resource/prince_abdul_majeed_bin_abdul_aziz_domestic_airport  "ulh"@en   "prince abdul majeed bin abdul aziz airport"@en http://dbpedia.org/resource/prince_albert_(glass_field)_airport                  "ypa"@en   "prince abdul majeed bin abdul aziz airport"@en http://dbpedia.org/resource/prince_george_airport                                "yxs"@en   "prince abdul majeed bin abdul aziz airport"@en http://dbpedia.org/resource/prince_mohammad_bin_abdulaziz_airport                "med"@en   "prince abdul majeed bin abdul aziz airport"@en http://dbpedia.org/resource/prince_rupert/seal_cove_water_airport                "zsw"@en   "prince abdul majeed bin abdul aziz airport"@en http://dbpedia.org/resource/prince_rupert_airport                                "ypr"@en   "prince abdul majeed bin abdul aziz airport"@en http://dbpedia.org/resource/prince_said_ibrahim_international_airport            "hah"@en   "prince abdul majeed bin abdul aziz airport"@en http://dbpedia.org/resource/princess_juliana_international_airport               "sxm"@en   "prince abdul majeed bin abdul aziz airport"@en 

besides having "prince" in name seem have nothing in common. clicking through resource suggests no relation name they've been assigned.

what doing wrong?

edit - found solution:

removing "order ?airport" or changing "order ?iata" fixes problem.

the dbpedia ontology (dbpedia-owl) data tends bit cleaner older infobox data (dbprop), thought might want use query uses dbpedia-owl properties:

select ?airport ?iata ?name {     ?airport dbpedia-owl:airport ;              dbpedia-owl:iatalocationidentifier ?iata ;              rdfs:label ?name .     filter langmatches( lang( ?name ), "en" ) } order ?airport 

sparql results

the data better, there still bizarre results like:

http://dbpedia.org/resource/prince_albert_(glass_field)_airport "ypa"@en    "prince albert (glass field) airport"@en http://dbpedia.org/resource/prince_george_airport   "yxs"@en    "prince albert (glass field) airport"@en http://dbpedia.org/resource/prince_mohammad_bin_abdulaziz_airport   "med"@en    "prince albert (glass field) airport"@en http://dbpedia.org/resource/prince_rupert/seal_cove_water_airport   "zsw"@en    "prince albert (glass field) airport"@en http://dbpedia.org/resource/prince_rupert_airport   "ypr"@en    "prince albert (glass field) airport"@en http://dbpedia.org/resource/prince_said_ibrahim_international_airport   "hah"@en    "prince albert (glass field) airport"@en http://dbpedia.org/resource/princess_juliana_international_airport  "sxm"@en    "prince albert (glass field) airport"@en http://dbpedia.org/resource/princeton_airport_(new_jersey)  "pct"@en    "prince albert (glass field) airport"@en 

in interest of trying few different approaches, decided try grouping ?airport , ?iata, , sampling name:

select ?airport ?iata sample(?name) {     ?airport dbpedia-owl:airport ;              dbpedia-owl:iatalocationidentifier ?iata ;              rdfs:label ?name .     filter langmatches( lang( ?name ), "en" ) } group ?airport ?iata order ?airport 

sparql results

this gets different, equally strange results, e.g.:

http://dbpedia.org/resource/%22solidarity%22_szczecin-goleni%c3%b3w_airport "szz"@en    ""solidarity" szczecin-goleniów airport"@en http://dbpedia.org/resource/%c3%81ngel_albino_corzo_international_airport   "tgz"@en    ""solidarity" szczecin-goleniów airport"@en http://dbpedia.org/resource/%c3%84ngelholm-helsingborg_airport  "agh"@en    ""solidarity" szczecin-goleniów airport"@en http://dbpedia.org/resource/%c3%85lesund_airport,_vigra "aes"@en    ""solidarity" szczecin-goleniów airport"@en http://dbpedia.org/resource/%c3%85re_%c3%96stersund_airport "osd"@en    ""solidarity" szczecin-goleniów airport"@en 

and yet, if group name instead, , select name , count number of airports given name, 1 across board, names appear twice!

select count(?airport) ?name {     ?airport dbpedia-owl:airport ;              dbpedia-owl:iatalocationidentifier ?iata ;              rdfs:label ?name .     filter langmatches( lang( ?name ), "en" ) } group ?name order ?name 

sparql results

1   "abraham gonzález international airport"@en 1   "abraham gonzález international airport"@en ... 1   "prince albert (glass field) airport"@en 1   "prince albert (glass field) airport"@en 1   "prince albert (glass field) airport"@en 1   "prince albert (glass field) airport"@en 1   "prince albert (glass field) airport"@en 1   "prince albert (glass field) airport"@en 1   "prince albert (glass field) airport"@en 1   "prince albert (glass field) airport"@en 

this bizarre. doesn't there wrong query, weird going on over @ dbpedia. can take @ of these strange entries, , data dbpedia show doesn't match these results. instance, 1 of results original query

http://dbpedia.org/resource/prince_mohammad_bin_abdulaziz_airport   "med"@en    "prince albert (glass field) airport"@en 

but if visit http://dbpedia.org/page/prince_mohammad_bin_abdulaziz_airport , search page "albert", won't find there.


Comments