Skip to content

How to filter out historical entities #472

Answered by chalypso
szeke asked this question in Q&A
Discussion options

You must be logged in to vote

This is a not-exists query which (for now) can be handled with an optional match pattern like so (the --where: is a global where which is evaluated outside the scope of any of the match clauses which is why we can check for NULL there):

> kgtk query --graph-cache wikidata-20210215-dwd-browser.2021-07-09T19:19.sqlite3.db \
          -i claims -i p279star -i qualifiers\
          --match 'claims: (x)-[r:P31]->(class), p279: (class)-[]->(:Q19832712)' \
          --opt   'qual: (r)-[:P582]->(endtime)' \
          --where: 'endtime is NULL' \
          --return 'x, class' \
          --limit 10
node1	node2
Q17832526	Q10007123
Q2547918	Q10007123
Q5157575	Q10007123
Q13111272	Q101085149
Q13113437…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by szeke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants