Wikidata sparql query returns 0 result

2019-08-13 05:09发布

问题:

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.