query-fff63f93abdf44a89d0cc491568bc42f

rq turtle/ttl

?i1?i2

Use at

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#>
SELECT ?i1 ?s1 ?i2 ?s2
WHERE {
  VALUES ?v { wd:Q172579 wd:Q38 } .
  ?i1 wdt:P27 ?v ; wdt:P214 [] ; rdfs:label ?l1 . FILTER(LANG(?l1) = "it")
  ?i2 wdt:P27 ?v ; wdt:P214 [] ; rdfs:label ?l1 .
  # FILTER(STR(?i1) < STR(?i2)) # Uncomment for different ?i1 and ?i2 values - and for timeout
  OPTIONAL { ?i1 wdt:P396 ?s1 } .
  OPTIONAL { ?i2 wdt:P396 ?s2 } .
}
LIMIT 10

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?i1"):::projected v4("?i2"):::projected v1("?l1") v5("?s1"):::projected v6("?s2"):::projected v2("?v") a1((" ")) a2((" ")) f0[["?l1 = 'it'"]] f0 --> v1 bind1[/VALUES ?v/] bind1-->v2 bind10(["wd:Q172579"]) bind10 --> bind1 bind11(["wd:Q38"]) bind11 --> bind1 v3 --"wdt:P27"--> v2 v3 --"wdt:P214"--> a1 v3 --"rdfs:label"--> v1 v4 --"wdt:P27"--> v2 v4 --"wdt:P214"--> a2 v4 --"rdfs:label"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P396".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P396".-> v6 end