You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Matteo Moci <mo...@gmail.com> on 2013/02/12 18:46:38 UTC
[sparql update and in-memory testing]
Hello Everyone,
Sorry for asking so many questions, but I'm just starting to wrap my head
around the large Jena world.
I have to write SPARQL UPDATEs query to a remote fuseki instance, that I do
not control. In order to develop in a TDD way, I'd like to have tests
running on an in-memory repository, so that I am able to test my queries.
The (almost) integration tests should do something like this:
write triples
read written triples to assert write worked
delete triples
read triples again to check delete worked
I asked in the #jena irc channel, and shellac suggested to a use
SPARQLServer, but then I miss the APIs to send SPARQL queries to it.
So basically, what I need:
APIs to run an in-memory fuseki instance
APIs to send to the in-memory instance SPARQL UPDATEs and parse results
(possibly with no changes between local and remote APIs)
Thanks!
Matteo
PS: I have previous experience with Sesame, where I'd just do
final Sail sailStack = new MemoryStore();
final Repository repository = new SailRepository(sailStack);
and then get connections, do queries, etc…
--
Matteo Moci
http://it.linkedin.com/in/matteomoci
http://about.me/matteomoci/bio
Re: loading data into different graphs
Posted by Andy Seaborne <an...@apache.org>.
On 15/02/13 13:24, Stefan Scheffler wrote:
> Hi,
> As i said before the hint with the --graph option works fine. But now i
> have another problem. The proccess takes days to load the data which is
> really to long for 30GB. I suspect, this has to do with the indexing.
Could you translate that into the triple count?
The size of the store is at the start is also a factor (the depth and
span of the index trees).
> I increased the max Memory size to 20GB.
> But the procces does not getting faster. And the tdbloader2 doesn´t
> provide the --graph option.
tdblaoder2 only works from empty - it can load n-quads (as can tdbloader)
Andy
>
> Regards
> Stefan
>
>
> Am 14.02.2013 10:12, schrieb Stefan Scheffler:
>> Hey Martynas,
>> The hint with the --graph was correct.
>>
>> Thanks in advance
>> Stefan
>>
>> Am 14.02.2013 09:40, schrieb Martynas Jusevičius:
>>> Did you try tdbloader --help?
>>>
>>> It's not mentioned on the tdbloader page [1], but there should be a
>>> -graph option where you can specify named graph URI for the import.
>>>
>>> [1] http://jena.apache.org/documentation/tdb/commands.html
>>>
>>> Martynas
>>>
>>> On Thu, Feb 14, 2013 at 10:34 AM, Stefan Scheffler
>>> <ss...@avantgarde-labs.de> wrote:
>>>> Hi,
>>>> thank you for your response.
>>>> The data is in n-triple format.
>>>> My problem is, that i don´t know how to specify that the data should
>>>> be used
>>>> in a named graph. It is allways been imported in the default graph.
>>>>
>>>> Regards
>>>> Stefan
>>>> Am 14.02.2013 09:01, schrieb Martynas Jusevičius:
>>>>
>>>>> Stefan,
>>>>>
>>>>> I presume you have to use N-Quads or TriX syntax to do this in one go
>>>>> -- RDF/XML and Turtle do not support named graphs.
>>>>> Alternatively you could import one graph at a time?
>>>>>
>>>>> Martynas
>>>>> graphity.org
>>>>>
>>>>> On Thu, Feb 14, 2013 at 9:29 AM, Stefan Scheffler
>>>>> <ss...@avantgarde-labs.de> wrote:
>>>>>> Hello,
>>>>>> Is there a way to load data via tdbloader into different graphs of
>>>>>> the
>>>>>> same
>>>>>> tdb store?
>>>>>> For example.
>>>>>> I am trying to load rdf data from dbpedia and the british library.
>>>>>> I want to hold them in the same store but in two different graphs? Is
>>>>>> there
>>>>>> a way to do this with the tdbloader scripts?
>>>>>>
>>>>>> Regards
>>>>>> Stefan Scheffler
>>>>
>>>>
>>>> --
>>>> Stefan Scheffler
>>>> Avantgarde Labs GmbH
>>>> Löbauer Straße 19, 01099 Dresden
>>>> Telefon: + 49 (0) 351 21590834
>>>> Email: sscheffler@avantgarde-labs.de
>>>>
>>
>>
>
>
Re: loading data into different graphs
Posted by Stefan Scheffler <ss...@avantgarde-labs.de>.
Hi,
As i said before the hint with the --graph option works fine. But now i
have another problem. The proccess takes days to load the data which is
really to long for 30GB. I suspect, this has to do with the indexing.
I increased the max Memory size to 20GB.
But the procces does not getting faster. And the tdbloader2 doesn´t
provide the --graph option.
Regards
Stefan
Am 14.02.2013 10:12, schrieb Stefan Scheffler:
> Hey Martynas,
> The hint with the --graph was correct.
>
> Thanks in advance
> Stefan
>
> Am 14.02.2013 09:40, schrieb Martynas Jusevičius:
>> Did you try tdbloader --help?
>>
>> It's not mentioned on the tdbloader page [1], but there should be a
>> -graph option where you can specify named graph URI for the import.
>>
>> [1] http://jena.apache.org/documentation/tdb/commands.html
>>
>> Martynas
>>
>> On Thu, Feb 14, 2013 at 10:34 AM, Stefan Scheffler
>> <ss...@avantgarde-labs.de> wrote:
>>> Hi,
>>> thank you for your response.
>>> The data is in n-triple format.
>>> My problem is, that i don´t know how to specify that the data should
>>> be used
>>> in a named graph. It is allways been imported in the default graph.
>>>
>>> Regards
>>> Stefan
>>> Am 14.02.2013 09:01, schrieb Martynas Jusevičius:
>>>
>>>> Stefan,
>>>>
>>>> I presume you have to use N-Quads or TriX syntax to do this in one go
>>>> -- RDF/XML and Turtle do not support named graphs.
>>>> Alternatively you could import one graph at a time?
>>>>
>>>> Martynas
>>>> graphity.org
>>>>
>>>> On Thu, Feb 14, 2013 at 9:29 AM, Stefan Scheffler
>>>> <ss...@avantgarde-labs.de> wrote:
>>>>> Hello,
>>>>> Is there a way to load data via tdbloader into different graphs of
>>>>> the
>>>>> same
>>>>> tdb store?
>>>>> For example.
>>>>> I am trying to load rdf data from dbpedia and the british library.
>>>>> I want to hold them in the same store but in two different graphs? Is
>>>>> there
>>>>> a way to do this with the tdbloader scripts?
>>>>>
>>>>> Regards
>>>>> Stefan Scheffler
>>>
>>>
>>> --
>>> Stefan Scheffler
>>> Avantgarde Labs GmbH
>>> Löbauer Straße 19, 01099 Dresden
>>> Telefon: + 49 (0) 351 21590834
>>> Email: sscheffler@avantgarde-labs.de
>>>
>
>
--
Stefan Scheffler
Avantgarde Labs GmbH
Löbauer Straße 19, 01099 Dresden
Telefon: + 49 (0) 351 21590834
Email: sscheffler@avantgarde-labs.de
Re: loading data into different graphs
Posted by Stefan Scheffler <ss...@avantgarde-labs.de>.
Hey Martynas,
The hint with the --graph was correct.
Thanks in advance
Stefan
Am 14.02.2013 09:40, schrieb Martynas Jusevičius:
> Did you try tdbloader --help?
>
> It's not mentioned on the tdbloader page [1], but there should be a
> -graph option where you can specify named graph URI for the import.
>
> [1] http://jena.apache.org/documentation/tdb/commands.html
>
> Martynas
>
> On Thu, Feb 14, 2013 at 10:34 AM, Stefan Scheffler
> <ss...@avantgarde-labs.de> wrote:
>> Hi,
>> thank you for your response.
>> The data is in n-triple format.
>> My problem is, that i don´t know how to specify that the data should be used
>> in a named graph. It is allways been imported in the default graph.
>>
>> Regards
>> Stefan
>> Am 14.02.2013 09:01, schrieb Martynas Jusevičius:
>>
>>> Stefan,
>>>
>>> I presume you have to use N-Quads or TriX syntax to do this in one go
>>> -- RDF/XML and Turtle do not support named graphs.
>>> Alternatively you could import one graph at a time?
>>>
>>> Martynas
>>> graphity.org
>>>
>>> On Thu, Feb 14, 2013 at 9:29 AM, Stefan Scheffler
>>> <ss...@avantgarde-labs.de> wrote:
>>>> Hello,
>>>> Is there a way to load data via tdbloader into different graphs of the
>>>> same
>>>> tdb store?
>>>> For example.
>>>> I am trying to load rdf data from dbpedia and the british library.
>>>> I want to hold them in the same store but in two different graphs? Is
>>>> there
>>>> a way to do this with the tdbloader scripts?
>>>>
>>>> Regards
>>>> Stefan Scheffler
>>
>>
>> --
>> Stefan Scheffler
>> Avantgarde Labs GmbH
>> Löbauer Straße 19, 01099 Dresden
>> Telefon: + 49 (0) 351 21590834
>> Email: sscheffler@avantgarde-labs.de
>>
--
Stefan Scheffler
Avantgarde Labs GmbH
Löbauer Straße 19, 01099 Dresden
Telefon: + 49 (0) 351 21590834
Email: sscheffler@avantgarde-labs.de
Re: loading data into different graphs
Posted by Martynas Jusevičius <ma...@graphity.org>.
Did you try tdbloader --help?
It's not mentioned on the tdbloader page [1], but there should be a
-graph option where you can specify named graph URI for the import.
[1] http://jena.apache.org/documentation/tdb/commands.html
Martynas
On Thu, Feb 14, 2013 at 10:34 AM, Stefan Scheffler
<ss...@avantgarde-labs.de> wrote:
> Hi,
> thank you for your response.
> The data is in n-triple format.
> My problem is, that i don´t know how to specify that the data should be used
> in a named graph. It is allways been imported in the default graph.
>
> Regards
> Stefan
> Am 14.02.2013 09:01, schrieb Martynas Jusevičius:
>
>> Stefan,
>>
>> I presume you have to use N-Quads or TriX syntax to do this in one go
>> -- RDF/XML and Turtle do not support named graphs.
>> Alternatively you could import one graph at a time?
>>
>> Martynas
>> graphity.org
>>
>> On Thu, Feb 14, 2013 at 9:29 AM, Stefan Scheffler
>> <ss...@avantgarde-labs.de> wrote:
>>>
>>> Hello,
>>> Is there a way to load data via tdbloader into different graphs of the
>>> same
>>> tdb store?
>>> For example.
>>> I am trying to load rdf data from dbpedia and the british library.
>>> I want to hold them in the same store but in two different graphs? Is
>>> there
>>> a way to do this with the tdbloader scripts?
>>>
>>> Regards
>>> Stefan Scheffler
>
>
>
> --
> Stefan Scheffler
> Avantgarde Labs GmbH
> Löbauer Straße 19, 01099 Dresden
> Telefon: + 49 (0) 351 21590834
> Email: sscheffler@avantgarde-labs.de
>
Re: loading data into different graphs
Posted by Stefan Scheffler <ss...@avantgarde-labs.de>.
Hi,
thank you for your response.
The data is in n-triple format.
My problem is, that i don´t know how to specify that the data should be
used in a named graph. It is allways been imported in the default graph.
Regards
Stefan
Am 14.02.2013 09:01, schrieb Martynas Jusevičius:
> Stefan,
>
> I presume you have to use N-Quads or TriX syntax to do this in one go
> -- RDF/XML and Turtle do not support named graphs.
> Alternatively you could import one graph at a time?
>
> Martynas
> graphity.org
>
> On Thu, Feb 14, 2013 at 9:29 AM, Stefan Scheffler
> <ss...@avantgarde-labs.de> wrote:
>> Hello,
>> Is there a way to load data via tdbloader into different graphs of the same
>> tdb store?
>> For example.
>> I am trying to load rdf data from dbpedia and the british library.
>> I want to hold them in the same store but in two different graphs? Is there
>> a way to do this with the tdbloader scripts?
>>
>> Regards
>> Stefan Scheffler
--
Stefan Scheffler
Avantgarde Labs GmbH
Löbauer Straße 19, 01099 Dresden
Telefon: + 49 (0) 351 21590834
Email: sscheffler@avantgarde-labs.de
Re: loading data into different graphs
Posted by Martynas Jusevičius <ma...@graphity.org>.
Stefan,
I presume you have to use N-Quads or TriX syntax to do this in one go
-- RDF/XML and Turtle do not support named graphs.
Alternatively you could import one graph at a time?
Martynas
graphity.org
On Thu, Feb 14, 2013 at 9:29 AM, Stefan Scheffler
<ss...@avantgarde-labs.de> wrote:
> Hello,
> Is there a way to load data via tdbloader into different graphs of the same
> tdb store?
> For example.
> I am trying to load rdf data from dbpedia and the british library.
> I want to hold them in the same store but in two different graphs? Is there
> a way to do this with the tdbloader scripts?
>
> Regards
> Stefan Scheffler
loading data into different graphs
Posted by Stefan Scheffler <ss...@avantgarde-labs.de>.
Hello,
Is there a way to load data via tdbloader into different graphs of the
same tdb store?
For example.
I am trying to load rdf data from dbpedia and the british library.
I want to hold them in the same store but in two different graphs? Is
there a way to do this with the tdbloader scripts?
Regards
Stefan Scheffler
Re: [sparql update and in-memory testing]
Posted by Andy Seaborne <an...@apache.org>.
On 13/02/13 17:48, Rob Vesse wrote:
> One issue you may have when trying to run as you are is that the is that
> the static pages/ directory will likely not be in the right location
> (because Fuseki uses a relative path to its home directory) so you may
> need to add the --pages option with a path to the pages/ directory from
> your Fuseki instance for this to work correctly
Rob - good point - I should have noted that.
(more below on the 404)
> The other option is to set --home directory which sets the directory
> relative to which Fuseki looks for the pages/ directory
>
> You can see you get a warning about this in your log output, I'll add some
> extra log lines to make the warning more informative
>
> Rob
>
> On 2/13/13 4:30 AM, "Matteo Moci" <mo...@gmail.com> wrote:
>
>> Hello again,
>> I started the Fuseki with the following command:
>> FusekiCmd.main("--mem", "--port=" + port, "--update", "/" + dataSet);
>> and it shows the log:
>>
>> 13:21:51 INFO Dataset: in-memory
>> 13:22:06 WARN No such directory for static content: ./pages
>> 13:22:27 INFO Dataset path = /dataSet
>> 13:22:37 INFO Fuseki 0.2.5 2012-10-20T17:03:29+0100
>> 13:22:37 INFO Started 2013/02/13 13:22:37 CET on port 3030
>> 13:22:37 INFO jetty-7.6.5.v20120716
>> 13:22:37 INFO started o.e.j.s.ServletContextHandler{/,null}
>> 13:22:37 INFO Started BlockingChannelConnector@0.0.0.0:3030
>>
>> However, when I point the browser to http://localhost:3030/dataSet/
>> I get this message:
>>
>> Error 404: Not Found
>> Fuseki - version 0.2.5 (Build date: 2012-10-20T17:03:29+0100)
Try
http://localhost:3030/dataSet/sparql
the query service endpoint.
e..g
http://localhost:3030/dataSet/sparql?query=
and it should return "400 - empty query string" which means you did
contact the service.
Andy
>>
>> Is there something I missed? maybe the directory doesn't include static
>> pages for administration?
>>
>> Thanks,
>> Matteo
>>
>>
>>
>>
>> On Tue, Feb 12, 2013 at 7:49 PM, Matteo Moci <mo...@gmail.com> wrote:
>>
>>> Thanks Andy!
>>> It's quite clear, will try the first method.
>>> Best,
>>> Matteo
>>>
>>>
>>> On Tue, Feb 12, 2013 at 7:19 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>>> On 12/02/13 17:46, Matteo Moci wrote:
>>>>
>>>>> Hello Everyone,
>>>>> Sorry for asking so many questions, but I'm just starting to wrap my
>>>>> head
>>>>> around the large Jena world.
>>>>>
>>>>> I have to write SPARQL UPDATEs query to a remote fuseki instance,
>>>>> that I
>>>>> do
>>>>> not control. In order to develop in a TDD way, I'd like to have tests
>>>>> running on an in-memory repository, so that I am able to test my
>>>>> queries.
>>>>> The (almost) integration tests should do something like this:
>>>>>
>>>>> write triples
>>>>> read written triples to assert write worked
>>>>> delete triples
>>>>> read triples again to check delete worked
>>>>>
>>>>> I asked in the #jena irc channel, and shellac suggested to a use
>>>>> SPARQLServer, but then I miss the APIs to send SPARQL queries to it.
>>>>>
>>>>
>>>> I answered ....
>>>>
>>>>
>>>>
>>>>> So basically, what I need:
>>>>> APIs to run an in-memory fuseki instance
>>>>> APIs to send to the in-memory instance SPARQL UPDATEs and parse
>>>>> results
>>>>> (possibly with no changes between local and remote APIs)
>>>>>
>>>>
>>>> For testing, it is best to run a real server and use real HTTP to get
>>>> as
>>>> close to deployment as possible.
>>>>
>>>> You can do this in your java code: theer is no reaon you can't run the
>>>> command in your ject JVM.
>>>>
>>>> FusekiCmd.main("--mem, "--update", "/ds")
>>>>
>>>> (it's blocking - fork on a separate thread)
>>>>
>>>> then you are running a real Fuseki in your JVM and can access it on
>>>> http://localhost:3030.
>>>>
>>>> Alternatively: you can call
>>>>
>>>> // In-memory TDB dataset for testing.
>>>> DatasetGraph dsg = TDBFactory.createDatasetGraph(**) ;
>>>> ServerConfig serverConfig =
>>>> FusekiConfig.**defaultConfiguration(**datasetPath, dsg,
>>>> allowUpdate) ;
>>>>
>>>> SPARQLServer server = new SPARQLServer(serverConfig) ;
>>>> server.start() ;
>>>>
>>>> Both of these are then going to be accessed exactly as a deployed
>>>> system
>>>> would be, all HTTP conneg as well.
>>>>
>>>> Andy
>>>>
>>>>
>>>>
>>>>> Thanks!
>>>>> Matteo
>>>>>
>>>>> PS: I have previous experience with Sesame, where I'd just do
>>>>> final Sail sailStack = new MemoryStore();
>>>>> final Repository repository = new SailRepository(sailStack);
>>>>> and then get connections, do queries, etcŠ
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Matteo Moci
>>> http://it.linkedin.com/in/matteomoci
>>> http://about.me/matteomoci/bio
>>>
>>
>>
>>
>> --
>> Matteo Moci
>> http://it.linkedin.com/in/matteomoci
>> http://about.me/matteomoci/bio
>
Re: [sparql update and in-memory testing]
Posted by Rob Vesse <rv...@yarcdata.com>.
One issue you may have when trying to run as you are is that the is that
the static pages/ directory will likely not be in the right location
(because Fuseki uses a relative path to its home directory) so you may
need to add the --pages option with a path to the pages/ directory from
your Fuseki instance for this to work correctly
The other option is to set --home directory which sets the directory
relative to which Fuseki looks for the pages/ directory
You can see you get a warning about this in your log output, I'll add some
extra log lines to make the warning more informative
Rob
On 2/13/13 4:30 AM, "Matteo Moci" <mo...@gmail.com> wrote:
>Hello again,
>I started the Fuseki with the following command:
>FusekiCmd.main("--mem", "--port=" + port, "--update", "/" + dataSet);
>and it shows the log:
>
>13:21:51 INFO Dataset: in-memory
>13:22:06 WARN No such directory for static content: ./pages
>13:22:27 INFO Dataset path = /dataSet
>13:22:37 INFO Fuseki 0.2.5 2012-10-20T17:03:29+0100
>13:22:37 INFO Started 2013/02/13 13:22:37 CET on port 3030
>13:22:37 INFO jetty-7.6.5.v20120716
>13:22:37 INFO started o.e.j.s.ServletContextHandler{/,null}
>13:22:37 INFO Started BlockingChannelConnector@0.0.0.0:3030
>
>However, when I point the browser to http://localhost:3030/dataSet/
>I get this message:
>
>Error 404: Not Found
>Fuseki - version 0.2.5 (Build date: 2012-10-20T17:03:29+0100)
>
>Is there something I missed? maybe the directory doesn't include static
>pages for administration?
>
>Thanks,
>Matteo
>
>
>
>
>On Tue, Feb 12, 2013 at 7:49 PM, Matteo Moci <mo...@gmail.com> wrote:
>
>> Thanks Andy!
>> It's quite clear, will try the first method.
>> Best,
>> Matteo
>>
>>
>> On Tue, Feb 12, 2013 at 7:19 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>>> On 12/02/13 17:46, Matteo Moci wrote:
>>>
>>>> Hello Everyone,
>>>> Sorry for asking so many questions, but I'm just starting to wrap my
>>>>head
>>>> around the large Jena world.
>>>>
>>>> I have to write SPARQL UPDATEs query to a remote fuseki instance,
>>>>that I
>>>> do
>>>> not control. In order to develop in a TDD way, I'd like to have tests
>>>> running on an in-memory repository, so that I am able to test my
>>>>queries.
>>>> The (almost) integration tests should do something like this:
>>>>
>>>> write triples
>>>> read written triples to assert write worked
>>>> delete triples
>>>> read triples again to check delete worked
>>>>
>>>> I asked in the #jena irc channel, and shellac suggested to a use
>>>> SPARQLServer, but then I miss the APIs to send SPARQL queries to it.
>>>>
>>>
>>> I answered ....
>>>
>>>
>>>
>>>> So basically, what I need:
>>>> APIs to run an in-memory fuseki instance
>>>> APIs to send to the in-memory instance SPARQL UPDATEs and parse
>>>>results
>>>> (possibly with no changes between local and remote APIs)
>>>>
>>>
>>> For testing, it is best to run a real server and use real HTTP to get
>>>as
>>> close to deployment as possible.
>>>
>>> You can do this in your java code: theer is no reaon you can't run the
>>> command in your ject JVM.
>>>
>>> FusekiCmd.main("--mem, "--update", "/ds")
>>>
>>> (it's blocking - fork on a separate thread)
>>>
>>> then you are running a real Fuseki in your JVM and can access it on
>>> http://localhost:3030.
>>>
>>> Alternatively: you can call
>>>
>>> // In-memory TDB dataset for testing.
>>> DatasetGraph dsg = TDBFactory.createDatasetGraph(**) ;
>>> ServerConfig serverConfig =
>>> FusekiConfig.**defaultConfiguration(**datasetPath, dsg,
>>>allowUpdate) ;
>>>
>>> SPARQLServer server = new SPARQLServer(serverConfig) ;
>>> server.start() ;
>>>
>>> Both of these are then going to be accessed exactly as a deployed
>>>system
>>> would be, all HTTP conneg as well.
>>>
>>> Andy
>>>
>>>
>>>
>>>> Thanks!
>>>> Matteo
>>>>
>>>> PS: I have previous experience with Sesame, where I'd just do
>>>> final Sail sailStack = new MemoryStore();
>>>> final Repository repository = new SailRepository(sailStack);
>>>> and then get connections, do queries, etcŠ
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Matteo Moci
>> http://it.linkedin.com/in/matteomoci
>> http://about.me/matteomoci/bio
>>
>
>
>
>--
>Matteo Moci
>http://it.linkedin.com/in/matteomoci
>http://about.me/matteomoci/bio
Re: [sparql update and in-memory testing]
Posted by Matteo Moci <mo...@gmail.com>.
Hello again,
I started the Fuseki with the following command:
FusekiCmd.main("--mem", "--port=" + port, "--update", "/" + dataSet);
and it shows the log:
13:21:51 INFO Dataset: in-memory
13:22:06 WARN No such directory for static content: ./pages
13:22:27 INFO Dataset path = /dataSet
13:22:37 INFO Fuseki 0.2.5 2012-10-20T17:03:29+0100
13:22:37 INFO Started 2013/02/13 13:22:37 CET on port 3030
13:22:37 INFO jetty-7.6.5.v20120716
13:22:37 INFO started o.e.j.s.ServletContextHandler{/,null}
13:22:37 INFO Started BlockingChannelConnector@0.0.0.0:3030
However, when I point the browser to http://localhost:3030/dataSet/
I get this message:
Error 404: Not Found
Fuseki - version 0.2.5 (Build date: 2012-10-20T17:03:29+0100)
Is there something I missed? maybe the directory doesn't include static
pages for administration?
Thanks,
Matteo
On Tue, Feb 12, 2013 at 7:49 PM, Matteo Moci <mo...@gmail.com> wrote:
> Thanks Andy!
> It's quite clear, will try the first method.
> Best,
> Matteo
>
>
> On Tue, Feb 12, 2013 at 7:19 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 12/02/13 17:46, Matteo Moci wrote:
>>
>>> Hello Everyone,
>>> Sorry for asking so many questions, but I'm just starting to wrap my head
>>> around the large Jena world.
>>>
>>> I have to write SPARQL UPDATEs query to a remote fuseki instance, that I
>>> do
>>> not control. In order to develop in a TDD way, I'd like to have tests
>>> running on an in-memory repository, so that I am able to test my queries.
>>> The (almost) integration tests should do something like this:
>>>
>>> write triples
>>> read written triples to assert write worked
>>> delete triples
>>> read triples again to check delete worked
>>>
>>> I asked in the #jena irc channel, and shellac suggested to a use
>>> SPARQLServer, but then I miss the APIs to send SPARQL queries to it.
>>>
>>
>> I answered ....
>>
>>
>>
>>> So basically, what I need:
>>> APIs to run an in-memory fuseki instance
>>> APIs to send to the in-memory instance SPARQL UPDATEs and parse results
>>> (possibly with no changes between local and remote APIs)
>>>
>>
>> For testing, it is best to run a real server and use real HTTP to get as
>> close to deployment as possible.
>>
>> You can do this in your java code: theer is no reaon you can't run the
>> command in your ject JVM.
>>
>> FusekiCmd.main("--mem, "--update", "/ds")
>>
>> (it's blocking - fork on a separate thread)
>>
>> then you are running a real Fuseki in your JVM and can access it on
>> http://localhost:3030.
>>
>> Alternatively: you can call
>>
>> // In-memory TDB dataset for testing.
>> DatasetGraph dsg = TDBFactory.createDatasetGraph(**) ;
>> ServerConfig serverConfig =
>> FusekiConfig.**defaultConfiguration(**datasetPath, dsg, allowUpdate) ;
>>
>> SPARQLServer server = new SPARQLServer(serverConfig) ;
>> server.start() ;
>>
>> Both of these are then going to be accessed exactly as a deployed system
>> would be, all HTTP conneg as well.
>>
>> Andy
>>
>>
>>
>>> Thanks!
>>> Matteo
>>>
>>> PS: I have previous experience with Sesame, where I'd just do
>>> final Sail sailStack = new MemoryStore();
>>> final Repository repository = new SailRepository(sailStack);
>>> and then get connections, do queries, etc…
>>>
>>>
>>>
>>>
>>
>
>
> --
> Matteo Moci
> http://it.linkedin.com/in/matteomoci
> http://about.me/matteomoci/bio
>
--
Matteo Moci
http://it.linkedin.com/in/matteomoci
http://about.me/matteomoci/bio
Re: [sparql update and in-memory testing]
Posted by Matteo Moci <mo...@gmail.com>.
Thanks Andy!
It's quite clear, will try the first method.
Best,
Matteo
On Tue, Feb 12, 2013 at 7:19 PM, Andy Seaborne <an...@apache.org> wrote:
> On 12/02/13 17:46, Matteo Moci wrote:
>
>> Hello Everyone,
>> Sorry for asking so many questions, but I'm just starting to wrap my head
>> around the large Jena world.
>>
>> I have to write SPARQL UPDATEs query to a remote fuseki instance, that I
>> do
>> not control. In order to develop in a TDD way, I'd like to have tests
>> running on an in-memory repository, so that I am able to test my queries.
>> The (almost) integration tests should do something like this:
>>
>> write triples
>> read written triples to assert write worked
>> delete triples
>> read triples again to check delete worked
>>
>> I asked in the #jena irc channel, and shellac suggested to a use
>> SPARQLServer, but then I miss the APIs to send SPARQL queries to it.
>>
>
> I answered ....
>
>
>
>> So basically, what I need:
>> APIs to run an in-memory fuseki instance
>> APIs to send to the in-memory instance SPARQL UPDATEs and parse results
>> (possibly with no changes between local and remote APIs)
>>
>
> For testing, it is best to run a real server and use real HTTP to get as
> close to deployment as possible.
>
> You can do this in your java code: theer is no reaon you can't run the
> command in your ject JVM.
>
> FusekiCmd.main("--mem, "--update", "/ds")
>
> (it's blocking - fork on a separate thread)
>
> then you are running a real Fuseki in your JVM and can access it on
> http://localhost:3030.
>
> Alternatively: you can call
>
> // In-memory TDB dataset for testing.
> DatasetGraph dsg = TDBFactory.createDatasetGraph(**) ;
> ServerConfig serverConfig =
> FusekiConfig.**defaultConfiguration(**datasetPath, dsg, allowUpdate) ;
>
> SPARQLServer server = new SPARQLServer(serverConfig) ;
> server.start() ;
>
> Both of these are then going to be accessed exactly as a deployed system
> would be, all HTTP conneg as well.
>
> Andy
>
>
>
>> Thanks!
>> Matteo
>>
>> PS: I have previous experience with Sesame, where I'd just do
>> final Sail sailStack = new MemoryStore();
>> final Repository repository = new SailRepository(sailStack);
>> and then get connections, do queries, etc…
>>
>>
>>
>>
>
--
Matteo Moci
http://it.linkedin.com/in/matteomoci
http://about.me/matteomoci/bio
Re: [sparql update and in-memory testing]
Posted by Andy Seaborne <an...@apache.org>.
On 12/02/13 17:46, Matteo Moci wrote:
> Hello Everyone,
> Sorry for asking so many questions, but I'm just starting to wrap my head
> around the large Jena world.
>
> I have to write SPARQL UPDATEs query to a remote fuseki instance, that I do
> not control. In order to develop in a TDD way, I'd like to have tests
> running on an in-memory repository, so that I am able to test my queries.
> The (almost) integration tests should do something like this:
>
> write triples
> read written triples to assert write worked
> delete triples
> read triples again to check delete worked
>
> I asked in the #jena irc channel, and shellac suggested to a use
> SPARQLServer, but then I miss the APIs to send SPARQL queries to it.
I answered ....
>
> So basically, what I need:
> APIs to run an in-memory fuseki instance
> APIs to send to the in-memory instance SPARQL UPDATEs and parse results
> (possibly with no changes between local and remote APIs)
For testing, it is best to run a real server and use real HTTP to get as
close to deployment as possible.
You can do this in your java code: theer is no reaon you can't run the
command in your ject JVM.
FusekiCmd.main("--mem, "--update", "/ds")
(it's blocking - fork on a separate thread)
then you are running a real Fuseki in your JVM and can access it on
http://localhost:3030.
Alternatively: you can call
// In-memory TDB dataset for testing.
DatasetGraph dsg = TDBFactory.createDatasetGraph() ;
ServerConfig serverConfig =
FusekiConfig.defaultConfiguration(datasetPath, dsg, allowUpdate) ;
SPARQLServer server = new SPARQLServer(serverConfig) ;
server.start() ;
Both of these are then going to be accessed exactly as a deployed system
would be, all HTTP conneg as well.
Andy
>
> Thanks!
> Matteo
>
> PS: I have previous experience with Sesame, where I'd just do
> final Sail sailStack = new MemoryStore();
> final Repository repository = new SailRepository(sailStack);
> and then get connections, do queries, etc…
>
>
>