Hi Holger,

thanks for your reply.

I think I found out where my mistake lies. When I use the above query/SPIN 
template and define the property "userEntity" of the template, then that 
property will immediately be filled in and only then the rule will be 
applied. This result that the MINUS clause contains something like "<Black 
Keys> <apm:sameEntityAs> <Black Keys>".

According to the definition of MINUS and this 
example<http://www.w3.org/TR/sparql11-query/#neg-example-2>, 
this will always return the construct triple.

If this assumption is correct, then I probably need something like this:

PREFIX policy: <http://www.adaptiveprivacy.com/ontologies/2012/2/policy.owl#
> >

CONSTRUCT {

    ?fillInVariable policy:authorisation policy:Authorisation1 .

}

WHERE {

    {

                ?userEntity owl:sameAs ?fillInVariable

        ?userEntity policy:friendOf <
> http://dbpedia.org/resource/Barack_Obama> . 

        MINUS {

            ?userEntity policy:sameEntityAs <
> http://dbpedia.org/resource/The_Black_Keys> .

        } .

    }

    UNION

    {


                ?userEntity owl:sameAs ?fillInVariable

        ?userEntity policy:friendOf <http://dbpedia.org/resource/Paramore> .

        MINUS {

            ?userEntity policy:sameEntityAs <
> http://dbpedia.org/resource/The_Black_Keys> .

        } .

    } .

}


And then fill in "fillInVariable" with <The_Black_Keys>.

Can you find yourself in that?

Thanks for your time,

Nicolas
 

On Thursday, May 24, 2012 10:32:52 AM UTC+2, Holger Knublauch wrote:
>
>  I don't think the SPIN API will work easily with a newer version of Jena. 
> But your problem seems to not even require SPIN to debug, so you could 
> start with a small Jena application that executes the query.
>
> Holger
>
>
> On 5/24/2012 17:15, NVandenBossche wrote: 
>
> Hi Peter, 
>
>  thanks for your reply.
>
>  I am using Jena 2.6.4. Should it work with that version?
>
>  I will try the latest version later today and I will post my findings 
> here.
>
>  Nicolas
>
> On Thursday, May 24, 2012 12:49:59 AM UTC+2, Peter Ansell wrote: 
>>
>> What version of Jena are you using with SPIN-API? MINUS comes from the 
>> SPARQL 1.1 Query draft so it may be handled differently across 
>> different recent versions of Jena. 
>>
>> Peter 
>>
>> On 23 May 2012 21:31, NVandenBossche <[email protected]> wrote: 
>> > Hello, 
>> > 
>> > I have made a SPIN rule template for the following SPARQL query (using 
>> > http://spinservices.org ): 
>> > 
>> >>> PREFIX policy: 
>> >>> <http://www.adaptiveprivacy.com/ontologies/2012/2/policy.owl#> 
>> >>> 
>> >>> CONSTRUCT { 
>> >>> 
>> >>>     ?userEntity policy:authorisation policy:Authorisation1 . 
>> >>> 
>> >>> } 
>> >>> 
>> >>> WHERE { 
>> >>> 
>> >>>     { 
>> >>> 
>> >>>         ?userEntity policy:friendOf 
>> >>> <http://dbpedia.org/resource/Barack_Obama> . 
>> >>> 
>> >>>         MINUS { 
>> >>> 
>> >>>             ?userEntity policy:sameEntityAs 
>> >>> <http://dbpedia.org/resource/The_Black_Keys> . 
>> >>> 
>> >>>         } . 
>> >>> 
>> >>>     } 
>> >>> 
>> >>>     UNION 
>> >>> 
>> >>>     { 
>> >>> 
>> >>>         ?userEntity policy:friendOf 
>> >>> <http://dbpedia.org/resource/Paramore> . 
>> >>> 
>> >>>         MINUS { 
>> >>> 
>> >>>             ?userEntity policy:sameEntityAs 
>> >>> <http://dbpedia.org/resource/The_Black_Keys> . 
>> >>> 
>> >>>         } . 
>> >>> 
>> >>>     } . 
>> >>> 
>> >>> } 
>> > 
>> > 
>> >  I have a Jena Model that contains both the triples 
>> > "<http://dbpedia.org/resource/The_Black_Keys> 
>> > policy:sameEntityAs <http://dbpedia.org/resource/The_Black_Keys>" and 
>> > "<http://dbpedia.org/resource/The_Black_Keys> 
>> > policy:friendOf <http://dbpedia.org/resource/Barack_Obama>", but when 
>> I 
>> > apply this rule with "<http://dbpedia.org/resource/The_Black_Keys>" as 
>> the 
>> > ?userEntity value, the triple in the construct part of the query get 
>> > constructured. 
>> > 
>> > I was actually expecting that the MINUS clause would eliminate the 
>> > construction... 
>> > 
>> > Can anyone tell me what the problem is here? I'm not sure, but I'm 
>> expecting 
>> > it has something to do with the UNION clause, even though that doesn't 
>> make 
>> > much sense. 
>> > 
>> > Thanks in advance, 
>> > 
>> > Nicolas 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> > Group "TopBraid Suite Users", the topics of which include Enterprise 
>> > Vocabulary Network (EVN), TopBraid Composer, 
>> > TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN. 
>> > To post to this group, send email to 
>> > [email protected] 
>> > To unsubscribe from this group, send email to 
>> > [email protected] 
>> > For more options, visit this group at 
>> > http://groups.google.com/group/topbraid-users?hl=en 
>>
>  -- 
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include Enterprise 
> Vocabulary Network (EVN), TopBraid Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en
>
>  

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary 
Network (EVN), TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to