You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Nouwt, B. (Barry)" <ba...@tno.nl.INVALID> on 2020/04/28 15:47:15 UTC

Lucene integration

Hi all, I have a short question about the Lucene Index that can be integrated with an Apache Jena Dataset (https://jena.apache.org/documentation/query/text-query.html#).

Would inferred triples (by a forward GenericRuleReasoner) also get indexed by the Lucene index?

Regards, Barry
This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. TNO accepts no liability for the content of this e-mail, for the manner in which you use it and for damage of any kind resulting from the risks inherent to the electronic transmission of messages.

Re: Lucene integration

Posted by Andy Seaborne <an...@apache.org>.
(Sorry for the delay)

On 28/04/2020 16:47, Nouwt, B. (Barry) wrote:
> Hi all, I have a short question about the Lucene Index that can be integrated with an Apache Jena Dataset (https://jena.apache.org/documentation/query/text-query.html#).
> 
> Would inferred triples (by a forward GenericRuleReasoner) also get indexed by the Lucene index?

I don't think so in the general case.

The inferred triples are kept separately from the base graph so the 
configuration of the base as having a text index is not used. (Maybe 
someone can correct me here - it would be good if it were otherwise.)

A special case might be if the inferred triples use literals already in 
the base data, then they are indexes via the base graph so the pattern

## In the base graph
(?s ?score ?literal) text:query (rdfs:label 'word') ;
## In the inference graph
?x rdfs:label ?literal .

might ( I have not tried it) help.

It does the search then looks up the ?literal found which could drive 
the rule's machinery.

For forward rules producing triples, the inferences could be 
materialised and then indexed separately.

     Andy

> 
> Regards, Barry

Re: Lucene integration

Posted by Nicola Vitucci <ni...@gmail.com>.
This matches my results as well. If the TextDataset wraps a model, and
triples are added to such model causing an update to the base data, your
query works.

Nicola

Il giorno ven 1 mag 2020 alle ore 11:21 Andy Seaborne <an...@apache.org> ha
scritto:

> (Sorry for the delay)
>
> On 28/04/2020 16:47, Nouwt, B. (Barry) wrote:
> > Hi all, I have a short question about the Lucene Index that can be
> integrated with an Apache Jena Dataset (
> https://jena.apache.org/documentation/query/text-query.html#).
> >
> > Would inferred triples (by a forward GenericRuleReasoner) also get
> indexed by the Lucene index?
>
> I don't think so in the general case.
>
> The inferred triples are kept separately from the base graph so the
> configuration of the base as having a text index is not used. (Maybe
> someone can correct me here - it would be good if it were otherwise.)
>
> A special case might be if the inferred triples use literals already in
> the base data, then they are indexes via the base graph so the pattern
>
> ## In the base graph
> (?s ?score ?literal) text:query (rdfs:label 'word') ;
> ## In the inference graph
> ?x rdfs:label ?literal .
>
> might ( I have not tried it) help.
>
> It does the search then looks up the ?literal found which could drive
> the rule's machinery.
>
> For forward rules producing triples, the inferences could be
> materialised and then indexed separately.
>
>      Andy
>
> >
> > Regards, Barry
>

Re: Lucene integration

Posted by Andy Seaborne <an...@apache.org>.
(Sorry for the delay)

On 28/04/2020 16:47, Nouwt, B. (Barry) wrote:
> Hi all, I have a short question about the Lucene Index that can be integrated with an Apache Jena Dataset (https://jena.apache.org/documentation/query/text-query.html#).
> 
> Would inferred triples (by a forward GenericRuleReasoner) also get indexed by the Lucene index?

I don't think so in the general case.

The inferred triples are kept separately from the base graph so the 
configuration of the base as having a text index is not used. (Maybe 
someone can correct me here - it would be good if it were otherwise.)

A special case might be if the inferred triples use literals already in 
the base data, then they are indexes via the base graph so the pattern

## In the base graph
(?s ?score ?literal) text:query (rdfs:label 'word') ;
## In the inference graph
?x rdfs:label ?literal .

might ( I have not tried it) help.

It does the search then looks up the ?literal found which could drive 
the rule's machinery.

For forward rules producing triples, the inferences could be 
materialised and then indexed separately.

     Andy

> 
> Regards, Barry