query-65d49e6e6f690fff76873d11d2ac0451
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?item ?itemLabel
(GROUP_CONCAT(CONCAT(?propertyLabel, ": ", ?valueLabel, ?rankText, ?qualText); SEPARATOR=', ') AS ?statements)
{
{
SELECT
?item ?itemLabel ?propertyLabel ?valueLabel ?rank
(GROUP_CONCAT(CONCAT(?qualifierLabel, ": ", ?qualifier_valueLabel); SEPARATOR=', ') AS ?qualifiers)
{
?item wdt:P171+ wd:Q147149 .
?item wdt:P105 wd:Q7432 .
?item ?claim ?statement .
?property wikibase:claim ?claim .
?property wikibase:statementProperty ?ps_predicat .
?statement ?ps_predicat ?value .
?statement wikibase:rank ?rank .
OPTIONAL
{
?statement ?pq_predicat ?qualifier_value .
?qualifier wikibase:qualifier ?pq_predicat .
}
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?item rdfs:label ?itemLabel .
?property rdfs:label ?propertyLabel .
?value rdfs:label ?valueLabel .
?qualifier rdfs:label ?qualifierLabel .
?qualifier_value rdfs:label ?qualifier_valueLabel .
}
}
GROUP BY ?item ?itemLabel ?propertyLabel ?valueLabel ?rank
}
BIND (IF(?rank = wikibase:NormalRank, " [normal rank]",
IF(?rank = wikibase:PreferredRank, " [preferred rank]", " [deprecated rank]")) AS ?rankText)
BIND (IF(BOUND(?qualifiers), CONCAT("(", ?qualifiers, ")"), "") AS ?qualText)
}
GROUP BY ?item ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?claim")
v1("?item"):::projected
v11("?itemLabel"):::projected
v8("?pq_predicat")
v4("?property")
v12("?propertyLabel"):::projected
v5("?ps_predicat")
v18("?qualText"):::projected
v10("?qualifier")
v14("?qualifierLabel")
v9("?qualifier_value")
v15("?qualifier_valueLabel")
v16("?qualifiers")
v7("?rank")
v17("?rankText"):::projected
v3("?statement")
v19("?statements")
v6("?value")
v13("?valueLabel"):::projected
c2(["wd:Q147149"]):::iri
c4(["wd:Q7432"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wdt:P171"--> c2
v1 --"wdt:P105"--> c4
v1 -->v2--> v3
v4 --"wikibase:claim"--> v2
v4 --"wikibase:statementProperty"--> v5
v3 -->v5--> v6
v3 --"wikibase:rank"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -->v8--> v9
v10 -."wikibase:qualifier".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v1 --"rdfs:label"--> v11
v4 --"rdfs:label"--> v12
v6 --"rdfs:label"--> v13
v10 --"rdfs:label"--> v14
v9 --"rdfs:label"--> v15
end
bind1[/"concat(?qualifierLabel,': ',?qualifier_valueLabel)"/]
v14 --o bind1
v15 --o bind1
bind1 --as--o v16
bind2[/"if(?rank = 'wikibase:NormalRank',' #91;normal rank#93;',if(?rank = 'wikibase:PreferredRank',' #91;preferred rank#93;',' #91;deprecated rank#93;'))"/]
v7 --o bind2
bind2 --as--o v17
bind3[/"if(bound(?qualifiers),concat('(',?qualifiers,')'),'')"/]
v16 --o bind3
bind3 --as--o v18
bind5[/"concat(?propertyLabel,': ',?valueLabel,?rankText,?qualText)"/]
v12 --o bind5
v13 --o bind5
v17 --o bind5
v18 --o bind5
bind5 --as--o v19