query-5022014cac46fce13ecc194ecdff778a
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?wdProp ?wdPropLabel ?relationshipStProp ?relationshipPropLabel ?gettyProp
# (URI(CONCAT("http://www.wikidata.org/entity/Q", STR(ROUND(RAND()*1000000)))) AS ?item)
# I didn't get the random item generator to work, that would enable the use of "Template:Wikidata list"
WHERE {
VALUES ?relationshipStProp { ps:P1628 ps:P2235 ps:2236 }
{ ?wdProp ?a [ ?relationshipStProp ?gettyProp ] .
FILTER(STRSTARTS(STR(?gettyProp), "http://vocab.getty.edu/ontology#"))
} UNION {
?wdProp ?b [ ?relationshipStProp ?gettyProp ;
pq:P1535 wd:Q5554720 ] .
}
?relationshipProp wikibase:statementProperty ?relationshipStProp .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?gettyProp
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?a")
v5("?b")
v1("?gettyProp"):::projected
v6("?relationshipProp")
v2("?relationshipStProp"):::projected
v3("?wdProp"):::projected
a1((" "))
a2((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q5554720"]):::iri
bind0[/VALUES ?relationshipStProp/]
bind0-->v2
bind00(["ps:P1628"])
bind00 --> bind0
bind01(["ps:P2235"])
bind01 --> bind0
bind02(["ps:2236"])
bind02 --> bind0
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a2 -->v2--> v1
a2 --"pq:P1535"--> c3
v3 -->v5--> a2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
f1[["starts-with(str(?gettyProp),'http://vocab.getty.edu/ontology#')"]]
f1 --> v1
a1 -->v2--> v1
v3 -->v4--> a1
end
union0r <== or ==> union0l
end
v6 --"wikibase:statementProperty"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end