Is it possible to get the list of films in function of their genre?
I 开发者_高级运维tried this:
SELECT DISTINCT ?film_title ?film_abstract ?film_genre
WHERE {
?film_title rdf:type <http://dbpedia.org/ontology/Film> .
?film_title rdfs:comment ?film_abstract .
?film_genre <http://dbpedia.org/ontology/genre> ?film_genre .
FILTER(lang(?film_abstract) = "en" ).
}
LIMIT 20
But probably I've doing something wrong !
Thanks,
DaniloLooks like a simple typo on your part. The third triple pattern should be the following:
?film_title <http://dbpedia.org/ontology/genre> ?film_genre
Also the FILTER you are using may make the query very slow, try using the following instead:
FILTER(LANGMATCHES(LANG(?film_abstract), "en"))
Though having played with your query there doesn't appear to be any data that actually matches your query in DBPedia. Essentially the genre property you are using appears only to be applied to music and not to films so you should remove the third triple pattern entirely if you actually want to get any results
精彩评论