Rob,
The sample is not very accurate, "'%Queen%Elizabeth%'" means search for
all words in phrase '%Queen%Elizabeth%' that is, probably, a phrase of
two words, Queen and Elizabeth? with weird delimiters between and around
words. This is search for ?object that is supposed to be a string. There
is no way to make a search for words in IRIs; e.g., free-text search
on ?subject in that query is not possible.
Best Regards,
Ivan Mikhailov,
OpenLink Software.
On Wed, 2008-04-30 at 13:52 +0100, robl wrote:
> Hugh Williams wrote:
> > Hi Rob,
> >
> > The following change to the query should work:
> >
> > SELECT ?subject ?predicate ?object WHERE {
> > ?subject ?predicate ?object.
> > ?object bif:contains "'%Queen%Elizabeth%'"
> > }
> >
> > Note the single quotes around the % characters.
>
> Doesn't this match objects rather than subjects though ? I don't think
> thats what was required ?
>
> >
> > Best Regards
> > Hugh Williams
> > Professional Services
> > OpenLink Software
> >
> > On 21 Apr 2008, at 14:40, robl wrote:
> >
> >> Hi,
> >>
> >> I'm currently working with the latest DBpedia dataset in Virtuoso OS
> >> Edition (5.06). I'm trying to do the equivalent of a SQL LIKE using
> >> SPARQL on a resource subject. So in SQL this would have been something
> >> like :
> >>
> >> SELECT * FROM pages WHERE page_title LIKE "Queen%Elizabeth"
> >>
> >> This would perform a case insensitive match on Queen(anything)Elizabeth
> >> (at least in mySQL).
> >>
> >> I have tried the following in my virtuoso instance :
> >>
> >> SELECT ?subject ?predicate ?object WHERE {
> >> ?subject ?predicate ?object.
> >> FILTER(?subject like "^http://dbpedia.org/resource/Queen.*Elizabeth$")
> >> }
> >>
> >> SELECT ?subject ?predicate ?object WHERE {
> >> ?subject ?predicate ?object.
> >> FILTER regex(?subject,
> >> "^http://dbpedia.org/resource/Queen.*Elizabeth$", "i")
> >> }
> >>
> >> These both take well over a minute to return (and the first doesn't seem
> >> to be case insensitive), which isn't acceptable for my particular
> >> application.
> >>
> >> Is there quick way to do what I want ? Are there any indexes I could
> >> apply to improve things (I have already created the indexes specified at
> >> http://www.openlinksw.com/dataspace/[email protected]/weblog/[email protected]'s%20BLOG%20%5B127%5D/1298)
> >>
> >>
> >> ?
> >>
> >> Or do I need to create a conventional SQL table of resource names and
> >> then do a SQL LIKE query on those ?
> >>
> >> Thanks,
> >>
> >> Rob
> >>
> >>
> >> -------------------------------------------------------------------------
> >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> >> Don't miss this year's exciting event. There's still time to save $100.
> >> Use priority code J8TL2D2.
> >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> >>
> >>
> >> _______________________________________________
> >> Virtuoso-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
> >
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Virtuoso-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users