SPARQL Code Snippet from Wikidata Query Service
SELECT ?prefix ?qsStatementID
WHERE {
?item p:PXXX ?s .
# add more constraints here to get statements you want to remove
BIND ( ("-STATEMENT") AS ?prefix )
BIND ( REPLACE(STR(?s), "http://www.wikidata.org/entity/statement/", "") AS ?statementID )
BIND ( REPLACE(STR(?item), "http://www.wikidata.org/entity/", "") AS ?qid)
BIND ( REPLACE(?statementID, CONCAT(?qid, "-"), "") AS ?strippedStatementID )
BIND ( CONCAT(?qid, "$", ?strippedStatementID ) AS ?qsStatementID )
}
It took me some time to make sense of the paragraph on how to remove statements using #quickstatements here: www.wikidata.org/wiki/Help:QuickStatement...
Turns out it's actually not too difficult to generate qs-compatible output […]
[Original post on openbiblio.social]