Hi Ivan,

Thank you! I should guess by analogy with SQL...

Does IN operator work with subqueries? I have the following query:

SELECT DISTINCT ?s ?p ?o
FROM <http://www.semanticweb.org/ontologies/2010/1/EventsContent.owl#>
WHERE
{
  ?s ?p ?o
  FILTER
  (
    ?s in
    (
      (
        SELECT DISTINCT ?event
        FROM <
http://www.semanticweb.org/ontologies/2010/1/EventsContent.owl#>
        WHERE
        {
          ?event ?property ?value .
          ?value bif:contains "virtuoso" OPTION (SCORE ?valueScore) .
        }
        GROUP BY ?event
        ORDER BY DESC (sum(?valueScore))
      )
    )
  )
}

but it returns only first event.

Regards,
Alexander

2010/3/23 Ivan Mikhailov <[email protected]>

> Hello Alexander,
>
> > Let's imagine we have a list of entities uris' as input and we need to
> retrieve all triples for each entity.
> > Is there any way to execute it using one query?
>
> We have an IN operator extension:
>
> select ?p ?o
> where
> {
>  ?s ?p ?o .
>  filter (?s in (<someGraph#entity1>, <someGraph#entity2>, ...
>    <someGraph#entityN> ) )
> }
>
> Best Regards,
>
> Ivan Mikhailov
> OpenLink Software
> http://virtuoso.openlinksw.com
>
>
>

Reply via email to