query-8d09de3a16b1252353e394cc232ab8f7

rq turtle/ttl

Missing jpsearch statements

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX type: <https://jpsearch.go.jp/term/type/>

SELECT ?qid ?jpid
{
  {
    SERVICE <https://jpsearch.go.jp/rdf/sparql/> {
      {
        SELECT (SUBSTR(STR(?item), 38) AS ?jpid) ?qid {
          ?item rdfs:isDefinedBy <https://jpsearch.go.jp/entity/chname/> .
          ?item owl:sameAs ?qid .
          ?qid rdfs:isDefinedBy <http://www.wikidata.org/> .
        } LIMIT 10000 OFFSET 0
      }
    }
  } UNION {
    SERVICE <https://jpsearch.go.jp/rdf/sparql/> {
      {
        SELECT (SUBSTR(STR(?item), 38) AS ?jpid) ?qid {
          ?item rdfs:isDefinedBy <https://jpsearch.go.jp/entity/chname/> .
          ?item owl:sameAs ?qid .
          ?qid rdfs:isDefinedBy <http://www.wikidata.org/> .
        } LIMIT 10000 OFFSET 10000
      }
    }
  } UNION {
    SERVICE <https://jpsearch.go.jp/rdf/sparql/> {
      {
        SELECT (SUBSTR(STR(?item), 38) AS ?jpid) ?qid {
          ?item rdfs:isDefinedBy <https://jpsearch.go.jp/entity/chname/> .
          ?item owl:sameAs ?qid .
          ?qid rdfs:isDefinedBy <http://www.wikidata.org/> .
        } LIMIT 10000 OFFSET 20000
      }
    }
  }

  FILTER NOT EXISTS { ?qid wdt:P6698 ?jpid }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item") v4("?jpid"):::projected v1("?qid"):::projected c4([https://jpsearch.go.jp/entity/chname/]):::iri c6([http://www.wikidata.org/]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P6698"--> e0v2 e0v2("?jpid"):::projected e0v1("?qid"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v4 v1 --"wdt:P6698"--> v4 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; subgraph s1["https://jpsearch.go.jp/rdf/sparql/"] style s1 stroke-width:4px; v3 --"rdfs:isDefinedBy"--> c4 v3 --"owl:sameAs"--> v1 v1 --"rdfs:isDefinedBy"--> c6 bind1[/"substring(str(?item),'38^^xsd:integer')"/] v3 --o bind1 bind1 --as--o v4 end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; subgraph s1["https://jpsearch.go.jp/rdf/sparql/"] style s1 stroke-width:4px; v3 --"rdfs:isDefinedBy"--> c4 v3 --"owl:sameAs"--> v1 v1 --"rdfs:isDefinedBy"--> c6 bind2[/"substring(str(?item),'38^^xsd:integer')"/] v3 --o bind2 bind2 --as--o v4 end end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; subgraph s1["https://jpsearch.go.jp/rdf/sparql/"] style s1 stroke-width:4px; v3 --"rdfs:isDefinedBy"--> c4 v3 --"owl:sameAs"--> v1 v1 --"rdfs:isDefinedBy"--> c6 bind3[/"substring(str(?item),'38^^xsd:integer')"/] v3 --o bind3 bind3 --as--o v4 end end union0r <== or ==> union0l end