Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Data
- @prefix : <http://example.com/> .
- :a :p 1 ; :q 1,2 .
- :b :p 3.0 ; :q 4.0, 5.0 .
- ### Query 1: NOT EXISTS
- PREFIX : <http://example.com/>
- SELECT * WHERE {
- ?a :p ?n
- FILTER NOT EXISTS {
- ?a :q ?m .
- FILTER(?n = ?m)
- }
- }
- +------------------------+-----+
- | a | n |
- +------------------------+-----+
- | <http://example.com/b> | 3.0 |
- +------------------------+-----+
- ### Query 2: MINUS
- PREFIX : <http://example.com/>
- SELECT * WHERE {
- ?a :p ?n
- MINUS {
- ?a :q ?m .
- FILTER(?n = ?m)
- }
- }
- +------------------------+-----+
- | a | n |
- +------------------------+-----+
- | <http://example.com/a> | 1 |
- | <http://example.com/b> | 3.0 |
- +------------------------+-----+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement