query-48698213865b40bed9d99b5659859c9e

rq turtle/ttl

🔎 Query about the topic in context

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#>
PREFIX target: <http://www.wikidata.org/entity/Q159172>

#defaultView:Graph
SELECT ?node ?nodeLabel ?nodeImage ?childNode ?childNodeLabel ?childNodeImage ?rgb 
WHERE {
  {
     {
  SELECT DISTINCT ?node ?childNode WHERE {
      BIND(target: AS ?node)
      ?node ?p ?i.
      ?childNode ?x ?p.
      ?childNode rdf:type wikibase:Property.
      FILTER(STRSTARTS(STR(?i), "http://www.wikidata.org/entity/Q"))
      FILTER(STRSTARTS(STR(?childNode), "http://www.wikidata.org/entity/P"))
    }
  LIMIT 5000
}  }
  UNION
  {
     {
  SELECT DISTINCT ?childNode ?node ?rgb WHERE {
      BIND("EFFBD8" AS ?rgb)
      target: ?p ?childNode.
      ?node ?x ?p.
      ?node rdf:type wikibase:Property.
      FILTER(STRSTARTS(STR(?childNode), "http://www.wikidata.org/entity/Q"))
    }
  LIMIT 5000
}  }

  OPTIONAL { 
     {
  SELECT DISTINCT ?property WHERE {
      ?property a wikibase:Property;
                wdt:P31 wd:Q18610173 ;
                wdt:P31 wd:Q26940804 . 
    }
}    ?property wikibase:directClaim ?nodeclaim.
    ?node ?nodeclaim ?nodeImage. 
  }

  OPTIONAL { 
     {
  SELECT DISTINCT ?property WHERE {
      ?property a wikibase:Property;
                wdt:P31 wd:Q18610173 ;
                wdt:P31 wd:Q26940804 . 
    }
}    ?property wikibase:directClaim ?childNodeclaim.
    ?childNode ?childNodeclaim ?childNodeImage. 
  }

  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; v1("?childNode"):::projected v11("?childNodeImage"):::projected v10("?childNodeclaim") v2("?i") v3("?node"):::projected v9("?nodeImage"):::projected v8("?nodeclaim") v4("?p") v7("?property") v6("?rgb"):::projected v5("?x") c4(["wikibase:Property"]):::iri c7(["wd:Q18610173"]):::iri c11(["bd:serviceParam"]):::iri c8(["wd:Q26940804"]):::iri c5(["wd:Q159172"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; f0[["starts-with(str(?childNode),'http://www.wikidata.org/entity/Q')"]] f0 --> v1 bind1[/"'EFFBD8'"/] bind1 --as--o v6 c5 -->v4--> v1 v3 -->v5--> v4 v3 --"a"--> c4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; f2[["starts-with(str(?childNode),'http://www.wikidata.org/entity/P')"]] f2 --> v1 f3[["starts-with(str(?i),'http://www.wikidata.org/entity/Q')"]] f3 --> v2 bind4[/"'wd:Q159172'"/] bind4 --as--o v3 v3 -->v4--> v2 v1 -->v5--> v4 v1 --"a"--> c4 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."a".-> c4 v7 --"wdt:P31"--> c7 v7 --"wdt:P31"--> c8 v7 --"wikibase:directClaim"--> v8 v3 -->v8--> v9 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v7 -."a".-> c4 v7 --"wdt:P31"--> c7 v7 --"wdt:P31"--> c8 v7 --"wikibase:directClaim"--> v10 v1 -->v10--> v11 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end