I am new to SPARQL and I have a question how I can filter the cases where the value of the object is different from a set of values collected from different objects? I want to use the query as part of the SPARQL-SHACL.
I have no problem to access the value I want to check, but then somehow the check is done for a single value and not if it is in the list/series of values
example:
- my variable ?value is 6
- I want to check if ?value which is 6 does not equal to any of the values of object ?obj ?obj have single values for different triples (different subjects), e.g. 1 for one case, 2 for another, 3 for other,...
If I do FILTER (?value!=?obj) I get all cases where 6!=1 and so on I want to be able to do ?value NOT IN (?obj) where the ?obj is a list 1, 2, 3,.... I assume in that case I will get just one result that 6 is not found in the list.
So maybe 2 questions
- is it possible to construct a list from ?obj as part of the query so that I could eventually use NOT IN?
- Is there other way to solve this problem?
Thanks in advance.
Thank you very much for the answer. I found a solution myself, but in case more efficient solutions are available I would be glad to know them.