query-3ba6a93362d04a374c2bcbebd9f7e13c

rq turtle/ttl

Query problemHey. I created a query but for some reason every item shows up 30 times, any way to fix it?

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item WHERE { 
  {?item wdt:P17 wd:Q142 }
  UNION  {?item wdt:P27 wd:Q142 }
  ?sitelink schema:about ?item . 
FILTER NOT EXISTS { ?wfr schema:about ?item . ?wfr schema:inLanguage "he" } .
OPTIONAL {?item rdfs:label ?label1 filter(lang(?label1) = "he")}.
FILTER BOUND (?label1).
}LIMIT 6000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v1("?label1") v4("?sitelink") v2("?wfr") c3(["he"]):::literal c5(["wd:Q142"]):::iri f0[["bound(?label1)"]] f0 --> v1 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"schema:about"--> e0v2 e0v1 --"schema:inLanguage"--> e0c3 e0v2("?item"):::projected e0v1("?wfr"):::projected e0c3(["he"]):::literal end f1--EXISTS--> f1e0 f1 --> v2 f1 --> c1 f1 --> v3 f1 --> c2 f1 --> c3 v2 --"schema:about"--> v3 v2 --"schema:inLanguage"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P27"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P17"--> c5 end union0r <== or ==> union0l end v4 --"schema:about"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."rdfs:label".-> v1 end