简体   繁体   中英

How can I retrieve the wikipageID if the page is not in english using sparql and dbpedia

I want to retrieve the wikipageID for the same query name in different languages. For example:

select * where { <http://dbpedia.org/resource/Mike_Quigley_(footballer)> dbpedia-owl:wikiPageID ?wikiID }
====>Mike_Quigley_(footballer)   17237449   en
select * where { <http://dbpedia.org/resource/Theodore_Roberts> dbpedia-owl:wikiPageID ?wikiID }
====>Theodore_Roberts   6831454   en
select * where { <http://de.dbpedia.org/resource/Theodore_Roberts> dbpedia-owl:wikiPageID ?wikiID }
====>Theodore_Roberts      de
select * where { <http://fr.dbpedia.org/resource/Theodore_Roberts> dbpedia-owl:wikiPageID ?wikiID }
====>Theodore_Roberts      fr
select * where { <http://it.dbpedia.org/resource/Theodore_Roberts> dbpedia-owl:wikiPageID ?wikiID }
====>Theodore_Roberts      it
select * where { <http://ja.dbpedia.org/resource/セオドア・ロバーツ> dbpedia-owl:wikiPageID ?wikiID }
====>セオドア・ロバーツ      ja

In the first query Mike_Quigley_(footballer) which is in english I was able to retrieve its ID = 17237449 but when the language changes as you can see I cannot retrieve the wikipageIDs.


  • How can I retrieve the ids of these pages
  • The more complex part is that the following link German language Theodore_Roberts will lead me to a page where the property wikipageID is not dbpedia-owl It gets really complicated. Do you have any idea on how to solve it?

Amazing, when I try this query

SELECT ?uri ?id 
     WHERE {
         ?uri <http://dbpedia.org/ontology/wikiPageID> ?id.
         FILTER (?uri = <http://dbpedia.org/resource/Lyon>) 
     }

I get the following result:

http://dbpedia.org/resource/Lyon 863863


But When I change the uri to <it.dbpedia.org/resource/Lyon> I get nothing.

So if I understand correctly you want to get the Italian version of your URI. But the problem is you are looking for the wrong URI. The Italian version of Lyon URI in English DBpedia is http://it.dbpedia.org/resource/Lione and I am assuming you are using that. I found this out by:

SELECT * 
 WHERE {
     ?uri owl:sameAs ?b.
     FILTER (?uri = <http://dbpedia.org/resource/Lyon>) 
 }

And I couldn't get the Italian pageID from the English DBPedia. When I tried in on the Italian DBpedia , it worked :

SELECT ?uri ?id 
 WHERE {
     ?uri <http://dbpedia.org/ontology/wikiPageID> ?id.
     FILTER (?uri = <http://it.dbpedia.org/resource/Lyon>) 
 }

However, if you look at the Italian page http://it.dbpedia.org/resource/Lyon , you can see that it has a property dbpedia-owl:wikiPageRedirects which is equal to http://it.dbpedia.org/resource/Lione that the owl:sameAs gives you. Maybe you can work your way through that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM