Re: finishRequest callback is not invoked

2016-07-15 Thread Zen 98052
e. Thanks, Z ____ From: Zen 98052 Sent: Thursday, July 14, 2016 9:40:03 AM To: users@jena.apache.org Subject: Re: finishRequest callback is not invoked I don't know if startRequest was called or not, since I didn't write any log there, other than capturing the star

Re: finishRequest callback is not invoked

2016-07-14 Thread Zen 98052
___ From: Andy Seaborne Sent: Thursday, July 14, 2016 8:59:04 AM To: users@jena.apache.org Subject: Re: finishRequest callback is not invoked On 14/07/16 13:48, Zen 98052 wrote: > Hi, > > I subclass DatasetGraphBase and implements GraphStore interface. > > The interface

finishRequest callback is not invoked

2016-07-14 Thread Zen 98052
Hi, I subclass DatasetGraphBase and implements GraphStore interface. The interface has method of startRequest and finishRequest. I don't bother startRequest, but I add code to call flush (to our back-end store) in finishRequest. Yesterday we encountered same issue again, which finishRequest ne

Re: got exception on specific query

2016-06-21 Thread Zen 98052
n specific query On 21/06/16 22:09, Zen 98052 wrote: > Yes, that's really weird. It works fine on previous deployment (using same > version of Jena, and same call to QueryFactory.create) > > Do you see any problem if I pass Syntax.syntaxARQ? Yes - the underlying fault is still there

Re: got exception on specific query

2016-06-21 Thread Zen 98052
PM To: users@jena.apache.org Subject: Re: got exception on specific query On 21/06/16 21:02, Zen 98052 wrote: > Yes, still using Jena 2, to be precise, v2.13.0 I tried the query in various versions (3.x, 2.13.0, 2.11) and they all work. My test was to run "qparse" on the

Re: got exception on specific query

2016-06-21 Thread Zen 98052
ndy On 21/06/16 16:11, Zen 98052 wrote: > > What puzzling me more, the code currently being deployed actually never > passed that second arg, but it doesn't throw exception. > > The Jena API version is same, I made some changes at other places, but not on > that particu

Re: got exception on specific query

2016-06-21 Thread Zen 98052
What puzzling me more, the code currently being deployed actually never passed that second arg, but it doesn't throw exception. The Jena API version is same, I made some changes at other places, but not on that particular code. This is so weird.. From

got exception on specific query

2016-06-21 Thread Zen 98052
Hi, I got exception when calling QueryFactory.create(query); where query is following: PREFIX v: PREFIX rdf: SELECT (COUNT(?idObj) AS ?idCount) WHERE { { SELECT ?person ?idObj WHERE { ?person v:hasUniqueID ?idObj .

Re: not performant query

2016-06-17 Thread Zen 98052
Thanks Andy! Answers inline ... From: Andy Seaborne Sent: Friday, June 10, 2016 11:06 AM To: users@jena.apache.org Subject: Re: not performant query On 09/06/16 16:28, Zen 98052 wrote: > Hi, > > I have a Sparql query below, which doesn't seem ef

Re: proper way to pass app context

2016-06-15 Thread Zen 98052
t On 15/06/16 13:35, Zen 98052 wrote: > Hi Andy, > > I see the code parseExecute in UpdateAction, which I can copy and pass the > context object. > > Before that, how do I get that per-request context at first place? > > > For SELECT request, I am able to call QueryEx

Re:

2016-06-15 Thread Zen 98052
I don't think I can use UpdateFactory.create, because it expects a String arg (while my case is I want to pass an InputStream) From: Zen 98052 Sent: Wednesday, June 15, 2016 6:01:02 PM To: users@jena.apache.org Subject: Re: proper way to pass app context

Re: proper way to pass app context

2016-06-15 Thread Zen 98052
_ From: Andy Seaborne Sent: Wednesday, June 15, 2016 4:22:45 PM To: users@jena.apache.org Subject: Re: proper way to pass app context On 15/06/16 13:35, Zen 98052 wrote: > Hi Andy, > > I see the code parseExecute in UpdateAction, which I can copy and pass the > context object. > &g

Re: proper way to pass app context

2016-06-15 Thread Zen 98052
Sent: Tuesday, June 14, 2016 4:44:48 AM To: users@jena.apache.org Subject: Re: proper way to pass app context On 14/06/16 01:06, Zen 98052 wrote: > Hi Andy, > > How to set the custom op executor for UPDATE? > My code for update is: > > > InputStream stream = n

Re: proper way to pass app context

2016-06-13 Thread Zen 98052
_ From: Andy Seaborne Sent: Friday, June 10, 2016 5:03:15 PM To: users@jena.apache.org Subject: Re: proper way to pass app context On 10/06/16 18:52, Zen 98052 wrote: > Hi Andy, > > I passed the graph object per my previous code, i.e. ctx.set(mySymbol, > myGraph); > > When

Re: proper way to pass app context

2016-06-10 Thread Zen 98052
users@jena.apache.org Subject: Re: proper way to pass app context On 10/06/16 16:39, Zen 98052 wrote: > Thanks Andy! > > Based on your suggestion, and looking at the code, it looks like I can do > something like: > > // create a new symbol, then set it of current context that I w

Re: proper way to pass app context

2016-06-10 Thread Zen 98052
that is returned on each call inside a single query. There is a global context, a per dataset context and each query execution has it's own Context (the accumulation from global and datasets at the point the query starts). Andy On 10/06/16 14:16, Zen 98052 wrote: > I figured it

Re: proper way to pass app context

2016-06-10 Thread Zen 98052
I figured it out, my bad. Somewhere I re-created a new QueryExecution, and passed that one (instead of the one below), hence it'll never work. From: Zen 98052 Sent: Thursday, June 9, 2016 8:13:41 PM To: users@jena.apache.org Subject: Re: proper way to pas

Re: proper way to pass app context

2016-06-09 Thread Zen 98052
), do you know what I missed here? Thanks, Z From: Zen 98052 Sent: Thursday, June 9, 2016 3:01:29 PM To: users@jena.apache.org Subject: proper way to pass app context Hi, I implement our own Sparql endpoint service, and I am trying to pass the session id (u

proper way to pass app context

2016-06-09 Thread Zen 98052
Hi, I implement our own Sparql endpoint service, and I am trying to pass the session id (unique per each client request), so that it can be accessed from the code in OpExecutor implementation. I store the session id in my graph object, the code looks something like: MyGraph graph = createGraph

not performant query

2016-06-09 Thread Zen 98052
Hi, I have a Sparql query below, which doesn't seem efficient. I noticed when running it, Jena calls execute(OpBGP opBGP, QueryIterator ...) so many times. I have my own implementation in that function (overrides base class OpExecutor), which it'll make call to our back-end storage. >From qpa

measure back-end store perf

2016-06-09 Thread Zen 98052
Hi, I am using our own custom db to store the triples data, and I'd like to put the code to measure net perf on how long it takes reading/writing to the store. For update operation, since I subclass DatasetGraphBase class (which has startRequest and finishRequest functions), I can put the start

Re: jena version upgrade

2016-06-09 Thread Zen 98052
Thanks for the pointer, Rob! From: Rob Vesse Sent: Thursday, June 9, 2016 4:44:58 AM To: users@jena.apache.org Subject: Re: jena version upgrade http://jena.apache.org/documentation/migrate_jena2_jena3.html Rob On 08/06/2016 19:17, "Zen 98052" w

jena version upgrade

2016-06-08 Thread Zen 98052
Hi, I just realized that we're still using Jena API of version 2.13.0 (still using com.hp.hpl.jena.* namespaces, before Andy updated it). Any potential breaking changes if I upgrade our code to use recent version of Jena (3.1.0), besides changing the import namespaces? Thanks, Z

Re: optimize a query

2016-06-07 Thread Zen 98052
http://foo/bar> ?o2 . ?s <http://foo/bar> ?o1 . FILTER (?o1 != ?o2) . } Thanks, Z From: Andy Seaborne Sent: Friday, June 3, 2016 6:03:02 PM To: users@jena.apache.org Subject: Re: optimize a query On 03/06/16 18:28, Zen 98052 wrote: > Hi, >

Re: optimize a query

2016-06-03 Thread Zen 98052
e since it's not making sense), then I can see pattern ?o2 <http://foo/id> "some id" is being passed now. Weird.. ________ From: Zen 98052 Sent: Friday, June 3, 2016 1:28:48 PM To: users@jena.apache.org Subject: optimize a query Hi, Is there a way to

optimize a query

2016-06-03 Thread Zen 98052
Hi, Is there a way to rewrite this Sparql query to run more efficiently? SELECT ?s WHERE { ?s ?o1, ?o2 . ?o2 "some id" . FILTER (?o1 != ?o2) . } It seems to me this can be optimized, I am still trying to figure it out. Thanks, Z

Re: execute more than 1 sparql queries

2016-04-12 Thread Zen 98052
Thanks for the info Andy! From: Andy Seaborne Sent: Tuesday, April 12, 2016 4:50 AM To: users@jena.apache.org Subject: Re: execute more than 1 sparql queries On 11/04/16 21:38, Zen 98052 wrote: > Hi, > > Client send a Sparql query to my servi

execute more than 1 sparql queries

2016-04-11 Thread Zen 98052
Hi, Client send a Sparql query to my service, which then the code pass the query to QueryFactory.create(), and then pass the returned query object to QueryExecutionFactory.create() Now client wants to send 2 queries (instead of making 2 calls to my service), can QueryFactory.create take more t

delete insert where

2016-03-20 Thread Zen 98052
Hi, I am trying to understand how DELETE/INSERT WHERE query is working since I see unexpected behavior. According to http://www.w3.org/TR/sparql11-update/#deleteInsert, the DELETE will be executed before INSERT. In this simple Sparql query for example: DELETE { ?old rdf:b rdf:thing . }

Re: delete insert where

2016-03-19 Thread Zen 98052
@jena.apache.org Subject: Re: delete insert where Works for me. What's SELECT * { ?new rdf:m "blah" . OPTIONAL { ?old rdf:b rdf:thing . } } On 16/03/16 15:18, Zen 98052 wrote: > Hi, > > I am trying to understand how DELETE/INSERT WHERE query i

Re: delete insert where

2016-03-19 Thread Zen 98052
eally can't figure it out :-( Unrelated question, I remember I used to be able to search for a keyword/string in Jena's code base on https://github.com/apache/jena, but somehow I don't see that Search code feature anymore :-( Thanks, Z

batch operation for each stage

2016-01-11 Thread Zen 98052
Hi, I am trying to optimize the call to our backend storage. Current implementation is it will create scan request (which will return iterator) for each binding. For example if the SPARQL query is something like: SELECT ?vendor WHERE { ?vendor p:product category:electronic . ?vendor p:coun

Re: long update query string causing stack overflow

2016-01-05 Thread Zen 98052
TripleCollector acc) : { } {// same as ConstructTriples #if SPARQL_11 // Version for the spec. TriplesSameSubject(acc) ( (TriplesTemplate(acc))?)? #endif #ifdef ARQ // Rewrite for no recursion - grammar is not LL(1) TriplesSameSubject(acc) (LOOKAHEAD(2) () Tripl

long update query string causing stack overflow

2016-01-04 Thread Zen 98052
Hi, I have a big INSERT DATA query, which it has about 20K triples. I passed the query string to UpdateFactory.create(), and it threw exception. at com.hp.hpl.jena.sparql.lang.ParserSPARQL11Update._parse(ParserSPARQL11Update.java:80) at com.hp.hpl.jena.sparql.lang.ParserSPARQL11Update.parse$(

Re: total triples

2015-11-16 Thread Zen 98052
Andy Seaborne Sent: Monday, November 16, 2015 5:18 PM To: users@jena.apache.org Subject: Re: total triples On 16/11/15 21:00, Zen 98052 wrote: > Hi Andy, > Apologize for my lacking knowledge on Jena codebase, I am still learning at > slow pace. > > I guess the stuff in OpExecutor is

Re: total triples

2015-11-16 Thread Zen 98052
0 PM To: users@jena.apache.org Subject: Re: total triples On 09/11/15 18:58, Zen 98052 wrote: > Thanks Martynas! > Shouldn't it call graph's size(), which in turn calls graphBaseSize()? Depends what "it" is. Have you implemented some or all of the algebra or are you usi

Re: total triples

2015-11-09 Thread Zen 98052
9, 2015 at 3:47 PM, Zen 98052 wrote: > What is the most efficient way to get total number of triples? > > Is this query below the only way? > > SELECT (COUNT(*) AS ?no) { ?s ?p ?o } > > > Thanks, > > Z

total triples

2015-11-09 Thread Zen 98052
What is the most efficient way to get total number of triples? Is this query below the only way? SELECT (COUNT(*) AS ?no) { ?s ?p ?o } Thanks, Z

Re: DELETE with WHERE clause

2015-10-08 Thread Zen 98052
ail . }; Thanks, Z From: Rob Vesse Sent: Thursday, October 8, 2015 9:20 AM To: users@jena.apache.org Subject: Re: DELETE with WHERE clause On 08/10/2015 13:48, "Zen 98052" wrote: >Second question, I notice that update operation is instance of >UpdateModify. Do you

Re: DELETE with WHERE clause

2015-10-08 Thread Zen 98052
__ From: Andy Seaborne Sent: Thursday, October 8, 2015 3:29 AM To: users@jena.apache.org Subject: Re: DELETE with WHERE clause On 08/10/15 02:33, Zen 98052 wrote: > If I pass this query: > > > DELETE > { >?contactInfo abc:hasEmail ?email . >?email ?email

DELETE with WHERE clause

2015-10-07 Thread Zen 98052
If I pass this query: DELETE { ?contactInfo abc:hasEmail ?email . ?email ?emailPredicate ?emailObject . } WHERE { ?person abc:name "foobar" . ?person abc:hasContactInfo ?contactInfo . } to this example code below, the it doesn't do anything. UpdateRequest updateRequest = UpdateFact

Re: jena atlas io exception

2015-10-07 Thread Zen 98052
7;t want any further data and closes the connection) Rob On 07/10/2015 16:35, "Zen 98052" wrote: >I tweaked a SPARQL query (it worked fine earlier) and now I got this >exception on server side. Is it because the result set is too big? Is >there a work

Re: jena atlas io exception

2015-10-07 Thread Zen 98052
Never mind, my bad. Apparently, the disk is full :-( From: Zen 98052 Sent: Wednesday, October 7, 2015 11:35 AM To: users@jena.apache.org Subject: jena atlas io exception I tweaked a SPARQL query (it worked fine earlier) and now I got this exception on

jena atlas io exception

2015-10-07 Thread Zen 98052
I tweaked a SPARQL query (it worked fine earlier) and now I got this exception on server side. Is it because the result set is too big? Is there a workaround? [ERROR] 2015-10-07 11:27:34,561 org.foobar.service.GraphQueryHttpServlet executeQueryAndWriteResponse - org.apache.jena.atlas.RuntimeIOE

Re: delete all triples

2015-09-29 Thread Zen 98052
AM To: users@jena.apache.org Subject: Re: delete all triples On 29/09/15 16:06, Zen 98052 wrote: > Is it possible to delete all triples? I tried this command below, and got > error saying variables are not permitted. > > > DELETE DATA > > { > ?s ?p ?o > } > > > Tha

delete all triples

2015-09-29 Thread Zen 98052
Is it possible to delete all triples? I tried this command below, and got error saying variables are not permitted. DELETE DATA { ?s ?p ?o } Thanks, Z

Re: question on LIMIT

2015-09-22 Thread Zen 98052
2,482 ms vs. 9,119 ms vs. 7,991 ms From: Andy Seaborne Sent: Tuesday, September 22, 2015 3:50 PM To: users@jena.apache.org Subject: Re: question on LIMIT On 22/09/15 19:06, Zen 98052 wrote: > Thanks Andy! All those 3 queries work as expected. Just

Re: question on LIMIT

2015-09-22 Thread Zen 98052
From: Andy Seaborne Sent: Tuesday, September 22, 2015 12:30 PM To: users@jena.apache.org Subject: Re: question on LIMIT On 22/09/15 17:02, Zen 98052 wrote: > Hi Andy, > I don't see any of my code referencing to QueryIterSlice or OpSlice. > To answer question from Martyna

Re: question on LIMIT

2015-09-22 Thread Zen 98052
atatype": "http://www.w3.org/2001/XMLSchema#integer"; , "type": "typed-literal" , "value": "75" } } ] } If I modify the query to add OFFSET and also change the number on LIMIT, for example: # What languages are most popular in

question on LIMIT

2015-09-22 Thread Zen 98052
For example, the query result set (with ORDER clause) is [ a, b, c, d, e, f, g, h, i, j ] When I put OFFSET 4 and LIMIT 3 in the query, I got back [ d, e ] as the result. It should return 3 items instead of 2, where is the Jena code that I can debug to find out the issue (likely bug in my code)

Re: return model as json

2015-09-21 Thread Zen 98052
_ From: Andy Seaborne Sent: Monday, September 21, 2015 2:40 PM To: users@jena.apache.org Subject: Re: return model as json On 21/09/15 18:35, Zen 98052 wrote: > Hi, > > There is ResultSetFormatter.outputAsJSON to return the result set (from > SELECT command) as JSON response

return model as json

2015-09-21 Thread Zen 98052
Hi, There is ResultSetFormatter.outputAsJSON to return the result set (from SELECT command) as JSON response to the client. For CONSTRUCT and DESCRIBE commands, they are returning Model instead of ResultSet, is there a similar helper function to return the JSON response back to client? Than

Re: jena technical doc

2015-09-17 Thread Zen 98052
ps://github.com/marklogic/marklogic-jena/blob/develop/marklogic-jena/src/main/java/com/marklogic/semantics/jena/engine/MarkLogicUpdateEngine.java I see that you figured this same solution out. Charles ____ From: Zen 98052 [z98...@outlook.com] Sent: Thursda

Re: jena technical doc

2015-09-17 Thread Zen 98052
Graph interface. With this, then I can simply pass it to the UpdateEngineMain constructor, which then it will call my add/delete logic. Sorry for my ignorance :-( Thanks, Z From: Zen 98052 Sent: Thursday, September 17, 2015 3:00 PM To: users@jena.apach

Re: jena technical doc

2015-09-17 Thread Zen 98052
_____ From: Zen 98052 Sent: Thursday, September 17, 2015 11:32 AM To: users@jena.apache.org Subject: Re: jena technical doc Hi Andy, I have follow up question for #2 after looking at DatasetGraph class, and Jena's code sample for the update operation. Which interface I can implement, s

Re: jena technical doc

2015-09-17 Thread Zen 98052
ec) pass a update where a query is expected. It is always a parse error. 2. DatasetGraph.add(Quad) and .delete(Quad) Andy On 10/09/15 13:52, Zen 98052 wrote: > Thanks Andy. Let me look at the code and some examples pointed by you. > In the meantime, I have another question. > >

Re: paging the query results

2015-09-16 Thread Zen 98052
>> this: >> >> https://stackoverflow.com/questions/29273705/how-to-paginate-a-list-of-objects-in-java-8 >> >> ResultSet is an Iterator, so you can convert it to a Stream. >> >> --- >> A. Soroka >> The University of Virginia Library >>

Re: paging the query results

2015-09-16 Thread Zen 98052
Now I am thinking instead of using FluentIterable, I should implement my own class (that implements ResultSet) with that skipping and limit logic. Still, let me know if there is better and more efficient way than this. Thanks! From: Zen 98052 Sent

paging the query results

2015-09-16 Thread Zen 98052
Any idea on how to do the paging on the results set? For example in this code: ResultSet rs = qe.execSelect(); I was thinking to use com.google.common.collect.FluentIterable, so let say I have the start offset and rows count values. To do the paging logic in naive way would be something like

Re: pass additional data in sparql

2015-09-16 Thread Zen 98052
query. Thanks again, Z From: Andy Seaborne Sent: Sunday, September 13, 2015 5:25 AM To: users@jena.apache.org Subject: Re: pass additional data in sparql On 11/09/15 15:48, Zen 98052 wrote: > If I want to pass additional data (in addition to triples pat

pass additional data in sparql

2015-09-11 Thread Zen 98052
If I want to pass additional data (in addition to triples pattern) in SPARQL, does it mean I have to deal with quad? Or is there another way? The additional data can be a firm id, for example it only queries data from that firm id partition (in our custom storage) Thanks, Z

Re: jena technical doc

2015-09-10 Thread Zen 98052
: Andy Seaborne Sent: Thursday, September 10, 2015 1:44 AM To: users@jena.apache.org Subject: Re: jena technical doc On 10/09/15 00:20, Zen 98052 wrote: > Hi, > > I am new to Jena programming. > > I am using Jena's SPARQL API to process the query and translate the > query into

jena technical doc

2015-09-09 Thread Zen 98052
Hi, I am new to Jena programming. I am using Jena's SPARQL API to process the query and translate the query into accessing our custom back-end storage. I am now familiar with basic code like subclassing the GraphBase and QueryIter with my own implementation. But I need to learn more on extendi