You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(8) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(13) |
Jun
(18) |
Jul
(9) |
Aug
(7) |
Sep
(2) |
Oct
(31) |
Nov
(2) |
Dec
(2) |
2007 |
Jan
|
Feb
(7) |
Mar
(12) |
Apr
(8) |
May
(8) |
Jun
(10) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(6) |
Jun
(2) |
Jul
|
Aug
(37) |
Sep
(9) |
Oct
(5) |
Nov
(5) |
Dec
(10) |
2009 |
Jan
(10) |
Feb
(9) |
Mar
(3) |
Apr
(4) |
May
(25) |
Jun
(61) |
Jul
(24) |
Aug
(12) |
Sep
(7) |
Oct
(1) |
Nov
(4) |
Dec
(1) |
2010 |
Jan
(12) |
Feb
(14) |
Mar
|
Apr
(1) |
May
|
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(21) |
Oct
(2) |
Nov
|
Dec
(5) |
2011 |
Jan
(3) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Olaf H. <ha...@in...> - 2010-12-15 15:13:51
|
Hey Fahad, The problem is that the FOAF vocabulary definition that is available by looking up the URI foaf:Document, does not include links to the definition of your vocabulary. To solve this problem for your application, you can make up such links and load them into SWClLib before you execute your queries. So, what you have to do is to create an RDF document locally and add RDF triples such as: foaf:Document rdfs:seeAlso <http://localhost:8080/newspaper/vocabulary/news/> You load this file as seed data into the queried dataset used by SWClLib. This can be done as follows: 1.) if you use the command line client ./bin/semwebquery you can use the parameter -load You only have to provide a file:// URI for you RDF document. So, you could do something like: ./bin/semwebquery -load file:///home/user/data/mylinks.rdf -sparqlfile query.rq 2.) if you use the library in a Java program you have to create a de.fuberlin.wiwiss.ng4j.NamedGraph object that contains the RDF triples from your document and add this NamedGraph to your SemanticWebClient object using the method addGraph Greetings, Olaf On Wednesday 15 December 2010 13:48:22 Fahad Alahmari wrote: > Hi, > > I'm trying to use the Semantic Web Client Library to query my own datasets > that stored in a control environment. I used Pubby to translate the orginal > URIs to my environment URIs to run the SPARQL queries over datasets easily. > SWCILib runs queries that included my environment URIs properly but can not > run queries that do not have my environment URIs. For example: > > This query run properly: > > PREFIX news: <http://localhost:8080/newspaper/vocabulary/news/> > SELECT ?s ?p WHERE { ?s ?p news:article } > > > But with this query, SWCILib can not point URIs to things in my own > environment: > > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > PREFIX foaf: <http://xmlns.com/foaf/0.1/> > SELECT ?s ?p WHERE { ?class rdfs:subClassOf foaf:Document } > > > How can I re-direct the following URIs to my local datasets to run queries > over them? > > PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > PREFIX foaf: <http://xmlns.com/foaf/0.1/> > PREFIX dc: <http://purl.org/dc/elements/1.1/> > PREFIX dcterms: <http://purl.org/dc/terms/> > > Is Pubby able to map all the above URIs? If not so, is there any other > server you advise to use instead of Pubby? > > I appreciate any help in advance > > Regards, > Fahad |
From: Fahad A. <fal...@gm...> - 2010-12-15 12:48:29
|
Hi, I'm trying to use the Semantic Web Client Library to query my own datasets that stored in a control environment. I used Pubby to translate the orginal URIs to my environment URIs to run the SPARQL queries over datasets easily. SWCILib runs queries that included my environment URIs properly but can not run queries that do not have my environment URIs. For example: This query run properly: PREFIX news: <http://localhost:8080/newspaper/vocabulary/news/> SELECT ?s ?p WHERE { ?s ?p news:article } But with this query, SWCILib can not point URIs to things in my own environment: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?s ?p WHERE { ?class rdfs:subClassOf foaf:Document } How can I re-direct the following URIs to my local datasets to run queries over them? PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX dcterms: <http://purl.org/dc/terms/> Is Pubby able to map all the above URIs? If not so, is there any other server you advise to use instead of Pubby? I appreciate any help in advance Regards, Fahad |
From: Cristina S. <csa...@vi...> - 2010-10-04 09:56:17
|
Thanks for the info, Olaf. Kind regards, Cristina 2010/10/3 Olaf Hartig <ha...@in...> > Hello Cristina, > > On Monday 20 September 2010 15:38:33 you wrote: > > Dear Olaf, > > > > Thanks a lot for your prompt response. I understand now why this happens. > > > > I have enabled the SemanticWebClientConfig.ENABLE_SINDICE parameter, and > > executed several queries but I still get results from only the foaf > > implementation. Could you please give me an example where the Sindice > > configuration provides more information? > > It works with the second query from your initial mail; i.e. that one: > > PREFIX foaf: <http://xmlns.com/foaf/0.1/> > SELECT ?i ?p WHERE { > ?i ?p foaf:Person . > } > > You may have to increase the number of maximal depth of link following a > bit. > If I execute the query without Sindice support --e.g. using the command > line > call > > bin/semwebquery --maxsteps 5 --sparqlfile query.rq > > where 'query.rq' contains the query-- then I get a result that originate > from > the FOAF vocabulary definition only. However, if I enable Sindice support > > bin/semwebquery --maxsteps 5 --sindice --sparqlfile query.rq > > then I get loads of results from peoples' FOAF profiles. The same should be > possible if you use SWClLib as a library in your Java code. > > Greetings, > Olaf > |
From: Olaf H. <ha...@in...> - 2010-10-03 12:52:21
|
Hello Cristina, On Monday 20 September 2010 15:38:33 you wrote: > Dear Olaf, > > Thanks a lot for your prompt response. I understand now why this happens. > > I have enabled the SemanticWebClientConfig.ENABLE_SINDICE parameter, and > executed several queries but I still get results from only the foaf > implementation. Could you please give me an example where the Sindice > configuration provides more information? It works with the second query from your initial mail; i.e. that one: PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?i ?p WHERE { ?i ?p foaf:Person . } You may have to increase the number of maximal depth of link following a bit. If I execute the query without Sindice support --e.g. using the command line call bin/semwebquery --maxsteps 5 --sparqlfile query.rq where 'query.rq' contains the query-- then I get a result that originate from the FOAF vocabulary definition only. However, if I enable Sindice support bin/semwebquery --maxsteps 5 --sindice --sparqlfile query.rq then I get loads of results from peoples' FOAF profiles. The same should be possible if you use SWClLib as a library in your Java code. Greetings, Olaf |
From: Kai K. <ku...@on...> - 2010-09-30 13:14:43
|
It works! Thx, Kai Am 30.09.2010 12:55, schrieb Blom, J.J.C. (Jaap): > Hello Kai, > > For the first part (From named) you are correct, you should use a second NamedGraphSet which is a subset of the original. There is a way to specify multiple default graphs, but I haven't tried it so don't know if it works. You'll need another NamedGraphSet (next to the one with all the data) which contains the named graphs that you want as default graphs. Then you create the NamedGraphDataSet with the NamedGraphDataSet(NamedGraphSet, Graph). As parameters for that you should use the orignal NamedGraphSet and the default graphs NamedGraphSet as Jena graph (default.asJenaGraph(null)). I haven't tried this, so I'm not sure it will work but I think it should (according to the documentation). > > With kind regards, > Jaap Blom > > > > > -----Original Message----- > From: Kai Kühn [mailto:ku...@on...] > Sent: donderdag 30 september 2010 12:09 > To: Blom, J.J.C. (Jaap) > Cc: ng4...@li... > Subject: Re: [namedgraphs] Problem with ASK queries > > > Hello Jaap, > > Thank you. That helps. But that means I have to put the FROM NAMED graphs manually from the query to the NamedGraphDataset, right? And what about FROM statements? I can only specify one default graph via API but I can write many FROM statements. > > Best, > Kai > > Am 29.09.2010 12:48, schrieb Blom, J.J.C. (Jaap): >> Hello Kai, >> >> Recently I dived into this situation and if I recalled correctly this is correct. NG4J per default disregards the default graph in the query. I can only assume this is because of the assumption that because you send it to a dataset the graphs that are needed are already there. >> >> The good news is that it is possible to instruct NG4J to treat one graph as the default graph. You can do that by using the de.fuberlin.wiwiss.ng4j.sparql.NamedGraphDataset.NamedGraphDataset(NamedGraphSet, Node) constructor. >> >> >> With kind regards, >> Jaap Blom >> >> >> -----Original Message----- >> From: Kai Kühn [mailto:ku...@on...] >> Sent: woensdag 29 september 2010 11:19 >> To: ng4...@li... >> Subject: [namedgraphs] Problem with ASK queries >> >> hi all, >> >> I have a problem with SPARQL/ASK queries. I insert a triple (s,p,o) into graph A. Then I do the following query : >> >> ASK FROM<B> WHERE { s p o. } >> >> It returns true although the triple is in graph A not B. Same hold for: >> >> ASK FROM NAMED<B> WHERE { s p o. } >> >> Can anyone reproduce this? Is it a bug? >> >> Best, >> Kai >> >> -- >> Kai Kühn >> Halo Team >> ontoprise GmbH - know how to use Know-how >> - - - >> Halo Extension - Want to get involved? >> http://smwforum.ontoprise.com/development >> - - - >> An der RaumFabrik 29; 76227 Karlsruhe; Germany >> Tel.: +49 721 509809-48; Fax: +49 721 509809-11 >> email: ku...@on..., www: http://www.ontoprise.com Registered >> Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. >> Jürgen Angele, Hans-Peter Schnurr >> - - - >> >> >> >> ---------------------------------------------------------------------- >> -------- Start uncovering the many advantages of virtual appliances >> and start using them to simplify application deployment and accelerate >> your shift to cloud computing. >> http://p.sf.net/sfu/novell-sfdev2dev >> _______________________________________________ >> ng4j-namedgraphs mailing list >> ng4...@li... >> https://lists.sourceforge.net/lists/listinfo/ng4j-namedgraphs >> >> http://www.croon.nl/disclaimer >> http://www.croon.nl/inkoopvoorwaarden >> Kamer van Koophandel Rotterdam nr. / Chamber of Commerce Rotterdam >> no.: 24002312 > > -- > Kai Kühn > Halo Team > ontoprise GmbH - know how to use Know-how > - - - > Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development > - - - > An der RaumFabrik 29; 76227 Karlsruhe; Germany > Tel.: +49 721 509809-48; Fax: +49 721 509809-11 > email: ku...@on..., www: http://www.ontoprise.com Registered Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr > - - - > > > > http://www.croon.nl/disclaimer > http://www.croon.nl/inkoopvoorwaarden > Kamer van Koophandel Rotterdam nr. / Chamber of Commerce Rotterdam no.: 24002312 -- Kai Kühn Halo Team ontoprise GmbH – know how to use Know-how - - - Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development - - - An der RaumFabrik 29; 76227 Karlsruhe; Germany Tel.: +49 721 509809-48; Fax: +49 721 509809-11 email: ku...@on..., www: http://www.ontoprise.com Registered Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr - - - |
From: Blom, J.J.C. (Jaap) <jb...@cr...> - 2010-09-30 10:55:52
|
Hello Kai, For the first part (From named) you are correct, you should use a second NamedGraphSet which is a subset of the original. There is a way to specify multiple default graphs, but I haven't tried it so don't know if it works. You'll need another NamedGraphSet (next to the one with all the data) which contains the named graphs that you want as default graphs. Then you create the NamedGraphDataSet with the NamedGraphDataSet(NamedGraphSet, Graph). As parameters for that you should use the orignal NamedGraphSet and the default graphs NamedGraphSet as Jena graph (default.asJenaGraph(null)). I haven't tried this, so I'm not sure it will work but I think it should (according to the documentation). With kind regards, Jaap Blom -----Original Message----- From: Kai Kühn [mailto:ku...@on...] Sent: donderdag 30 september 2010 12:09 To: Blom, J.J.C. (Jaap) Cc: ng4...@li... Subject: Re: [namedgraphs] Problem with ASK queries Hello Jaap, Thank you. That helps. But that means I have to put the FROM NAMED graphs manually from the query to the NamedGraphDataset, right? And what about FROM statements? I can only specify one default graph via API but I can write many FROM statements. Best, Kai Am 29.09.2010 12:48, schrieb Blom, J.J.C. (Jaap): > Hello Kai, > > Recently I dived into this situation and if I recalled correctly this is correct. NG4J per default disregards the default graph in the query. I can only assume this is because of the assumption that because you send it to a dataset the graphs that are needed are already there. > > The good news is that it is possible to instruct NG4J to treat one graph as the default graph. You can do that by using the de.fuberlin.wiwiss.ng4j.sparql.NamedGraphDataset.NamedGraphDataset(NamedGraphSet, Node) constructor. > > > With kind regards, > Jaap Blom > > > -----Original Message----- > From: Kai Kühn [mailto:ku...@on...] > Sent: woensdag 29 september 2010 11:19 > To: ng4...@li... > Subject: [namedgraphs] Problem with ASK queries > > hi all, > > I have a problem with SPARQL/ASK queries. I insert a triple (s,p,o) into graph A. Then I do the following query : > > ASK FROM<B> WHERE { s p o. } > > It returns true although the triple is in graph A not B. Same hold for: > > ASK FROM NAMED<B> WHERE { s p o. } > > Can anyone reproduce this? Is it a bug? > > Best, > Kai > > -- > Kai Kühn > Halo Team > ontoprise GmbH - know how to use Know-how > - - - > Halo Extension - Want to get involved? > http://smwforum.ontoprise.com/development > - - - > An der RaumFabrik 29; 76227 Karlsruhe; Germany > Tel.: +49 721 509809-48; Fax: +49 721 509809-11 > email: ku...@on..., www: http://www.ontoprise.com Registered > Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. > Jürgen Angele, Hans-Peter Schnurr > - - - > > > > ---------------------------------------------------------------------- > -------- Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and accelerate > your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > ng4j-namedgraphs mailing list > ng4...@li... > https://lists.sourceforge.net/lists/listinfo/ng4j-namedgraphs > > http://www.croon.nl/disclaimer > http://www.croon.nl/inkoopvoorwaarden > Kamer van Koophandel Rotterdam nr. / Chamber of Commerce Rotterdam > no.: 24002312 -- Kai Kühn Halo Team ontoprise GmbH - know how to use Know-how - - - Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development - - - An der RaumFabrik 29; 76227 Karlsruhe; Germany Tel.: +49 721 509809-48; Fax: +49 721 509809-11 email: ku...@on..., www: http://www.ontoprise.com Registered Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr - - - http://www.croon.nl/disclaimer http://www.croon.nl/inkoopvoorwaarden Kamer van Koophandel Rotterdam nr. / Chamber of Commerce Rotterdam no.: 24002312 |
From: Kai K. <ku...@on...> - 2010-09-30 10:09:25
|
Hello Jaap, Thank you. That helps. But that means I have to put the FROM NAMED graphs manually from the query to the NamedGraphDataset, right? And what about FROM statements? I can only specify one default graph via API but I can write many FROM statements. Best, Kai Am 29.09.2010 12:48, schrieb Blom, J.J.C. (Jaap): > Hello Kai, > > Recently I dived into this situation and if I recalled correctly this is correct. NG4J per default disregards the default graph in the query. I can only assume this is because of the assumption that because you send it to a dataset the graphs that are needed are already there. > > The good news is that it is possible to instruct NG4J to treat one graph as the default graph. You can do that by using the de.fuberlin.wiwiss.ng4j.sparql.NamedGraphDataset.NamedGraphDataset(NamedGraphSet, Node) constructor. > > > With kind regards, > Jaap Blom > > > -----Original Message----- > From: Kai Kühn [mailto:ku...@on...] > Sent: woensdag 29 september 2010 11:19 > To: ng4...@li... > Subject: [namedgraphs] Problem with ASK queries > > hi all, > > I have a problem with SPARQL/ASK queries. I insert a triple (s,p,o) into graph A. Then I do the following query : > > ASK FROM<B> WHERE { s p o. } > > It returns true although the triple is in graph A not B. Same hold for: > > ASK FROM NAMED<B> WHERE { s p o. } > > Can anyone reproduce this? Is it a bug? > > Best, > Kai > > -- > Kai Kühn > Halo Team > ontoprise GmbH - know how to use Know-how > - - - > Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development > - - - > An der RaumFabrik 29; 76227 Karlsruhe; Germany > Tel.: +49 721 509809-48; Fax: +49 721 509809-11 > email: ku...@on..., www: http://www.ontoprise.com Registered Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr > - - - > > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > ng4j-namedgraphs mailing list > ng4...@li... > https://lists.sourceforge.net/lists/listinfo/ng4j-namedgraphs > > http://www.croon.nl/disclaimer > http://www.croon.nl/inkoopvoorwaarden > Kamer van Koophandel Rotterdam nr. / Chamber of Commerce Rotterdam no.: 24002312 -- Kai Kühn Halo Team ontoprise GmbH – know how to use Know-how - - - Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development - - - An der RaumFabrik 29; 76227 Karlsruhe; Germany Tel.: +49 721 509809-48; Fax: +49 721 509809-11 email: ku...@on..., www: http://www.ontoprise.com Registered Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr - - - |
From: Tim P. <ti...@pa...> - 2010-09-29 18:24:47
|
Hi Jennifer, On 28 September 2010 17:37, Jennifer Cormier wrote: > Here’s an update on the some of the recent improvements to NG4J HEAD. (This > doesn’t include what Olaf has been doing.) I can't remeber if I told anyone, but I setup two CI jobs a while ago: http://hudson.paneris.net/job/ng4j/ http://hudson.paneris.net/job/ng4j_ant/ both passing for HEAD. cheers Tim -- Tim Pizey http://pizey.net/~timp |
From: Asheesh L. <ng...@as...> - 2010-09-29 16:17:51
|
On Tue, 28 Sep 2010, Jennifer Cormier wrote: > Here's an update on the some of the recent improvements to NG4J HEAD. > (This doesn't include what Olaf has been doing.) > > > > . Regarding the memory leak reported by Graeme Stevenson: Code has > been changed (as described in the message sent August 26, 2010) to use a > com.sun.rowset.CachedRowSet to capture the contents of the ResultSet so > that the ResultSet can be cleaned up. This fixes issues I saw when making > other changes to the database code. Graeme - please report back if you > test against NG4J HEAD - we'd be most appreciative to know whether this > resolves that memory leak you observed. Well, it fixes the problem *we* were having! Yippee! As to the rest of the email -- sounds great. Ship it. (-: -- Asheesh. -- Q: Why did the astrophysicist order three hamburgers? A: Because he was hungry. |
From: John I. <joh...@uk...> - 2010-09-29 12:04:59
|
I'm starting to use the NG4J api and trying to understand some of the more detailed parts. I have a set of 216 testcases that I want to add to a model - each testcase being a different NamedGraph. I've created the NamedGraphSet and can create each of the NamedGraphs. I now want to add Resources to the graph. Looking at the API I can construct a Jena model view of the NamedGraphSet. How can I then add Resources to a NamedGraph through the Jena model view ? Do I use the NamedGraphModel.getResource(String, Resource) method where the String identifies the NamedGraph and the Resource is the Resource within that Graph ? Regards, John Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU |
From: Blom, J.J.C. (Jaap) <jb...@cr...> - 2010-09-29 11:01:18
|
Hello Kai, Recently I dived into this situation and if I recalled correctly this is correct. NG4J per default disregards the default graph in the query. I can only assume this is because of the assumption that because you send it to a dataset the graphs that are needed are already there. The good news is that it is possible to instruct NG4J to treat one graph as the default graph. You can do that by using the de.fuberlin.wiwiss.ng4j.sparql.NamedGraphDataset.NamedGraphDataset(NamedGraphSet, Node) constructor. With kind regards, Jaap Blom -----Original Message----- From: Kai Kühn [mailto:ku...@on...] Sent: woensdag 29 september 2010 11:19 To: ng4...@li... Subject: [namedgraphs] Problem with ASK queries hi all, I have a problem with SPARQL/ASK queries. I insert a triple (s,p,o) into graph A. Then I do the following query : ASK FROM <B> WHERE { s p o. } It returns true although the triple is in graph A not B. Same hold for: ASK FROM NAMED <B> WHERE { s p o. } Can anyone reproduce this? Is it a bug? Best, Kai -- Kai Kühn Halo Team ontoprise GmbH - know how to use Know-how - - - Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development - - - An der RaumFabrik 29; 76227 Karlsruhe; Germany Tel.: +49 721 509809-48; Fax: +49 721 509809-11 email: ku...@on..., www: http://www.ontoprise.com Registered Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr - - - ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ ng4j-namedgraphs mailing list ng4...@li... https://lists.sourceforge.net/lists/listinfo/ng4j-namedgraphs http://www.croon.nl/disclaimer http://www.croon.nl/inkoopvoorwaarden Kamer van Koophandel Rotterdam nr. / Chamber of Commerce Rotterdam no.: 24002312 |
From: Kai K. <ku...@on...> - 2010-09-29 09:19:28
|
hi all, I have a problem with SPARQL/ASK queries. I insert a triple (s,p,o) into graph A. Then I do the following query : ASK FROM <B> WHERE { s p o. } It returns true although the triple is in graph A not B. Same hold for: ASK FROM NAMED <B> WHERE { s p o. } Can anyone reproduce this? Is it a bug? Best, Kai -- Kai Kühn Halo Team ontoprise GmbH – know how to use Know-how - - - Halo Extension - Want to get involved? http://smwforum.ontoprise.com/development - - - An der RaumFabrik 29; 76227 Karlsruhe; Germany Tel.: +49 721 509809-48; Fax: +49 721 509809-11 email: ku...@on..., www: http://www.ontoprise.com Registered Office: Karlsruhe, Germany, HRB 109540 Managing Directors: Prof. Dr. Jürgen Angele, Hans-Peter Schnurr - - - |
From: Jennifer C. <jen...@at...> - 2010-09-28 16:37:32
|
Here's an update on the some of the recent improvements to NG4J HEAD. (This doesn't include what Olaf has been doing.) . Regarding the memory leak reported by Graeme Stevenson: Code has been changed (as described in the message sent August 26, 2010) to use a com.sun.rowset.CachedRowSet to capture the contents of the ResultSet so that the ResultSet can be cleaned up. This fixes issues I saw when making other changes to the database code. Graeme - please report back if you test against NG4J HEAD - we'd be most appreciative to know whether this resolves that memory leak you observed. . In addition to applying the PreparedStatement patch supplied by Asheesh Laroia/ Creative Commons, much more of the database-related code has been updated to use PreparedStatements. . JUnit Tests: It is now even simpler to switch which database is used when the NG4J JUnit tests are run. It turns out that the problems in running the NG4J test code against an Oracle database were due to the version of Oracle. Based on what I've read online and experienced, Oracle 10g Express is buggy. So NG4J will simply not support Oracle 10g Express. (Newer versions of Oracle do not include an "Express" version.) The NG4J tests do work against Oracle 11g. Right now the tests run by default against the HSQLDB database (in-memory version); a driver for that is included with NG4J. Currently NG4J is also shipped with an old MySQL database driver. I propose that we remove that MySQL library. However we might consider adding the library containing the Apache Derby database driver since Derby now includes an in-memory version. We could even modify the test code to repeat the database-related tests (i.e. run once against HSQLDB and once against Apache Derby) - providing an even better sanity-check - without the need for a database to be installed. Jennifer |
From: Jennifer C. <jen...@at...> - 2010-09-23 14:13:53
|
Hi John, The short answer is, no, as far as I know, that's not supported. This came up briefly on the mailing list earlier this year: On Tue, 12 Jan 2010, Jennifer Cormier wrote: > I remember looking into the "named graphs" feature of the Jena TDB > release last year. Based on what I recall, it was quite different > from NG4J's implementation. Individual graphs are stored separately > and must be loaded individually. > > In the NG4J implementation, a quad store is used so that each triple > is associated with a 4th item, that being the graph name. It is > possible to search using SPARQL over an entire dataset, across graphs, > and get only those quads of interest, whether or not they are in the same graph. I may have misremembered, or misunderstood the details of Jena TBD; I've never used it, and it's been a while since I looked at the documentation. If it's possible to use them together, I expect it would take some work. (Unless, e.g., only 1 named graph is being used.) Getting NG4J to work with a Jena TDB backend (as an alternative to the databases currently supported by NG4J) is something I'm interested in also and would be happy to discuss further. Anyone familiar with Jena TDB? Jennifer From: John Ibbotson [mailto:joh...@uk...] Sent: Thursday, September 23, 2010 9:56 AM To: ng4...@li... Subject: [namedgraphs] A beginner's question I'm interested in using the NG4J API with Jena TDB. Is this supported ? Regards, John John Ibbotson PhD CEng FIET Master Inventor ITA Project, Emerging Technology Services Hursley Park, MP137, Winchester, Hants. SO21 2JN, UK Tel: +44 1962 815188 Email: joh...@uk... ITA: <http://www.usukita.org/> http://www.usukita.org Technical Solutions to business problems that require innovation across IBM knowledge portfolio. "A doctor can bury his mistakes but an architect can only advise his clients to plant vines." Frank Lloyd Wright _____ Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU |
From: John I. <joh...@uk...> - 2010-09-23 13:54:05
|
I'm interested in using the NG4J API with Jena TDB. Is this supported ? Regards, John John Ibbotson PhD CEng FIET Master Inventor ITA Project, Emerging Technology Services Hursley Park, MP137, Winchester, Hants. SO21 2JN, UK Tel: +44 1962 815188 Email: joh...@uk... ITA: http://www.usukita.org Technical Solutions to business problems that require innovation across IBM knowledge portfolio. "A doctor can bury his mistakes but an architect can only advise his clients to plant vines." Frank Lloyd Wright Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU |
From: Cristina S. <csa...@vi...> - 2010-09-20 14:38:43
|
Dear Olaf, Thanks a lot for your prompt response. I understand now why this happens. I have enabled the SemanticWebClientConfig.ENABLE_SINDICE parameter, and executed several queries but I still get results from only the foaf implementation. Could you please give me an example where the Sindice configuration provides more information? Kind regards, Cristina 2010/9/20 Olaf Hartig <ha...@in...> > Hello Cristina, > > On Monday 20 September 2010 07:52:55 Cristina Sarasua wrote: > > Hi, > > > > I would like to ask something about the Semantic Web Client Library. > > > > I've been executing some SPARQL queries using the code specified in [1]. > > > > With the following query: > > > > String queryString = > > "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + > > "SELECT ?i ?p WHERE {" + > > "?i ?p <http://www.w3.org/People/Berners-Lee/card#i> . " + > > "}"; > > > > I get resources from different sources. > > > > But, with this query: > > > > String queryString = > > "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + > > "SELECT ?i ?p WHERE {" + > > "?i ?p foaf:Person . " + > > "}"; > > > > all the results belong to the same source - the document where foaf is > > implemented. > > That's a result of the way the SWClLib executes queries. It uses a new > approach for query execution which we call link traversal based query > execution. The SWClLib Web site outlines the idea of this approach. Did > you read how this approach works? > You find a more detailed description of this approach in my paper at > ISWC 2009. > > So, what the query engine does for your example query is the following: > Given > we start with an empty queried dataset (a.k.a. cache). SWClLib looks up the > URI for foaf:Person, retrieves the RDF graph that defines the FOAF > vocabulary, > and adds this graph to the queried dataset. Now it tries to find RDF > triples in > the queried dataset that match the triple pattern in your query. That's > only > triples from the FOAF vocab graph (because that's the only one we have). > The > FOAF vocab graph does not contain RDF links that SWClLib can follow (where > "following" here means looking up URIs to retrieve further RD graphs). > Hence, > SWClLib cannot discover more data. That's always a problem with this query > approach when the query contains only URIs for vocabulary terms (or t-Box > concepts as you call them) but no URIs for individual things (i.e. > instances > of classes defined in vocabularies). > > Notice, however, that I added Sindice support to the SWClLib. With Sindice > support enabled the SWClLib does not only look up URI (using the HTTP > protocol) but it also queries the Sindice search engine for additional RDF > graphs that contain RDF triples with the URI. This practice may give you > more > results for your second query. But, it's very expensive in terms of query > execution time. Therefore, Sindice support is disabled by default. The Web > site documents how to enable it. > > > I wonder whether the Semantic Web Client Library does not retrieve > > resources from different sources when querying about T-Box, or whether > > this is just a coincidence. > > It's not about t-Box or a-Box. To the SWClLib everything are just RDF > graphs, > SWClLib does not do any kind of reasoning. > > Greetings, > Olaf > > > Thanks in advance. > > > > Kind regards, > > > > Cristina > > > > [1] http://www4.wiwiss.fu-berlin.de/bizer/ng4j/semwebclient/#using > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > ng4j-namedgraphs mailing list > ng4...@li... > https://lists.sourceforge.net/lists/listinfo/ng4j-namedgraphs > |
From: Olaf H. <ha...@in...> - 2010-09-20 07:57:39
|
Hello Cristina, On Monday 20 September 2010 07:52:55 Cristina Sarasua wrote: > Hi, > > I would like to ask something about the Semantic Web Client Library. > > I've been executing some SPARQL queries using the code specified in [1]. > > With the following query: > > String queryString = > "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + > "SELECT ?i ?p WHERE {" + > "?i ?p <http://www.w3.org/People/Berners-Lee/card#i> . " + > "}"; > > I get resources from different sources. > > But, with this query: > > String queryString = > "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + > "SELECT ?i ?p WHERE {" + > "?i ?p foaf:Person . " + > "}"; > > all the results belong to the same source - the document where foaf is > implemented. That's a result of the way the SWClLib executes queries. It uses a new approach for query execution which we call link traversal based query execution. The SWClLib Web site outlines the idea of this approach. Did you read how this approach works? You find a more detailed description of this approach in my paper at ISWC 2009. So, what the query engine does for your example query is the following: Given we start with an empty queried dataset (a.k.a. cache). SWClLib looks up the URI for foaf:Person, retrieves the RDF graph that defines the FOAF vocabulary, and adds this graph to the queried dataset. Now it tries to find RDF triples in the queried dataset that match the triple pattern in your query. That's only triples from the FOAF vocab graph (because that's the only one we have). The FOAF vocab graph does not contain RDF links that SWClLib can follow (where "following" here means looking up URIs to retrieve further RD graphs). Hence, SWClLib cannot discover more data. That's always a problem with this query approach when the query contains only URIs for vocabulary terms (or t-Box concepts as you call them) but no URIs for individual things (i.e. instances of classes defined in vocabularies). Notice, however, that I added Sindice support to the SWClLib. With Sindice support enabled the SWClLib does not only look up URI (using the HTTP protocol) but it also queries the Sindice search engine for additional RDF graphs that contain RDF triples with the URI. This practice may give you more results for your second query. But, it's very expensive in terms of query execution time. Therefore, Sindice support is disabled by default. The Web site documents how to enable it. > I wonder whether the Semantic Web Client Library does not retrieve > resources from different sources when querying about T-Box, or whether > this is just a coincidence. It's not about t-Box or a-Box. To the SWClLib everything are just RDF graphs, SWClLib does not do any kind of reasoning. Greetings, Olaf > Thanks in advance. > > Kind regards, > > Cristina > > [1] http://www4.wiwiss.fu-berlin.de/bizer/ng4j/semwebclient/#using |
From: Cristina S. <csa...@vi...> - 2010-09-20 06:54:54
|
Hi, I would like to ask something about the Semantic Web Client Library. I've been executing some SPARQL queries using the code specified in [1]. With the following query: String queryString = "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + "SELECT ?i ?p WHERE {" + "?i ?p <http://www.w3.org/People/Berners-Lee/card#i> . " + "}"; I get resources from different sources. But, with this query: String queryString = "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + "SELECT ?i ?p WHERE {" + "?i ?p foaf:Person . " + "}"; all the results belong to the same source - the document where foaf is implemented. I wonder whether the Semantic Web Client Library does not retrieve resources from different sources when querying about T-Box, or whether this is just a coincidence. Thanks in advance. Kind regards, Cristina [1] http://www4.wiwiss.fu-berlin.de/bizer/ng4j/semwebclient/#using |
From: 'Asheesh L. <ng...@as...> - 2010-09-16 17:29:54
|
On Thu, 16 Sep 2010, Jennifer Cormier wrote: > This patch has been applied to the NG4J source code. > > Asheesh did some testing with MySQL and Apache Derby; I inspected the code > and ran the NG4J tests with HSQLDB (in-memory), Apache Derby, PostgreSQL, > and Oracle Express. > > For HSQLDB there were no failures/errors. > > For Apache Derby and PostgreSQL, there was a failure/error which was fixed > by the patch, so with the patch no problems. > > For Oracle there were almost identical failures/errors both without and > with the patch. So that needs to be fixed. It appears that after one of > the failure/errors, the tables are deleted which causes the remaining > tests to fail. In running other tests which execute the NG4J database > code, there were "maximum open cursors exceeded" type errors, probably due > to ResultSet's not all being closed. Oh, boy. Those should get fixed. They probably explain the memory leak-type errors we are seeing. > Anyone have an opinion about using com.sun.rowset.CachedRowSet so that > ResultSet's can be closed, or other suggestions for the memory leak > issue identified by Graeme Stevenson? I'll check out the latest CVS... -- Asheesh. |
From: Jennifer C. <jen...@at...> - 2010-09-16 13:22:56
|
This patch has been applied to the NG4J source code. Asheesh did some testing with MySQL and Apache Derby; I inspected the code and ran the NG4J tests with HSQLDB (in-memory), Apache Derby, PostgreSQL, and Oracle Express. For HSQLDB there were no failures/errors. For Apache Derby and PostgreSQL, there was a failure/error which was fixed by the patch, so with the patch no problems. For Oracle there were almost identical failures/errors both without and with the patch. So that needs to be fixed. It appears that after one of the failure/errors, the tables are deleted which causes the remaining tests to fail. In running other tests which execute the NG4J database code, there were "maximum open cursors exceeded" type errors, probably due to ResultSet's not all being closed. Anyone have an opinion about using com.sun.rowset.CachedRowSet so that ResultSet's can be closed, or other suggestions for the memory leak issue identified by Graeme Stevenson? Jennifer -----Original Message----- From: Asheesh Laroia [mailto:ng...@as...] Sent: Monday, September 13, 2010 2:01 PM To: Jennifer Cormier Cc: ng4...@li... Subject: Re: [namedgraphs] SQL escaping bug found (and fixed) On Mon, 13 Sep 2010, Asheesh Laroia wrote: > I've only actually tested Derby yet, but once I finish cleaning up the > patches for y'all I expect I'll have test it against MySQL also. We > don't have the other ones set up here, so your sanity check will be > crucial. I just tested MySQL, and it works fine (as expected). https://sourceforge.net/tracker/?func=detail&aid=3065437&group_id=118754&a tid=682762 tracks the patches. Thanks for your super quick, friendly reply! I wish more projects were like this. (-: -- Asheesh. -- For courage mounteth with occasion. -- William Shakespeare, "King John" |
From: Asheesh L. <ng...@as...> - 2010-09-13 18:00:56
|
On Mon, 13 Sep 2010, Asheesh Laroia wrote: > I've only actually tested Derby yet, but once I finish cleaning up the > patches for y'all I expect I'll have test it against MySQL also. We > don't have the other ones set up here, so your sanity check will be > crucial. I just tested MySQL, and it works fine (as expected). https://sourceforge.net/tracker/?func=detail&aid=3065437&group_id=118754&atid=682762 tracks the patches. Thanks for your super quick, friendly reply! I wish more projects were like this. (-: -- Asheesh. -- For courage mounteth with occasion. -- William Shakespeare, "King John" |
From: Asheesh L. <ng...@as...> - 2010-09-13 17:20:17
|
On Mon, 13 Sep 2010, Jennifer Cormier wrote: > Asheesh - thank you for your work on this. And thank you in advance to > Creative Commons for the willingness to share it back with the NG4J > community. This will be a wonderful contribution to the project! Thanks! (-: > When the patch series is prepared, please create a new entry in the > patch tracking system for NG4J at > http://sourceforge.net/tracker/?group_id=118754, and upload them there. Okay, will do. > It sounds like you have already tested this for both Apache Derby and > MySQL? In that case after inspecting the code we should do a sanity > check for each of the remaining supported databases - HSQLDB, Oracle, > and PostgreSQL. I've only actually tested Derby yet, but once I finish cleaning up the patches for y'all I expect I'll have test it against MySQL also. We don't have the other ones set up here, so your sanity check will be crucial. You'll also probably see there's room for further work in the patches, but I think these are enough of an improvement to make them worth landing. -- Asheesh. -- Always do right. This will gratify some people and astonish the rest. -- Mark Twain |
From: Nathan Y. <na...@cr...> - 2010-09-13 16:41:11
|
Just to confirm Asheesh's assertion, I'm happy to have the patches integrated with NG4J under the BSD license, and release any claims to the code Creative Commons may have. Regards, Nathan On Mon, Sep 13, 2010 at 8:56 AM, Asheesh Laroia <ng...@as...> wrote: > Dear NG4J folks, > > I'm emaiilng you with a problem we ran into, a root cause we found, a > strategy we took to fix it, and information on how we're sharing the patch > with you. > > The problem (and background) > ---------------------------- > > I'm using NG4J along with jenabean <http://code.google.com/p/jenabean/>, and > we noticed that we were sometimes getting java.sql.SQLSyntaxErrorExceptions > thrown within the NG4J code. > > You can see that in our Hudson (automat test running, AKA continuous > integration) service at > http://code.creativecommons.org/hudson/job/discovered-next/31/testReport/junit/org.creativecommons.learn/TestCuratorFeed/testURLTitleProvenance/ > > This is what it looks like. > > com.hp.hpl.jena.shared.JenaException: java.sql.SQLSyntaxErrorException: > Syntax error: Encountered "s" at line 1, column 308. > at de.fuberlin.wiwiss.ng4j.db.QuadDB.executeQuery(QuadDB.java:354) > at de.fuberlin.wiwiss.ng4j.db.QuadDB.find(QuadDB.java:108) > at de.fuberlin.wiwiss.ng4j.db.QuadDB.insert(QuadDB.java:65) > at > de.fuberlin.wiwiss.ng4j.db.NamedGraphDB.performAdd(NamedGraphDB.java:92) > at com.hp.hpl.jena.graph.impl.GraphBase.add(GraphBase.java:199) > at com.hp.hpl.jena.rdf.model.impl.ModelCom.add(ModelCom.java:923) > at > com.hp.hpl.jena.rdf.model.impl.ResourceImpl.addProperty(ResourceImpl.java:238) > at thewebsemantic.Bean2RDF.saveOrUpdate(Bean2RDF.java:188) > at thewebsemantic.Bean2RDF.write(Bean2RDF.java:176) > at thewebsemantic.Bean2RDF._write(Bean2RDF.java:137) > at thewebsemantic.Bean2RDF.write(Bean2RDF.java:130) > at thewebsemantic.Bean2RDF.saveDeep(Bean2RDF.java:116) > > ("thewebsemantic" is the namespace for jenabean. jenabean is a sort of ORM > for RDF data.) > > We use a few different backends for NG4J -- sometimes MySQL, and sometimes > Apache Derby. We noticed a few peculiar things about the exception: > > * It only happened for a particular triple we were trying to set. > * It only happened when we were using Derby -- MySQL did fine. > > We realized that the problematic triple had an apostrophe in it. This fact > plus the SQL syntax error made us suspicious of bad escaping.... > > The root cause > -------------- > > The escape() methods in QuadDB were generating SQL statements that looked > fine, like: > > INSERT ... 'Here\'s the value' ... > > The Apache Derby backend considered that invalid syntax, whereas MySQL was > happy to accept it. Frankly, it looks like valid syntax to me -- I don't > know what Derby's deal is. (-: > > Our strategy > ------------ > > These kinds of problems crop up frequently when you use strings > concatenation to generate SQL queries. So we wrote some patches that, where > it was feasible, converted QuadDb away from using an escape() function. > Instead, it uses PreparedStatements. > > PreparedStatements let you pass a query *template* to the database engine; > if I understand things right, they create a parsed syntax tree. You get to > use methods like setString() to fill in the blanks. > > (More info about PreparedStatements cane be found at > http://download.oracle.com/javase/tutorial/jdbc/basics/prepared.html and > other places.) > > By using methods like setString(), the NG4J code doesn't have to do any > escaping. Which means it can't get it wrong. (-: > > Our patches > ----------- > > We already wrote patches to address this, and tested them, and they fix our > issue. We hope you'll merge them! > > I did the work, but the copyright is held by Creative Commons because they > supported it. Nathan Yergler, the CTO of Creative Commons, will reply saying > that he permits the work to be merged into NG4J and licensed under the same > terms as the the rest of NG4J. > > I'm preparing a patch series shortly, and hopefully within the day, I'm > going to send it to the list. > > That's my thoughts -- if you need the patches reworked for some reason, let > me know. A good way to find me is to join the #discovered IRC channel on > irc.freenode.net and ping my nick, which is paulproteus. Or to just reply! > > -- Asheesh. > |
From: Jennifer C. <jen...@at...> - 2010-09-13 16:36:06
|
Asheesh - thank you for your work on this. And thank you in advance to Creative Commons for the willingness to share it back with the NG4J community. This will be a wonderful contribution to the project! When the patch series is prepared, please create a new entry in the patch tracking system for NG4J at http://sourceforge.net/tracker/?group_id=118754, and upload them there. It sounds like you have already tested this for both Apache Derby and MySQL? In that case after inspecting the code we should do a sanity check for each of the remaining supported databases - HSQLDB, Oracle, and PostgreSQL. Jennifer -----Original Message----- From: Asheesh Laroia [mailto:ng...@as...] Sent: Monday, September 13, 2010 11:57 AM To: ng4...@li... Subject: [namedgraphs] SQL escaping bug found (and fixed) Dear NG4J folks, I'm emaiilng you with a problem we ran into, a root cause we found, a strategy we took to fix it, and information on how we're sharing the patch with you. The problem (and background) ---------------------------- I'm using NG4J along with jenabean <http://code.google.com/p/jenabean/>, and we noticed that we were sometimes getting java.sql.SQLSyntaxErrorExceptions thrown within the NG4J code. You can see that in our Hudson (automat test running, AKA continuous integration) service at http://code.creativecommons.org/hudson/job/discovered-next/31/testReport/j unit/org.creativecommons.learn/TestCuratorFeed/testURLTitleProvenance/ This is what it looks like. com.hp.hpl.jena.shared.JenaException: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "s" at line 1, column 308. at de.fuberlin.wiwiss.ng4j.db.QuadDB.executeQuery(QuadDB.java:354) at de.fuberlin.wiwiss.ng4j.db.QuadDB.find(QuadDB.java:108) at de.fuberlin.wiwiss.ng4j.db.QuadDB.insert(QuadDB.java:65) at de.fuberlin.wiwiss.ng4j.db.NamedGraphDB.performAdd(NamedGraphDB.java:92) at com.hp.hpl.jena.graph.impl.GraphBase.add(GraphBase.java:199) at com.hp.hpl.jena.rdf.model.impl.ModelCom.add(ModelCom.java:923) at com.hp.hpl.jena.rdf.model.impl.ResourceImpl.addProperty(ResourceImpl.java: 238) at thewebsemantic.Bean2RDF.saveOrUpdate(Bean2RDF.java:188) at thewebsemantic.Bean2RDF.write(Bean2RDF.java:176) at thewebsemantic.Bean2RDF._write(Bean2RDF.java:137) at thewebsemantic.Bean2RDF.write(Bean2RDF.java:130) at thewebsemantic.Bean2RDF.saveDeep(Bean2RDF.java:116) ("thewebsemantic" is the namespace for jenabean. jenabean is a sort of ORM for RDF data.) We use a few different backends for NG4J -- sometimes MySQL, and sometimes Apache Derby. We noticed a few peculiar things about the exception: * It only happened for a particular triple we were trying to set. * It only happened when we were using Derby -- MySQL did fine. We realized that the problematic triple had an apostrophe in it. This fact plus the SQL syntax error made us suspicious of bad escaping.... The root cause -------------- The escape() methods in QuadDB were generating SQL statements that looked fine, like: INSERT ... 'Here\'s the value' ... The Apache Derby backend considered that invalid syntax, whereas MySQL was happy to accept it. Frankly, it looks like valid syntax to me -- I don't know what Derby's deal is. (-: Our strategy ------------ These kinds of problems crop up frequently when you use strings concatenation to generate SQL queries. So we wrote some patches that, where it was feasible, converted QuadDb away from using an escape() function. Instead, it uses PreparedStatements. PreparedStatements let you pass a query *template* to the database engine; if I understand things right, they create a parsed syntax tree. You get to use methods like setString() to fill in the blanks. (More info about PreparedStatements cane be found at http://download.oracle.com/javase/tutorial/jdbc/basics/prepared.html and other places.) By using methods like setString(), the NG4J code doesn't have to do any escaping. Which means it can't get it wrong. (-: Our patches ----------- We already wrote patches to address this, and tested them, and they fix our issue. We hope you'll merge them! I did the work, but the copyright is held by Creative Commons because they supported it. Nathan Yergler, the CTO of Creative Commons, will reply saying that he permits the work to be merged into NG4J and licensed under the same terms as the the rest of NG4J. I'm preparing a patch series shortly, and hopefully within the day, I'm going to send it to the list. That's my thoughts -- if you need the patches reworked for some reason, let me know. A good way to find me is to join the #discovered IRC channel on irc.freenode.net and ping my nick, which is paulproteus. Or to just reply! -- Asheesh. -------------------------------------------------------------------------- ---- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ ng4j-namedgraphs mailing list ng4...@li... https://lists.sourceforge.net/lists/listinfo/ng4j-namedgraphs |
From: Asheesh L. <ng...@as...> - 2010-09-13 16:13:33
|
Dear NG4J folks, I'm emaiilng you with a problem we ran into, a root cause we found, a strategy we took to fix it, and information on how we're sharing the patch with you. The problem (and background) ---------------------------- I'm using NG4J along with jenabean <http://code.google.com/p/jenabean/>, and we noticed that we were sometimes getting java.sql.SQLSyntaxErrorExceptions thrown within the NG4J code. You can see that in our Hudson (automat test running, AKA continuous integration) service at http://code.creativecommons.org/hudson/job/discovered-next/31/testReport/junit/org.creativecommons.learn/TestCuratorFeed/testURLTitleProvenance/ This is what it looks like. com.hp.hpl.jena.shared.JenaException: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "s" at line 1, column 308. at de.fuberlin.wiwiss.ng4j.db.QuadDB.executeQuery(QuadDB.java:354) at de.fuberlin.wiwiss.ng4j.db.QuadDB.find(QuadDB.java:108) at de.fuberlin.wiwiss.ng4j.db.QuadDB.insert(QuadDB.java:65) at de.fuberlin.wiwiss.ng4j.db.NamedGraphDB.performAdd(NamedGraphDB.java:92) at com.hp.hpl.jena.graph.impl.GraphBase.add(GraphBase.java:199) at com.hp.hpl.jena.rdf.model.impl.ModelCom.add(ModelCom.java:923) at com.hp.hpl.jena.rdf.model.impl.ResourceImpl.addProperty(ResourceImpl.java:238) at thewebsemantic.Bean2RDF.saveOrUpdate(Bean2RDF.java:188) at thewebsemantic.Bean2RDF.write(Bean2RDF.java:176) at thewebsemantic.Bean2RDF._write(Bean2RDF.java:137) at thewebsemantic.Bean2RDF.write(Bean2RDF.java:130) at thewebsemantic.Bean2RDF.saveDeep(Bean2RDF.java:116) ("thewebsemantic" is the namespace for jenabean. jenabean is a sort of ORM for RDF data.) We use a few different backends for NG4J -- sometimes MySQL, and sometimes Apache Derby. We noticed a few peculiar things about the exception: * It only happened for a particular triple we were trying to set. * It only happened when we were using Derby -- MySQL did fine. We realized that the problematic triple had an apostrophe in it. This fact plus the SQL syntax error made us suspicious of bad escaping.... The root cause -------------- The escape() methods in QuadDB were generating SQL statements that looked fine, like: INSERT ... 'Here\'s the value' ... The Apache Derby backend considered that invalid syntax, whereas MySQL was happy to accept it. Frankly, it looks like valid syntax to me -- I don't know what Derby's deal is. (-: Our strategy ------------ These kinds of problems crop up frequently when you use strings concatenation to generate SQL queries. So we wrote some patches that, where it was feasible, converted QuadDb away from using an escape() function. Instead, it uses PreparedStatements. PreparedStatements let you pass a query *template* to the database engine; if I understand things right, they create a parsed syntax tree. You get to use methods like setString() to fill in the blanks. (More info about PreparedStatements cane be found at http://download.oracle.com/javase/tutorial/jdbc/basics/prepared.html and other places.) By using methods like setString(), the NG4J code doesn't have to do any escaping. Which means it can't get it wrong. (-: Our patches ----------- We already wrote patches to address this, and tested them, and they fix our issue. We hope you'll merge them! I did the work, but the copyright is held by Creative Commons because they supported it. Nathan Yergler, the CTO of Creative Commons, will reply saying that he permits the work to be merged into NG4J and licensed under the same terms as the the rest of NG4J. I'm preparing a patch series shortly, and hopefully within the day, I'm going to send it to the list. That's my thoughts -- if you need the patches reworked for some reason, let me know. A good way to find me is to join the #discovered IRC channel on irc.freenode.net and ping my nick, which is paulproteus. Or to just reply! -- Asheesh. |