Smalyshev added a comment.

So we actually moved to a different model of updating, now the query we use to 
filter out the unused entries is:

  DELETE { ?s ?p ?o } WHERE {
    VALUES ?s { %values% }
    # Since values are shared we can only clear the values on them when they 
are no longer used
    # anywhere else.
    FILTER NOT EXISTS { ?someEntity ?someStatementPred ?s .  }
    ?s ?p ?o .
  }

(with %values% being replaced by the list of actual IRIs) and it seems to 
perform OK so far. 
We still use this construct though:

  DELETE {
    ?s ?p ?o .
  }
  WHERE {
   <http://www.wikidata.org/entity/Q30> ?statementPred ?s .
    FILTER( STRSTARTS(STR(?s), ""http://www.wikidata.org/entity/statement/";) ) .
    ?s ?p ?o .
    FILTER NOT EXISTS {
      VALUES ( ?s ?p ?o ) {
        %valueStatements%
      }
    }
  }

Where %valueStatements% is a set of new triples to be introduced later with 
INSERT, so if old & new data have same triples they won't be deleted and then 
inserted back.

We'll keep an eye on it and see if we have any more trouble.


TASK DETAIL
  https://phabricator.wikimedia.org/T96094

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Smalyshev
Cc: M.schmidt00, Thompsonbry, Thompsonbry.systap, Beebs.systap, Haasepeter, 
Manybubbles, Aklapper, Smalyshev, jkroll, Wikidata-bugs, Jdouglas, aude, 
GWicke, daniel, JanZerebecki



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to