Wikidata sparql query returns 0 result

余生长醉 提交于 2019-12-24 10:24:21

问题


I’m new to query languages and linked data so thanks a lot for the help. I also have a similar question about sparql on dbpedia dbpedia sparql query returns 0 result

I would like to look up all the art movements in wikidata with the associated artists (founder/inventor/creator, known for), date start, date end, country. Here is my query:

PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?art ?artLabel ?start ?end ?countryLabel ?influencebyLabel WHERE {
?art wdt:P31 wd:Q968159 ;
   wdt:P571 ?start ;
   wdt:P576 ?end;
   wdt:P17 ?country ;
   wdt:P737 ?influenceby .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 }

When I run the query only for the artLabel, it shows 300s result but as only a few has start date, when I include the start date, my dataset shrank, and when I include the rest of the search terms, there’s few record that has all information. My question is how can I generate result where the empty cells also get recorded instead of discarded?

Also, what’s the difference between this wikidata result and the dbpedia result?

Thanks


回答1:


Answered in the comments...

Ettore Rizza wrote:

You need to add optional clauses for the properties that are not always filled.



来源:https://stackoverflow.com/questions/49706339/wikidata-sparql-query-returns-0-result

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