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

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: <>
PREFIX pd: <>
PREFIX pe: <>

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)


Received on Friday, 11 July 2014 14:17:57 UTC