query-e196809e9c6de5d5b8a5b5f6364ec322
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?property ?propertyLabel ?propertyQualifier ?propertyQualifierLabel ?qualifier_value
WHERE
{
wd:Q76 ?propertyStatement ?statement.
?property wikibase:claim ?propertyStatement. # find the Property for the Predicate ?propertyStatement and
# constrain ?propertyStatement to the p: class of Predicates
?property wikibase:statementProperty ?statementProperty. # assign the ps: Predicate for the Property to ?statementProperty
?statement ?statementProperty wd:Q1297. # now apply ?statementProperty exactly as if it was ps:Pnnn
OPTIONAL {?statement ?qualifier ?qualifier_value. # find another triple hanging off the ?statement
?propertyQualifier wikibase:qualifier ?qualifier.} # constrain the Predicate of this triple to be of the class pq:
# and hence ?propertyQualifier is the Property for this Qualifier
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;
v3("?property"):::projected
v7("?propertyQualifier"):::projected
v1("?propertyStatement")
v5("?qualifier")
v6("?qualifier_value"):::projected
v2("?statement")
v4("?statementProperty")
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c1(["wd:Q76"]):::iri
c4(["wd:Q1297"]):::iri
c1 -->v1--> v2
v3 --"wikibase:claim"--> v1
v3 --"wikibase:statementProperty"--> v4
v2 -->v4--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -->v5--> v6
v7 -."wikibase:qualifier".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end