You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Neubert, Joachim" <J....@zbw.eu> on 2016/04/28 10:39:43 UTC

Property for matching term from text index?

The Jena text index allows to record the literal, which was matched in a text query:


 (?s ?score ?literal) text:query ('query string')

(from https://jena.apache.org/documentation/query/text-query.html).

When returning the result of a construct query, I want to attach the matching term (?literal) to the matched subject (?s), like this:

  ?s ex:matchingTerm ?literal

Is anybody aware of a already existing property, which could be used for "ex:matchingTerm"?

Cheers, Joachim

AW: Property for matching term from text index?

Posted by "Neubert, Joachim" <J....@zbw.eu>.
Hi Osma,

That wouldn't work as wanted: First, the index may be based on several properties, and I cannot determine easily which was matched. Second, if I return e.g. multiple altLabels, the matching one cannot be discriminated from all others. So I'm looking for something which works like highlighting a matched term from a text.

Cheers, Joachim

> -----Ursprüngliche Nachricht-----
> Von: Osma Suominen [mailto:osma.suominen@helsinki.fi]
> Gesendet: Donnerstag, 28. April 2016 11:42
> An: users@jena.apache.org
> Betreff: Re: Property for matching term from text index?
> 
> Hi Joachim!
> 
> If you know the property that the index is based on, why not use that?
> For example, skos:prefLabel or rdfs:label. Or am I missing something?
> 
> -Osma
> 
> 28.04.2016, 11:39, Neubert, Joachim wrote:
> > The Jena text index allows to record the literal, which was matched in a text
> query:
> >
> >
> >   (?s ?score ?literal) text:query ('query string')
> >
> > (from https://jena.apache.org/documentation/query/text-query.html).
> >
> > When returning the result of a construct query, I want to attach the matching
> term (?literal) to the matched subject (?s), like this:
> >
> >    ?s ex:matchingTerm ?literal
> >
> > Is anybody aware of a already existing property, which could be used for
> "ex:matchingTerm"?
> >
> > Cheers, Joachim
> >
> 
> 
> --
> 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
> osma.suominen@helsinki.fi
> http://www.nationallibrary.fi

Re: Property for matching term from text index?

Posted by Osma Suominen <os...@helsinki.fi>.
Hi Joachim!

If you know the property that the index is based on, why not use that? 
For example, skos:prefLabel or rdfs:label. Or am I missing something?

-Osma

28.04.2016, 11:39, Neubert, Joachim wrote:
> The Jena text index allows to record the literal, which was matched in a text query:
>
>
>   (?s ?score ?literal) text:query ('query string')
>
> (from https://jena.apache.org/documentation/query/text-query.html).
>
> When returning the result of a construct query, I want to attach the matching term (?literal) to the matched subject (?s), like this:
>
>    ?s ex:matchingTerm ?literal
>
> Is anybody aware of a already existing property, which could be used for "ex:matchingTerm"?
>
> Cheers, Joachim
>


-- 
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
osma.suominen@helsinki.fi
http://www.nationallibrary.fi