On 4/4/14 7:19 AM, Bart Vandewoestyne wrote:
So my two questions remain:

1) Why is the rewritten query

SELECT ?val (COUNT(DISTINCT ?id) as ?vc)
WHERE
{
      ?id<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   ?val ;
          ?property ?property_value .
          ?property_value bif:contains 'foo or bar' .
}
GROUP BY ?val
ORDER BY DESC(?vc)

The query above leverages a text index in regards to 'foo' or 'bar' .

giving me different results than the original one:

SELECT ?val (COUNT(DISTINCT ?id) as ?vc)
WHERE
{
      ?id<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>   ?val.
      ?id ?property ?property_value.
      ?property_value bif:contains "'foo'".
      ?id ?property1 ?property_value1.
      ?property_value1 bif:contains "'bar'".
}
GROUP BY ?val
ORDER BY DESC(?vc)


The query above uses an inner join across two branches first must have a 'foo' 
second must have a 'bar'.

Conclusions:

[1] the queries are different, so the solutions are different.
[2] one query leverages a text index (no inner join), the other has an inner 
join two which the text indexes are ultimately applied


--

Regards,

Kingsley Idehen 
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen





Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to