query-80831d89c8db197fdb32d241d948c5e8

rq turtle/ttl

Kana with spaces from jpsearch

Use at

PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX type: <https://jpsearch.go.jp/term/type/>

SELECT ?p ?kana ?wdkana
{
  SERVICE <https://jpsearch.go.jp/rdf/sparql/> {
    {
      SELECT ?wd ?kana {
        ?wd rdfs:isDefinedBy <http://www.wikidata.org/> .
        ?wd owl:sameAs ?item .

        ?item rdf:type type:Person .
        ?item schema:name ?kana .
        FILTER(LANG(?kana) = "ja-kana")
      } LIMIT 10000 OFFSET 0 
    }
  }

  OPTIONAL { ?wd p:P1814 ?p . ?p ps:P1814 ?wdkana . }
  FILTER( ?wdkana != STR(?kana) )
  FILTER( ?wdkana = REPLACE(STR(?kana), "[\\s・]", "") )
  FILTER( !REGEX(?wdkana, "[\\s・]") )
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?item") v2("?kana"):::projected v5("?p"):::projected v3("?wd") v1("?wdkana"):::projected c6([http://www.wikidata.org/]):::iri c9([https://jpsearch.go.jp/term/type/Person]):::iri f0[["not regex(?wdkana,'#91;\s・#93;')"]] f0 --> v1 f1[["?wdkana = replace(str(?kana),'#91;\s・#93;','')"]] f1 --> v1 f1 --> v2 f2[["?wdkana != str(?kana)"]] f2 --> v1 f2 --> v2 subgraph s1["https://jpsearch.go.jp/rdf/sparql/"] style s1 stroke-width:4px; f3[["?kana = 'ja-kana'"]] f3 --> v2 v3 --"rdfs:isDefinedBy"--> c6 v3 --"owl:sameAs"--> v4 v4 --"a"--> c9 v4 --"schema:name"--> v2 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P1814".-> v5 v5 --"p:statement/P1814"--> v1 end