query-539d1f0f2d552a9e9c99f48c96af31d5
Synia: venue-topic
Use at
- https://query.wikidata.org/sparql
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX target1: <http://www.wikidata.org/entity/Q4744266>
PREFIX target2: <http://www.wikidata.org/entity/Q1492760>
SELECT DISTINCT ?description ?value ?valueUrl
WHERE {
{
BIND(1 AS ?order)
BIND("Venue" AS ?description)
BIND(target1: AS ?iri)
BIND(SUBSTR(STR(?iri), 32) AS ?q)
?iri rdfs:label ?value_string .
FILTER (LANG(?value_string) = 'en')
BIND(COALESCE(?value_string, ?q) AS ?value)
BIND(CONCAT("#venue/", ?q) AS ?valueUrl)
}
UNION
{
BIND(2 AS ?order)
BIND("Topic" AS ?description)
BIND(target2: AS ?iri)
BIND(SUBSTR(STR(?iri), 32) AS ?q)
?iri rdfs:label ?value_string .
FILTER (LANG(?value_string) = 'en')
BIND(COALESCE(?value_string, ?q) AS ?value)
BIND(CONCAT("#topic/", ?q) AS ?valueUrl)
}
}
ORDER BY ?order
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?description"):::projected
v8("?iri")
v8("?order")
v8("?q")
v8("?value"):::projected
v8("?valueUrl"):::projected
v2("?value_string")
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
f0[["?value_string = 'en'"]]
f0 --> v2
bind1[/"'2^^xsd:integer'"/]
bind1 --as--o v8
bind2[/"'Topic'"/]
bind2 --as--o v8
bind3[/"http://www.wikidata.org/entity/Q1492760"/]
bind3 --as--o v8
bind4[/"substring(str(?iri),'32^^xsd:integer')"/]
v8 --o bind4
bind4 --as--o v8
v8 --"rdfs:label"--> v2
bind5[/"?value_string?q"/]
v2 --o bind5
v8 --o bind5
bind5 --as--o v8
bind6[/"concat('#topic/',?q)"/]
v8 --o bind6
bind6 --as--o v8
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
f7[["?value_string = 'en'"]]
f7 --> v2
bind8[/"'1^^xsd:integer'"/]
bind8 --as--o v8
bind9[/"'Venue'"/]
bind9 --as--o v8
bind10[/"http://www.wikidata.org/entity/Q4744266"/]
bind10 --as--o v8
bind11[/"substring(str(?iri),'32^^xsd:integer')"/]
v8 --o bind11
bind11 --as--o v8
v8 --"rdfs:label"--> v2
bind12[/"?value_string?q"/]
v2 --o bind12
v8 --o bind12
bind12 --as--o v8
bind13[/"concat('#venue/',?q)"/]
v8 --o bind13
bind13 --as--o v8
end
union0r <== or ==> union0l
end