Daniel,
On Sun, Jan 10, 2016 at 3:53 AM, Daniel Mietchen daniel.mietchen@googlemail.com wrote:
What I want now is a list of (ideally) statements (or - less ideally - items with such statements) that have references of one of the types given in (1) and (2).
It would look something like:
PREFIX wd: http://www.wikidata.org/entity/ PREFIX wdt: http://www.wikidata.org/prop/direct/ PREFIX prov: http://www.w3.org/ns/prov# PREFIX pr: http://www.wikidata.org/prop/reference/
SELECT ?statement ?PMID ?PMCID WHERE { ?statement prov:wasDerivedFrom/pr:P248 ?paper . ?paper wdt:P31 wd:Q13442814 . OPTIONAL { ?paper wdt:P698 ?PMID . } OPTIONAL { ?paper wdt:P932 ?PMCID . } }
https://query.wikidata.org/#PREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.or...
Then you can filter for your two options with:
FILTER (BOUND(?PMID)) FILTER (!BOUND(?PMID))
Grtz,
Egon