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



Reply via email to