Re: Performance of rebinds after multiple changes?

2023-06-14 Thread Dave Reynolds

Hi Steve,

On 14/06/2023 13:38, Steve Vestal wrote:
The help pages say a rebind will happen automatically when things are 
added or removed to an OntModel (except odd cases).  I'm curious about 
the performance impact when a sequence of multiple changes are made.  Is 
the rebind itself fast, so a sequence of changes and rebinds has no 
significant performance impact until the next request for information? 


Yes, rebind() is very cheap, it just sets a flag (or rather unsets the 
isPrepared flag). So it's not until the next query that the work will be 
redone.


Dave


Re: State of Elastic/Open Search support in Fuseki

2023-06-14 Thread Øyvind Gjesdal
Hi Adrian,

We tried the elastic-search module when it was available and had your
use-case in mind with facets. But as far as I remember I don't think it was
possible to use aggregations (at least from the sparql side of things).
I understood the elasticsearch-module as an alternative to the lucene
module, used in a similar manner, using the same extension function
(text:query).

Facet/aggregation was not implemented as extension functions in SPARQL and
I believe that it also used the same abstraction described in the jena-text
docs:

>  One Jena *triple* equals one Lucene *document*

which makes aggregations/facets not available or usable neither from the
Elasticsearch APIs.

We switched to jena-text with Lucene after some weeks, which didn't have
aggregations either, but there was much more activity and usage for the
module, and the options for configuring from the assembler files were much
richer.

Just a disclaimer that this was a long time ago, and I could have
misunderstood how things worked.
At the moment I'm unsure if I inspected and looked at the Elasticsearch
APIs directly to check the structure of the documents in the index itself,
after indexing.

Best regards,
Øyvind




On Wed, Jun 14, 2023 at 11:48 AM Adrian Gschwend  wrote:

>
> According to https://jena.apache.org/documentation/query/text-query.html
> there was support for text search using Elastic instead of Lucene in
> Fuseki at some point at least. But from what I can see it was removed
> (?) in 4.x.
>
> We have a use-case where faceted search is important and this is quite
> hard in SPARQL 1.1, paging & counting is less than ideal. Either the
> queries get very complex or the counts are wrong.
>
> What was the reason for removing that code, lack of maintenance? If so,
> any ideas on how much work it would be to bring this to the 4.x codebase
> again? I guess it might make sense to switch to OpenSearch as well
> instead with the Elastic license issues.
>
> Anyone has or had Elastic in use in Fuseki & can share some experience?
> I found some posts here and there but not much details about how the
> integration worked.
>
> regards
>
> Adrian
>
>


Performance of rebinds after multiple changes?

2023-06-14 Thread Steve Vestal
The help pages say a rebind will happen automatically when things are 
added or removed to an OntModel (except odd cases).  I'm curious about 
the performance impact when a sequence of multiple changes are made.  Is 
the rebind itself fast, so a sequence of changes and rebinds has no 
significant performance impact until the next request for information?  
If not, would Model add(Statement[] statements) and Model 
remove(Statement[] statements) do a single rebind for a batch of changes?




Re: State of Elastic/Open Search support in Fuseki

2023-06-14 Thread Nicholas Car
We use Lucene in Fuseki 4.x quite successfully. Perhaps the removal of support 
for Elastic was simply that Lucene is supported and that is fine for most use 
cases.

Lucene support seems not to make faceting available (as recently discussed here 
by David in my company) so there is likely Lucene improvements that can be made.

Can you articulate what advantages you see in Elastic/OpenSearch support over 
Lucene?

Nick

On Wed, Jun 14, 2023 at 7:47 pm, Adrian Gschwend 
<[ml-...@netlabs.org](mailto:On Wed, Jun 14, 2023 at 7:47 pm, Adrian Gschwend 
< wrote:

> According to https://jena.apache.org/documentation/query/text-query.html
> there was support for text search using Elastic instead of Lucene in
> Fuseki at some point at least. But from what I can see it was removed
> (?) in 4.x.
>
> We have a use-case where faceted search is important and this is quite
> hard in SPARQL 1.1, paging & counting is less than ideal. Either the
> queries get very complex or the counts are wrong.
>
> What was the reason for removing that code, lack of maintenance? If so,
> any ideas on how much work it would be to bring this to the 4.x codebase
> again? I guess it might make sense to switch to OpenSearch as well
> instead with the Elastic license issues.
>
> Anyone has or had Elastic in use in Fuseki & can share some experience?
> I found some posts here and there but not much details about how the
> integration worked.
>
> regards
>
> Adrian

Re: CONSTRUCT query with rsparql

2023-06-14 Thread Martynas Jusevičius
Sorry, I meant this:



CONSTRUCT
  {
?s ?p ?o .
  }
WHERE
  { ?s  ?p?o ;
  "the message"
  }

On Wed, Jun 14, 2023 at 12:23 PM Martynas Jusevičius
 wrote:
>
> No syntax issue, but with ?o being not bound the ?s ?p ?o triple will
> not be constructed.
>
> This might or might not be what you are looking for:
>
> CONSTRUCT
>   {
> ?s ?p ?o .
>   }
> WHERE
>   { ?s    ?o ;
>   "the message"
>   }
>
> On Wed, Jun 14, 2023 at 12:13 PM Hashim Khan  
> wrote:
> >
> > Thanks for the quick response. I would ask if you write the exact query
> > please. By, ?o not bound, you mean that we can not execute such a
> > construct query? Or is there a syntax issue?
> >
> > On Wed, Jun 14, 2023 at 12:04 PM Martynas Jusevičius 
> > 
> > wrote:
> >
> > > ?o is not bound in your WHERE pattern.
> > >
> > > On Wed, Jun 14, 2023 at 11:50 AM Hashim Khan 
> > > wrote:
> > > >
> > > > Hi,
> > > >
> > > > ./rsparql --service http://localhost:8890/sparql --query query.sparql
> > > > --results=ntriples I want to save the triples in NT format as returned 
> > > > by
> > > > the construct query given here.
> > > > CONSTRUCT {?s ?p ?o} WHERE {
> > > >?s  'the message' .
> > > > }
> > > >
> > > > I have run this query with SELECT and it has many triples, but when I
> > > want
> > > > to construct them, then I can not see the effect. It takes about two
> > > > seconds but neither output.nt file generates, nor I see any triples. If
> > > > anyone please tell me the exact query to accomplish this job.
> > > >
> > > > best regards
> > > > --
> > > > *Hashim Khan*
> > >
> >
> >
> > --
> > *Hashim Khan*


Re: CONSTRUCT query with rsparql

2023-06-14 Thread Martynas Jusevičius
No syntax issue, but with ?o being not bound the ?s ?p ?o triple will
not be constructed.

This might or might not be what you are looking for:

CONSTRUCT
  {
?s ?p ?o .
  }
WHERE
  { ?s    ?o ;
  "the message"
  }

On Wed, Jun 14, 2023 at 12:13 PM Hashim Khan  wrote:
>
> Thanks for the quick response. I would ask if you write the exact query
> please. By, ?o not bound, you mean that we can not execute such a
> construct query? Or is there a syntax issue?
>
> On Wed, Jun 14, 2023 at 12:04 PM Martynas Jusevičius 
> wrote:
>
> > ?o is not bound in your WHERE pattern.
> >
> > On Wed, Jun 14, 2023 at 11:50 AM Hashim Khan 
> > wrote:
> > >
> > > Hi,
> > >
> > > ./rsparql --service http://localhost:8890/sparql --query query.sparql
> > > --results=ntriples I want to save the triples in NT format as returned by
> > > the construct query given here.
> > > CONSTRUCT {?s ?p ?o} WHERE {
> > >?s  'the message' .
> > > }
> > >
> > > I have run this query with SELECT and it has many triples, but when I
> > want
> > > to construct them, then I can not see the effect. It takes about two
> > > seconds but neither output.nt file generates, nor I see any triples. If
> > > anyone please tell me the exact query to accomplish this job.
> > >
> > > best regards
> > > --
> > > *Hashim Khan*
> >
>
>
> --
> *Hashim Khan*


Re: CONSTRUCT query with rsparql

2023-06-14 Thread Hashim Khan
Thanks for the quick response. I would ask if you write the exact query
please. By, ?o not bound, you mean that we can not execute such a
construct query? Or is there a syntax issue?

On Wed, Jun 14, 2023 at 12:04 PM Martynas Jusevičius 
wrote:

> ?o is not bound in your WHERE pattern.
>
> On Wed, Jun 14, 2023 at 11:50 AM Hashim Khan 
> wrote:
> >
> > Hi,
> >
> > ./rsparql --service http://localhost:8890/sparql --query query.sparql
> > --results=ntriples I want to save the triples in NT format as returned by
> > the construct query given here.
> > CONSTRUCT {?s ?p ?o} WHERE {
> >?s  'the message' .
> > }
> >
> > I have run this query with SELECT and it has many triples, but when I
> want
> > to construct them, then I can not see the effect. It takes about two
> > seconds but neither output.nt file generates, nor I see any triples. If
> > anyone please tell me the exact query to accomplish this job.
> >
> > best regards
> > --
> > *Hashim Khan*
>


-- 
*Hashim Khan*


Re: CONSTRUCT query with rsparql

2023-06-14 Thread Martynas Jusevičius
?o is not bound in your WHERE pattern.

On Wed, Jun 14, 2023 at 11:50 AM Hashim Khan  wrote:
>
> Hi,
>
> ./rsparql --service http://localhost:8890/sparql --query query.sparql
> --results=ntriples I want to save the triples in NT format as returned by
> the construct query given here.
> CONSTRUCT {?s ?p ?o} WHERE {
>?s  'the message' .
> }
>
> I have run this query with SELECT and it has many triples, but when I want
> to construct them, then I can not see the effect. It takes about two
> seconds but neither output.nt file generates, nor I see any triples. If
> anyone please tell me the exact query to accomplish this job.
>
> best regards
> --
> *Hashim Khan*


CONSTRUCT query with rsparql

2023-06-14 Thread Hashim Khan
Hi,

./rsparql --service http://localhost:8890/sparql --query query.sparql
--results=ntriples I want to save the triples in NT format as returned by
the construct query given here.
CONSTRUCT {?s ?p ?o} WHERE {
   ?s  'the message' .
}

I have run this query with SELECT and it has many triples, but when I want
to construct them, then I can not see the effect. It takes about two
seconds but neither output.nt file generates, nor I see any triples. If
anyone please tell me the exact query to accomplish this job.

best regards
-- 
*Hashim Khan*


State of Elastic/Open Search support in Fuseki

2023-06-14 Thread Adrian Gschwend



According to https://jena.apache.org/documentation/query/text-query.html 
there was support for text search using Elastic instead of Lucene in 
Fuseki at some point at least. But from what I can see it was removed 
(?) in 4.x.


We have a use-case where faceted search is important and this is quite 
hard in SPARQL 1.1, paging & counting is less than ideal. Either the 
queries get very complex or the counts are wrong.


What was the reason for removing that code, lack of maintenance? If so, 
any ideas on how much work it would be to bring this to the 4.x codebase 
again? I guess it might make sense to switch to OpenSearch as well 
instead with the Elastic license issues.


Anyone has or had Elastic in use in Fuseki & can share some experience? 
I found some posts here and there but not much details about how the 
integration worked.


regards

Adrian