W3C home > Mailing lists > Public > semantic-web@w3.org > July 2014

Re: to navigate the whole network to the end of all branches and nodes by SPARQL

From: Lei Xu <lei.xu@marklogic.com>
Date: Fri, 11 Jul 2014 14:54:09 +0000
To: James Leigh <james@3roundstones.com>
CC: Semantic Web <semantic-web@w3.org>
Message-ID: <DC5E6E9C-F75F-4774-A8F5-222D6FD3521C@marklogic.com>
James,

Thanks a lot for the help.

I am using MarkLogic.

Regards,
Lei Xu

On Jul 11, 2014, at 11:17 PM, "James Leigh" <james@3roundstones.com> wrote:

> Hi Lei,
> 
> The following query will include the score in the results for you. You
> may also want to move the DISTINCT into a subquery. If many ?person have
> reviewed many ?product it would be more efficient to reduce the ?person
> results earlier. Both changes are show below.
> 
> Also, what semantic engines are you working with?
> 
> PREFIX rev: <http://dbpedia.org/review/>
> PREFIX pd: <http://dbpedia.org/product/>
> PREFIX pe: <http://dbpedia.org/person/>
> 
> SELECT ?person ?score ?product  WHERE
> {
>  {
>    SELECT DISTINCT ?person {
>      pd:01 ^(rev:5|rev:4)/((rev:5|rev:4)/^(rev:5|rev:4))* ?person.
>    }
>  }
>  {
>    ?person rev:5 ?product
>    BIND (5 AS ?score)
>  } UNION {
>    ?person rev:4 ?product
>    BIND (4 AS ?score)
>  }
> }
> 
> Regards,
> James
> 
Received on Friday, 11 July 2014 14:54:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:17 UTC