query-3c9ef4effbdc58fda85589ff8912200f

rq turtle/ttl

SPARQL query shows deleted item The following query: Sometimes I need to rethink my logic for SPARQL to give the right result that don't start with UC and aren't 24 characters long (a correct YouTube channel id starts with UC and is 24 characters long). I wrote a query and it seemed to work: (P2397)YouTube channel ID For a tool I created I needed to return all the items (+current value and GUID for statement) with the value for

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?YouTube ?YouTubeEntity WHERE {
    ?item wdt:P2397 ?YouTube .
    ?item p:P2397 ?YouTubeEntity .
    filter(SUBSTR(str(?YouTube),1,2)!="UC")
           }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?YouTube"):::projected v3("?YouTubeEntity"):::projected v2("?item"):::projected f0[["substring(str(?YouTube),'1^^xsd:integer','2^^xsd:integer') != 'UC'"]] f0 --> v1 v2 --"p:direct/P2397"--> v1 v2 --"p:P2397"--> v3