I am trying to test an existing relation (objectpropertie) for a given resource.
Let's take an exemple :
I would like to know if a subject ?a
has a predicate with one of values in a sparql variable ?b
.
So ?a
can contains an uuid (or what you want but it is my case) and ?b
contains a list of resources (:hot
, :cold
, :good
).
If my variable ?a
has at least one link with values of my variable ?b
, sparql doesn't have to return it.
The problem is sparql returns my variable ?a
3 times. If ?b
contains 10 resources, it will return ?a
10 times.
Is there any possibility to say in SPARQL "IN ONE OF THOSE" or making a sub query with ASK
statement.
SELECT * WHERE {
?donnee a capt:VALEUR .
?donnee tag:Est ?tag .
?modele tag:Modelisé_Avec ?tag .
?tag tag:A_Pour_Père/tag:Qualifié_Par ?qual .
?qualif tag:A_Pour_Père ?qual .
FILTER (?modele = tag:Modèle_qualification_température_intérieure) .
FILTER NOT EXISTS {?donnee tag:Qualifié_Par ?qualif .}
}
The problem is about ?qualif
variable.
Thanks.
EDIT : As asked, here you can see some details.
- My goal is getting values that are not "linked" with
?qual
which is a group of?qualif
=>:Chaud
,:Doux
,:Frais
,:Froid
resources. - In natural language (with my poor english ;) ) : get me all values that are not tagged with one of the
?qualif
contains in?qual
variable. If data have already been tagged, don't return it. - The problem is I have 2307 values in my triplestore, and the result is 9227. Why ? I think it's because my request doing that :
etc... with all valuesValue1 -----> :Chaud then Value1 -----> :Doux then Value1 -----> :Frais then Value1 -----> :Froid
As you can see here, there are 9227(-1) results but i have got 2307 values => 2307x4.
Is it clearer for you ? Thanks for your help.