query-3e5405a9bd9fd6e69ddea74a889be14e
Items described by a book, with pagenumber from the qualifierI tried several structures myself, but had no luck so far. The basic query is select ?item ?itemLabel ?pagenumber where { ?item wdt:P1343 wd:Q28927781; SERVICE wikibase:label { bd:serviceParam wikibase:language "nl" } } Right now I miss the page number that is in P304 in the qualifiers. Who knows how to add this? 15:27, 6 May 2020 (UTC)) talk (EdoderooThanks in advance,
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?item ?itemLabel ?pagenumber
where
{
?item p:P1343 ?st .
?st ps:P1343 wd:Q28927781 .
OPTIONAL { ?st pq:P304 ?pagenumber }
SERVICE wikibase:label { bd:serviceParam wikibase:language "nl" }
}
ORDER BY xsd:integer(?pagenumber)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?pagenumber"):::projected
v3("?st")
c6(["bd:serviceParam"]):::iri
c3(["wd:Q28927781"]):::iri
c8(["nl"]):::literal
v2 --"p:P1343"--> v3
v3 --"p:statement/P1343"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P304".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end