Tootfinder

Opt-in global Mastodon full text search. Join the index!

@awinkler@openbiblio.social
2025-09-22 07:09:52
Content warning:

It took me some time to make sense of the paragraph on how to remove statements using #quickstatements here: wikidata.org/wiki/Help:QuickSt

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, "$", ?strippedS…
@buercher@tooting.ch
2025-09-24 16:49:01

Note:
SELECT *
FROM t1 INNER JOIN t2
ON concat(t1.a,t1.b,t1.c) =
concat(t2.a,t2.b,t2.c)
is much faster than
FROM t1 INNER JOIN t2
ON t1.a = t2.a AND t1.b = t2.b AND t3.a = t3.b
The ad hoc calculated key creates a hash join reducing the complexity to O(n)