Yrjänä Rankka wrote:
Marvin Lugair wrote:
Hi all!
This is more for the virtuoso folks but still cc-ing dbpedia.
Please give us some input if you can answer these questions:
I am trying text search in virtuos from isql against a locally loaded
dbpedia.
*QUESTION ONE*
Why does bif:contains return faster than REGEX search, and why are
they returning a different number of counted rows? The search string
is not the real string but it does not change the question. Which
should we use?
Marvin,
Actually question one seems to be two questions
1. bif:contains uses Virtuoso's full-text indexing capability which is
a much faster method than comparing each ?o using regex pattern.
2. regex filter and bif:contains have different pattern syntax and
thus have different matches.
(1) searching with with regex
SQL> sparql select count(*) where { ?s ?p ?o . FILTER regex(?o ,
"searchstring", "i")};
callret-0
INTEGER
_____________________________________________________________________________
4344
1 Rows. -- 3895755 msec.
(2) searching with bif:contains
SQL> sparql select count(*) where {?s ?p ?o. ?o bif:contains
"searchstring"};
callret-0
INTEGER
_______________________________________________________________________________
20737
1 Rows. -- 208426 msec.
*Question 2*
Why can't I search a property or subject?
SQL> sparql select count(*) where {?s ?p ?o. ?p bif:contains
"searchstring"};
*** Error 37000: [Virtuoso Driver][Virtuoso Server]SQ074: Line 1:
SP031: SPARQL compiler: The group does not contain triple pattern
with '$p' object before bif:contains() predicate
at line 1 of Top-Level:
sparql select count(*) where {?s ?p ?o. ?p bif:contains "searchstring"}
String literals in predicates is not a very common practicality in
RDF. We only have full-text indexing on object values.
Hmm. Sorry for being sarcastic here. Subject and predicate values cannot
be literals in RDF statements. Just to be clear.
Yrjänä
Please see
http://docs.openlinksw.com/virtuoso/rdfsparqlrulefulltext.html for
more info.
Yrjänä
THANKS!
Marv
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win
great prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Dbpedia-discussion mailing list
dbpedia-discuss...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
--
Yrjänä Rankka (gh...@zonk.net)
Grand Praetor of Excruciations - ZONK.NET Propaganda HQ
ZONK.NET - Advancing the Thermal Death of the Multiverse Since 1998