Hi Bart, On 20-Jun-14 2:24 PM, Bart Vandewoestyne wrote:
Hello list,According to the example at http://docs.openlinksw.com/virtuoso/sparqlextensions.html#rdfsparqlrulefulltext using things like ?name bif:contains "'rich*'" would match if ?name STARTS with Rich.
The example here refers to foaf:name ?name i.e. using bif:contains it will find the *names *containing 'rich' ( not starting with ).
10x for the catch, we will soon update the doc. As for finding all objects starting with given string, you could use for instance the Virtuoso *starts_with* function: SELECT * WHERE { ?s ?p ?o . FILTER ( bif:starts_with(str(?o), 'your-string-here') = 1 ) }i.e. selecting all objects for which the string is found on first position of ?o.
-- Example: -- SELECT * WHERE { ?s foaf:nick ?o FILTER ( bif:starts_with(str(?o), 'melvin') = 1 ) } LIMIT 10 -- Live demo link: -- http://bit.ly/1jCUpqN You can also use the "*locate*" ( or "*strstr*" ): -- Example: -- SELECT * WHERE { ?s foaf:nick ?o FILTER ( bif:locate('melvin',str(?o)) = 1 ) } LIMIT 10 -- Live demo results -- http://bit.ly/1lGrciT Doc links: -- http://docs.openlinksw.com/virtuoso/fn_starts_with.html -- http://docs.openlinksw.com/virtuoso/fn_locate.html -- http://docs.openlinksw.com/virtuoso/fn_strstr.html Best Regards, Rumi Kocis
However, I have a query that has ?searchterm bif:contains "'homo*'" . and it also seems to match with ?searchterm that look like "abnormal spindle-like microcephaly-associated protein homolog" which is a string that DOES NOT START with 'homo', but CONTAINS the string 'homo'. Is this a bug in Virtuoso, is the documentation incorrect, or am I somehow misinterpreting what "'rich*'" exactly matches? Kind regards, Bart ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ Virtuoso-users mailing list Virtuoso-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtuoso-users
smime.p7s
Description: S/MIME Cryptographic Signature
------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems
_______________________________________________ Virtuoso-users mailing list Virtuoso-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtuoso-users