query-f512c5ea9df9d45ff5b2088acc07ad66
P217 + prov:wasDerivedFrom. this query? Something sort of similar to (P217)inventory number , along with a local particular source reference to a (P248)stated in How to query Wikidata to get a list of items that include a I'd like a result with columns like this: Q-Person / Person-label / Title-of-source / Inventory-number Q1234 / John Smith / Biographical Dictionary / 5-8907 Q5678 / Anthony Williams / Biographical Dictionary / 12-99944 of an item that includes the source and local identifier as a reference. Here is an example 19:25, 19 June 2021 (UTC)) talk (M2545I know "prov:wasDerivedFrom" is involved, but unfortunately my SPARQL skills remain rudimentary. Advice gratefully accepted. -- : I think this query should produce what you want...M2545@
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?x ?xLabel ?source ?sourceLabel ?inventory_num ?propertyLabel WHERE {
VALUES ?source { wd:Q107290461 } # place the sources here
?x ?p ?stmt .
?stmt prov:wasDerivedFrom [
pr:P248 ?source ; # stated in
pr:P217 ?inventory_num
] .
?property wikibase:claim ?p . # what property is the reference on
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?inventory_num