query-f69e707a68fc8d0d6e013f9b10bb9e66

rq turtle/ttl

Propertiestitle (P1476)instance of (P31)main subject (P921)

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT * WHERE {
  ?work wdt:P1476 ?title.
  ?work wdt:P31 wd:Q13442814.
  BIND(STRAFTER(?title, " ") AS ?poststring)
  BIND(STRBEFORE(?poststring, " ") AS ?prepoststring)
  BIND(STRLEN(REPLACE(?prepoststring, " ", "")) AS ?length)
  FILTER(NOT EXISTS { ?work wdt:P921 ?topic. })
  FILTER(?length > 5)
}
#ORDER BY DESC(?length)
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?length"):::projected v5("?poststring"):::projected v6("?prepoststring"):::projected v4("?title"):::projected v3("?topic") v2("?work"):::projected c5(["wd:Q13442814"]):::iri f0[["?length > '5^^xsd:integer'"]] f0 --> v7 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"wdt:P921"--> e0v2 e0v2("?topic"):::projected e0v1("?work"):::projected end f1--EXISTS--> f1e0 f1 --> v2 f1 --> c2 f1 --> v3 v2 --"wdt:P921"--> v3 v2 --"wdt:P1476"--> v4 v2 --"wdt:P31"--> c5 bind2[/"substring-after(?title,' ')"/] v4 --o bind2 bind2 --as--o v5 bind3[/"substring-before(?poststring,' ')"/] v5 --o bind3 bind3 --as--o v6 bind4[/"string-length(replace(?prepoststring,' ',''))"/] v6 --o bind4 bind4 --as--o v7