query-45830a47200698d88d2d38f92ad01653

rq turtle/ttl

TODO

Use at

PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?id ?name ?first ?second
WHERE {
  ?item p:P396 ?st .
  ?st ps:P396 ?id .
  ?st pq:P1810 ?name .
  FILTER REGEX(?name, "<([\\S\\s]+\\d+[\\S\\s]*)-([\\S\\s]*)")
  BIND (REPLACE (?name, "^.*<([\\S\\s]+\\d+[\\S\\s]*)-([\\S\\s]*).*$", "$1") AS ?first)
  BIND (REPLACE (?name, "^.*<([\\S\\s]+\\d+[\\S\\s]*)-([\\S\\s]*).*$", "$2") AS ?second)
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?first"):::projected v4("?id"):::projected v2("?item"):::projected v1("?name"):::projected v6("?second"):::projected v3("?st") f0[["regex(?name,'<(#91;\S\s#93;+\d+#91;\S\s#93;*)-(#91;\S\s#93;*)')"]] f0 --> v1 v2 --"p:P396"--> v3 v3 --"p:statement/P396"--> v4 v3 --"p:qualifier/P1810"--> v1 bind1[/"replace(?name,'^.*<(#91;\S\s#93;+\d+#91;\S\s#93;*)-(#91;\S\s#93;*).*$','$1')"/] v1 --o bind1 bind1 --as--o v5 bind2[/"replace(?name,'^.*<(#91;\S\s#93;+\d+#91;\S\s#93;*)-(#91;\S\s#93;*).*$','$2')"/] v1 --o bind2 bind2 --as--o v6