开发者

DBPEDIA + SPARQL Selecting films in function of their genre

开发者 https://www.devze.com 2023-03-05 06:22 出处:网络
Is it possible to get the list of films in function of their genre? I 开发者_高级运维tried this:

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,

Danilo


Looks 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

0

精彩评论

暂无评论...
验证码 换一张
取 消