On 24/06/15 15:39, Chris Dollin wrote:

In practice, the literal value would be stored using the Lucene
facility to
store the original field value alongside the indexed value
(TextField.TYPE_STORED). This would be similar to how LARQ worked. If the
langField setting was in use, the language field would hold the
language tag as
well. If not, the returned literals would not have a language tag (in
the above
example, the value would be "My resource").

Typed literals should work as well.

Okay, but where should the type be stored in that case? In another field, analoguous to langField?

Do you have a specific use case in mind for storing and retrieving typed literals in the jena-text index?

I remember some gotchas where bits of the code believed that what came
out of the index could only be a non-blank resource, but it was fixable
and presumably you've already spotted that.

Hmm, not sure I follow. The literal value would be returned in addition to the resource, not instead of it.

In SPARQL, you'd pass a 3-element list as the subject (see my original e-mail for example) for the text:query property function. In Java code, all the relevant jena-text methods already return TextHit objects (this was implemented for the "return score" case), which would get an extra field that you could query using getLiteral() or some such method.

[Hmm, where /did/ I put that code?]

Now would be a good time to find it :)

-Osma


--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
[email protected]
http://www.nationallibrary.fi

Reply via email to