query-1dccfdd4893325e1dc0c838b28d7b886

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?p1559 ?p27Label {
  ?item wdt:P1559 ?p1559 .
  FILTER(LANG(?p1559)='ja')
  OPTIONAL { ?item wdt:P27 ?p27 }
  FILTER(BOUND(?p27))  #remove this line if items without any P27 should be included
  FILTER NOT EXISTS {?item wdt:P27 wd:Q17 }
  # the following lines excludes some other "Japan like" values for P27, exclude or add more to fit your needs
  FILTER NOT EXISTS {?item wdt:P27 wd:Q188712 }
  FILTER NOT EXISTS {?item wdt:P27 wd:Q28025 }
  FILTER NOT EXISTS {?item wdt:P27 wd:Q205662 }

  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("?item"):::projected v3("?p1559"):::projected v2("?p27") c5(["wd:Q17"]):::iri c9(["bd:serviceParam"]):::iri c3(["wd:Q28025"]):::iri c2(["wd:Q205662"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q188712"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P27"--> e0c2 e0v1("?item"):::projected e0c2(["wd:Q205662"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> c2 v1 --"wdt:P27"--> c2 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"wdt:P27"--> e1c2 e1v1("?item"):::projected e1c2(["wd:Q28025"]):::iri end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c1 f1 --> c3 v1 --"wdt:P27"--> c3 f2[["not "]] subgraph f2e2["Exists Clause"] e2v1 --"wdt:P27"--> e2c2 e2v1("?item"):::projected e2c2(["wd:Q188712"]):::iri end f2--EXISTS--> f2e2 f2 --> v1 f2 --> c1 f2 --> c4 v1 --"wdt:P27"--> c4 f3[["not "]] subgraph f3e3["Exists Clause"] e3v1 --"wdt:P27"--> e3c2 e3v1("?item"):::projected e3c2(["wd:Q17"]):::iri end f3--EXISTS--> f3e3 f3 --> v1 f3 --> c1 f3 --> c5 v1 --"wdt:P27"--> c5 f4[["bound(?p27)"]] f4 --> v2 f5[["?p1559 = 'ja'"]] f5 --> v3 v1 --"wdt:P1559"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P27".-> v2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end