query-36293a84b5cf89dddf7eb827974eb63b

rq turtle/ttl

Attempt at query-driven graph with unspecified properties

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Graph
SELECT ?item1 ?image ?item1Label ?item2 ?edgeLabel WHERE {
VALUES ?target {wd:Q47152}
{?target ?prop1 ?item1} UNION {?item1 ?prop1 ?target} UNION {VALUES ?item1 {wd:Q47152} }. ?item1 wdt:P31 wd:Q5.
{?target ?prop2 ?item2} UNION {?item2 ?prop2 ?target}. ?item2 wdt:P31 wd:Q5.
?item1 ?prop ?item2.
?edge ?dummy ?prop ; rdf:type wikibase:Property
OPTIONAL {?item1 wdt:P18 ?image}
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; v8("?dummy") v7("?edge") v9("?image"):::projected v4("?item1"):::projected v5("?item2"):::projected v6("?prop") v2("?prop1") v4("?prop2") v1("?target") c7(["bd:serviceParam"]):::iri c4(["wikibase:Property"]):::iri c2(["wd:Q5"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?target/] bind0-->v1 bind00(["wd:Q47152"]) bind00 --> bind0 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; bind1[/VALUES ?item1/] bind1-->v4 bind10(["wd:Q47152"]) bind10 --> bind1 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v4 -->v2--> v1 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 -->v2--> v4 end union0r <== or ==> union0l end v4 --"wdt:P31"--> c2 subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v5 -->v4--> v1 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v1 -->v4--> v5 end union2r <== or ==> union2l end v5 --"wdt:P31"--> c2 v4 -->v6--> v5 v7 -->v8--> v6 v7 --"a"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P18".-> v9 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end