Hi
Your query selects all triples without "source", at first. If the two
elements without an "author" have a "source", they will be discarded,
because the values added by "optional" clause have to respect "where
clauses" anyway.
You can check it.
You can try to use UNION construct, because you want to retrieve a list
with
-item without a source
-item without author
SELECT ?r
WHERE {?r a ro:FR.
FILTER NOT EXISTS {?r ro:hasSource ?a}
UNION{ ?r a ro:FR.
FILTER NOT EXISTS {?r ro:isAuthoredBy ?a}
}
}
I hope it is useful.
Regards
Francesco.
2012/9/10 Katja Siegemund <[email protected]>
> Hi,
>
> I'm having trouble with constructing a query that uses "or". I already
> tried optional, but it does not lead to the expected result. I'd be glad if
> someone could help me. I'd like to query for:
>
> all var bindings that have no author or no source.
>
> I tried:
>
> SELECT ?r WHERE {?r a ro:FR. FILTER NOT EXISTS {?r ro:hasSource ?a}
> OPTIONAL {FILTER NOT EXISTS {?r ro:isAuthoredBy ?a}}}";
>
> But it only computes the first part (source).
>
> If I have 3 items without a source and 2 others with no author, then I
> should get 5 results instead only the first 3. What am I doing wrong?
>
> Thanks in advance,
> Katja
>
>
--
ufficio: 0542 32640
mail: [email protected]
cell: 349 3508348
skype: [email protected]