query-c2655af561ce0870fbc309f5a918a67d

rq turtle/ttl

English description cleanup (items for people)

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT *
{
    ?item wdt:P214 []; wdt:P31 wd:Q5 . 
    ?item schema:description ?d . FILTER( lang(?d) = "en" ) 
    ?item rdfs:label ?l . FILTER( lang(?l) = "en" ) 
    BIND(strbefore(?l, " ") as ?first) 
    BIND(strafter(?l, " ") as ?last)
    FILTER( ?first != "" && CONTAINS( ?d, ?first) && CONTAINS(?d, ?last)  )
}
LIMIT 20

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?d"):::projected v6("?first"):::projected v5("?item"):::projected v4("?l"):::projected v6("?last"):::projected a1((" ")) c5(["wd:Q5"]):::iri f0[["?first != ''contains(?d,?first)contains(?d,?last)"]] f0 --> v6 f0 --> v2 f0 --> v6 f1[["?l = 'en'"]] f1 --> v4 f2[["?d = 'en'"]] f2 --> v2 v5 --"wdt:P214"--> a1 v5 --"wdt:P31"--> c5 v5 --"schema:description"--> v2 v5 --"rdfs:label"--> v4 bind3[/"substring-before(?l,' ')"/] v4 --o bind3 bind3 --as--o v6 bind4[/"substring-after(?l,' ')"/] v4 --o bind4 bind4 --as--o v6