Hi Ivan,
thank you! Looks gut ...
First one seems to work as a Sparql query.
"syntax error at bif:strstr before ( "
FILTER ( BOUND(bif:strstr (?label, ?title) )
But it works without the BOUND keyword.
I'm new to Virtuoso and SQL / SPARQL environment and try to compare
small buch of triples with a dc:title property with the rdfs:label property
from the whole dbpedia dataset stored locally. How do i can increase
search performance?
It takes lot of time (about 5-10 minutes each) at the moment altough it
runs on a quad core, 4gb, ssd system.
The dbpedia dataset is loaded into one graph.
In the meantime I already run the RDF_OBJ ADD rule with (null, null,
'ALL') to enable free text seach index.
I consider there is a way to index the rdfs label property only (no need
to search each dbpedia property or concept) in any way but dunno how.
Best regards,
Robert
On 09.06.2011 15:48, Ivan Mikhailov wrote:
Robert,
bif:strstr (?haystack, ?needle) will return an zero-based position of
of ?needle in ?haystack, or NULL if not found [1]. Thus
FILTER (BOUND (bif:strstr (?haystack, ?needle)))
is what you need.
For similar future needs, note
FILTER (BOUND (bif:strcasestr (?haystack, ?needle)))
Recent versions also support (not yet documented)
FILTER (bif:strcontains (?haystack, ?needle))
(strcontains returns boolean, not a position or NULL)
FILTER (bif:starts_with (?dachshund, ?nose))
FILTER (bif:ends_with (?dachshund, ?tail))
Best Regards,
Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com
[1] http://docs.openlinksw.com/virtuoso/fn_strstr.html
On Thu, 2011-06-09 at 13:30 +0200, Robbet wrote:
Hello,
actually i'm trying to find a solution to compare two string variables
(exact match of the string and if one variable contains the other).
Is it possible (in any way) to use the bif:contains function in this
case? Like variable1 bif:contains variable2 (or the other way round) ?
Already tried it but i receive an expression error.
f.e.
Select *
Where {
?s dc:title ?variable1.
?x rdfs:label ?variable2.
variable1 bif:contains variable2.
}
Best regards,
Robert
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________ Virtuoso-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/virtuoso-users