Fetching a list of books adapted into films from dbpedia

我只是一个虾纸丫 提交于 2019-12-19 12:01:27

问题


I am trying to fetch a list of American movies adapted from books from dbpedia. This is what I have so far:

PREFIX onto: <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT * WHERE {

?movie dcterms:subject <http://dbpedia.org/resource/Category:American_films> .
?movie dcterms:subject <http://dbpedia.org/resource/Category:Films_based_on_novels> .
?movie onto:basedOn ?book .
?book a onto:Book .
}

I get only 4 results back. Is there another property I can use to get more results?


回答1:


First thing, try removing the second line of your pattern --

?movie dcterms:subject <http://dbpedia.org/resource/Category:Films_based_on_novels> .

You'll get a great many more results from --

PREFIX onto: <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://purl.org/dc/terms/>

SELECT * WHERE 
  {
    ?movie  dcterms:subject  <http://dbpedia.org/resource/Category:American_films> ;
            onto:basedOn     ?book .
    ?book   a                 onto:Book .
  }

Have you looked at the descriptions of the results you did get? That will show you the properties you might use...

Remember that you're limited by the data in DBpedia, which may not have what you think it should (for instance, not every film based on a novel is explicitly categorized as such, as you can see by the different results I got), and may also be 6 or more months out of sync with Wikipedia. You might look at DBpedia-live, for constantly updated ingestion.



来源:https://stackoverflow.com/questions/41770201/fetching-a-list-of-books-adapted-into-films-from-dbpedia

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!