Lucas_Werkmeister_WMDE added a comment.

  Hm, maybe it’s possible in SPARQL after all. I think adding this snippet for 
each separator property ID ought to be equivalent to the `MainSnakContext` 
methods (in particular `haveSameQualifiers`):
  
    MINUS {
      ?statement pq:$separator ?qualifier.
      MINUS {
        ?otherStatement pq:$separator ?qualifier.
      }
    }
    MINUS {
      ?otherStatement pq:$separator ?qualifier.
      MINUS {
        ?statement pq:$separator ?qualifier.
      }
    }
    MINUS {
      ?statement a wdno:$separator.
      MINUS {
        ?otherStatement a wdno:$separator.
      }
    }
    MINUS {
      ?otherStatement a wdno:$separator.
      MINUS {
        ?statement a wdno:$separator.
      }
    }
  
  That is, if the current statement has a non-“no value” qualifier and the 
other statement doesn’t have the same qualifier, or vice versa, or the current 
statement has a “no value” qualifier and the other statement doesn’t, or vice 
versa, then the statements are considered different, are not returned from the 
query, and don’t generate a violation. (“Unknown value” is always considered to 
be different from other “unknown value”, both in the query service and in the 
constraints extension, so an “unknown value” qualifier automatically means the 
statement is separated from all other statements, which is what we want.)
  
  I haven’t tested this query yet; in particular, we’d need to make sure if 
nested `MINUS` works this way. Or maybe use `FILTER NOT EXISTS` instead.
  
  I guess the second half, for “no value”, could also be:
  
    FILTER(EXISTS { ?statement a wdno:$separator. }
        == EXISTS { ?otherStatement a wdno:$separator. })

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

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

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Manuel, Esc3300, Moebeus, Nikki, Aklapper, 
Invadibot, maantietaja, Akuckartz, Iflorez, alaa_wmde, Nandana, Lahi, Gq86, 
GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, Agabi10, 
Scott_WUaS, abian, Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- wikidata-bugs@lists.wikimedia.org
To unsubscribe send an email to wikidata-bugs-le...@lists.wikimedia.org

Reply via email to