Hi Geert, Thank you. Yes, that's what I have for now. But I was wondering that maybe, using regex() on IRIs was not the best way to approach this. For the record, this is what I have so far:
sem:sparql( 'SELECT DISTINCT ?s WHERE { ?s ?o ?p . FILTER( regex(?s, ?re) ) FILTER( ! isBlank(?s) ) }', map:entry('re', '.*[/#]?[^#/]*' || $input || '[^#/]*$')) Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ On 25 September 2016 at 21:59, Geert Josten wrote: > Hi Florent, > > How about a sparql query that filters with regex(str(?s), Œxyz¹) or > something alike? There are several other str functions in sparql > available, and if necessary you can leverage fn functions as well.. > > Cheers, > Geert > > On 9/25/16, 3:13 PM, "general-boun...@developer.marklogic.com on behalf of > Florent Georges" <general-boun...@developer.marklogic.com on behalf of > li...@fgeorges.org> wrote: > >>Hi, >> >>Given a string "xyz", I'd like to find all the IRIs in a subject >>position in the triple index, so that the string appear anywhere in >>the IRI after the last '/' or '#'. That is, for "xyz", I'd like to >>have: >> >>http://example.org/proj/component#xyz >>http://example.org/proj/component#abc-xyz >>http://example.org/proj/component/abc-xyz-123 >> >>But I am not quite sure what would be the correct way to use the >>triple index for this, potentially on large data sets. Any idea? >> >>Regards, >> >>-- >>Florent Georges >>http://fgeorges.org/ >>http://h2oconsulting.be/ >>_______________________________________________ >>General mailing list >>General@developer.marklogic.com >>Manage your subscription at: >>http://developer.marklogic.com/mailman/listinfo/general > > _______________________________________________ > General mailing list > General@developer.marklogic.com > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general