Hi Florent,
I'm not recommending this as a best practice in RDF/SPARQL or anything, but
just as a bit of brainstorming for what you might be able to do in the
wild-and-woolly world of mixing and matching between RDF and XML views of
your data. If you're using unmanaged triples (that is, triples managed by
*you* in your own XML docs), then you could create a path range index on
<sem:subject> (but only for those within a particular context, so you don't
load every conceivable subject into memory). Then you can call something
like:
cts:value-match(cts:path-reference("/my:path/to/sem:triple/sem:subject"),"
http://example.com/proj/*"))
But this will likely work well only if you stick to prefix patterns, unless
you have a pretty small set of possible IRIs. The wildcard should work
anywhere in the pattern, but if you put text after a wildcard, it will have
to do a lot more scanning. Also, just to reiterate, use a range index with
care, since every value will be loaded into memory.
Like I said, just brainstorming. It might be worth a try, especially if
you're not totally ready to drink the entire pitcher of RDF Kool-Aid. :-)
Evan
Evan Lenz
President, Lenz Consulting Group, Inc.
http://lenzconsulting.com
On Sun, Sep 25, 2016 at 6:13 AM, Florent Georges <[email protected]> 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
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general