query-99ac30e48b26a06452e8204d68f594ae
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT
?property
?propertyLabel
?qval
(GROUP_CONCAT(DISTINCT ?val_Label; separator="; ") AS ?val_Label) WHERE {
?property a wikibase:Property; wikibase:claim ?p; wikibase:statementProperty ?ps. #; #wikibase:qualifier ?pq.
?property rdfs:label ?propertyLabel . FILTER (LANG(?propertyLabel) = 'en' )
?company ?p ?statement . ?statement wikibase:rank ?rank .
FILTER (?rank IN (wikibase:NormalRank, wikibase:PreferredRank))
?statement ?ps ?value . # URI, literal or blank node
OPTIONAL {?value rdfs:label ?valueLabel . FILTER (LANG(?valueLabel) = 'en')}
BIND (COALESCE(?valueLabel, ?value) AS ?val_Label)
OPTIONAL { ?statement ?pq ?qval .
?pq ^wikibase:qualifier [ a wikibase:Property ] .
}
#?pq ^wikibase:qualifier [ a wikibase:Property ] .
} GROUP BY ?property ?propertyLabel ?qval
VALUES (?company) {(wd:Q95)}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?company")
v6("?p")
v11("?pq")
v5("?property"):::projected
v3("?propertyLabel"):::projected
v7("?ps")
v12("?qval"):::projected
v2("?rank")
v8("?statement")
v13("?val_Label"):::projected
v9("?value")
v4("?valueLabel")
a1((" "))
c5(["wikibase:Property"]):::iri
bind0[/VALUES ?company/]
bind0-->v1
bind00(["wd:Q95"])
bind00 --> bind0
list0c2(["wikibase:PreferredRank"]):::iri
list0c1(["wikibase:NormalRank"]):::iri
list0c1 --o f1
list0c2 --o f1
f1[[" in "]]
f1 --> v2
f2[["?propertyLabel = 'en'"]]
f2 --> v3
v5 --"a"--> c5
v5 --"wikibase:claim"--> v6
v5 --"wikibase:statementProperty"--> v7
v5 --"rdfs:label"--> v3
v1 -->v6--> v8
v8 --"wikibase:rank"--> v2
v8 -->v7--> v9
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v9 -."rdfs:label".-> v4
end
bind3[/"?valueLabel?value"/]
v4 --o bind3
v9 --o bind3
bind3 --as--o v13
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v8 -->v11--> v12
a1 -."a".-> c5
a1 --"wikibase:qualifier"--> v11
end
bind5[/"?val_Label"/]
v13 --o bind5
bind5 --as--o v13