- 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>
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