query-0b431072f4e3083512d2dac9bcfdbad7
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?property ?propertyLabel ?value ?valueLabel ?statement
WHERE
{
?item ?ppp ?statement . # there is a triple having ?statement as its object
?statement ?qqq ?value. # there is a triple having ?statement as its subject
# we need ?ppp to be a p:Pnnn and ?qqq to be a ps:Pnnn predicate
# so that we know we're in the right part of the data model to be able
# to test for a property statement reference. So...
?property a wikibase:Property ; # there is a property
wikibase:claim ?ppp ; # which has a predicate in the form p:Pnnn and an object ?ppp
# so the variable ?ppp is a p:Pnnn predicate, and ?statement must be a property statement
wikibase:statementProperty ?qqq . # and which has a predicate in the form of ps:Pnnn and an object ?qqq
# so the variable ?qqq is a ps:Pnnn predicate, and ?value must be the value for this property statement
?statement prov:wasDerivedFrom ?autre_statement. #d'après la source ... # and as you know, the property statement has at least one reference
?autre_statement pr:P248 wd:Q100443909 . # and the reference is 'stated in' 'Q100443909'
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?autre_statement")
v1("?item"):::projected
v2("?ppp")
v6("?property"):::projected
v4("?qqq")
v3("?statement"):::projected
v5("?value"):::projected
c9(["bd:serviceParam"]):::iri
c2(["wikibase:Property"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c7(["wd:Q100443909"]):::iri
v1 -->v2--> v3
v3 -->v4--> v5
v6 --"a"--> c2
v6 --"wikibase:claim"--> v2
v6 --"wikibase:statementProperty"--> v4
v3 --"prov:wasDerivedFrom"--> v7
v7 --"p:reference/P248"--> c7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end