Re: Restarting FUSEKI with TDB and OWL reasoner

2016-09-15 Thread Andy Seaborne

I've put a fix in and the latest dev snapshot build has that in.

I've only addressed this one use case, pending some thinking about 
general situation.


Andy

On 15/09/16 11:21, Andy Seaborne wrote:

Hi Filip,

I can recreate the problem with 2.4.0 and development (2.3.1 seems to be
OK).

https://issues.apache.org/jira/browse/JENA-1236

Thank you for the complete report.   I even get the same nodeid offset
numbers which is helpful.

I don't know what's going wrong yet though the area of transaction
isolation is the place to start looking.

Andy

On 14/09/16 14:21, Filip Masri wrote:

So the thing I did is:

1. unzip apache-jena-fuseki-2.4.0.zip
2. run ./fuseki-server --mem /ds -> so the /run directory is created
(Canceled by CTRL+C, but this should not affect the final Dataset)
3. Setup init script (fuseki as attachment with HOME, BASE and CONFIG
confifurations)
4. Start the service = service fuseki start (DB database is created)
5. Upload schema file through GUI (mobilePhonesCustomClasses.ttl) to
/inf dataset
6. Try to query through GUI = 200 OK

PREFIX : 
PREFIX owl: 

Select ?s ?p ?o
WHERE {
   ?s ?p ?o .
}
order by ?p


7. service fuseki restart
8. Query again

Error 500: Invalid id node for subject (null node):
([], [0022], [0054])


Fuseki - version 2.4.0 (Build date: 2016-05-10T11:59:39+)

The attachements are the init script, my turtle data/schema to be
uploaded,
 config file for the dataset referenced in the init script.

Maybe I am doing something wrong so u will correct me :)

Thanks anyways!


2016-09-14 14:53 GMT+02:00 Andy Seaborne mailto:a...@apache.org>>:



On 14/09/16 13:39, Filip Masri wrote:

Well, I could not solve the problem with
apache-jena-fuseki-2.4.0 but
apache-jena-fuseki-2.3.1
 worked without problem.


Ouch!


Do you want me to describe the whole process I did so you could
possiby
stacktrace the problem?


Yes, please.

Andy



Filip

2016-09-14 12:11 GMT+02:00 Andy Seaborne mailto:a...@apache.org>>:

Hi Filip,

Error 500: Invalid id node for object (null node):
([3C3C], [0007AA],
[3D18])


This is usually a sign that the program exits without
sync'ing a
non-transaction TDB database.

It is possible (probably) that building the inference model
in the
assembler is not transactional.  It becomes transactional on
first request.

So has at any time in the past, not the run which caused the
500, have you
exited the server during start up (e.g. control-C) or before
the first
request to the inference model?  or another program access
the same
database?

The other possible cause is two systems trying to modify the
same database
at the same time.  TDB tries to trap this and warn you but
the test is not
perfect.  (It looks like you are on Linux so the test is
much better there
- on Windows, it has been reported that Windows update can
cause restarts
where the process id is reused quiet quickly.)

Could you please crosslink the stack overflow question to
this thread?
Thanks.

Andy



On 13/09/16 12:32, Filip Masri wrote:

Dear Jena Community,

I have a following fuseki dataset configuration:

@prefix fuseki: > .
@prefix rdf:
> .
@prefix rdfs: > .
@prefix tdb: > .
@prefix ja: > .
@prefix sdb: > .


[] a fuseki:Server ;
fuseki:services ( <#tdb> ) .


<#tdb> rdf:type fuseki:Service ;
 fuseki:name "ds" ; # http://host/inf
 fuseki:serviceQuery   "query" , "sparql" ;
 fuseki:serviceUpdate "update" ;
 fuseki:dataset <#dataset2> ; #select which set to use
 rdfs:label"TDB ds" ;
 fuseki:serviceReadGraphStore  "get" ;
 fuseki:s

Re: Restarting FUSEKI with TDB and OWL reasoner

2016-09-15 Thread Andy Seaborne

Hi Filip,

I can recreate the problem with 2.4.0 and development (2.3.1 seems to be 
OK).


https://issues.apache.org/jira/browse/JENA-1236

Thank you for the complete report.   I even get the same nodeid offset 
numbers which is helpful.


I don't know what's going wrong yet though the area of transaction 
isolation is the place to start looking.


Andy

On 14/09/16 14:21, Filip Masri wrote:

So the thing I did is:

1. unzip apache-jena-fuseki-2.4.0.zip
2. run ./fuseki-server --mem /ds -> so the /run directory is created
(Canceled by CTRL+C, but this should not affect the final Dataset)
3. Setup init script (fuseki as attachment with HOME, BASE and CONFIG
confifurations)
4. Start the service = service fuseki start (DB database is created)
5. Upload schema file through GUI (mobilePhonesCustomClasses.ttl) to
/inf dataset
6. Try to query through GUI = 200 OK

PREFIX : 
PREFIX owl: 

Select ?s ?p ?o
WHERE {
   ?s ?p ?o .
}
order by ?p


7. service fuseki restart
8. Query again

Error 500: Invalid id node for subject (null node): ([], 
[0022], [0054])


Fuseki - version 2.4.0 (Build date: 2016-05-10T11:59:39+)

The attachements are the init script, my turtle data/schema to be uploaded,
 config file for the dataset referenced in the init script.

Maybe I am doing something wrong so u will correct me :)

Thanks anyways!


2016-09-14 14:53 GMT+02:00 Andy Seaborne mailto:a...@apache.org>>:



On 14/09/16 13:39, Filip Masri wrote:

Well, I could not solve the problem with
apache-jena-fuseki-2.4.0 but
apache-jena-fuseki-2.3.1
 worked without problem.


Ouch!


Do you want me to describe the whole process I did so you could
possiby
stacktrace the problem?


Yes, please.

Andy



Filip

2016-09-14 12:11 GMT+02:00 Andy Seaborne mailto:a...@apache.org>>:

Hi Filip,

Error 500: Invalid id node for object (null node):
([3C3C], [0007AA], [3D18])


This is usually a sign that the program exits without sync'ing a
non-transaction TDB database.

It is possible (probably) that building the inference model
in the
assembler is not transactional.  It becomes transactional on
first request.

So has at any time in the past, not the run which caused the
500, have you
exited the server during start up (e.g. control-C) or before
the first
request to the inference model?  or another program access
the same
database?

The other possible cause is two systems trying to modify the
same database
at the same time.  TDB tries to trap this and warn you but
the test is not
perfect.  (It looks like you are on Linux so the test is
much better there
- on Windows, it has been reported that Windows update can
cause restarts
where the process id is reused quiet quickly.)

Could you please crosslink the stack overflow question to
this thread?
Thanks.

Andy



On 13/09/16 12:32, Filip Masri wrote:

Dear Jena Community,

I have a following fuseki dataset configuration:

@prefix fuseki: > .
@prefix rdf:
> .
@prefix rdfs: > .
@prefix tdb: > .
@prefix ja: > .
@prefix sdb: > .


[] a fuseki:Server ;
fuseki:services ( <#tdb> ) .


<#tdb> rdf:type fuseki:Service ;
 fuseki:name "ds" ; # http://host/inf
 fuseki:serviceQuery   "query" , "sparql" ;
 fuseki:serviceUpdate "update" ;
 fuseki:dataset <#dataset2> ; #select which set to use
 rdfs:label"TDB ds" ;
 fuseki:serviceReadGraphStore  "get" ;
 fuseki:serviceReadWriteGraphStore
   "data" ;
 fuseki:serviceUpload  "upload" .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
 tdb:D

Re: Restarting FUSEKI with TDB and OWL reasoner

2016-09-14 Thread Filip Masri
So the thing I did is:

1. unzip apache-jena-fuseki-2.4.0.zip
2. run ./fuseki-server --mem /ds -> so the /run directory is created
(Canceled by CTRL+C, but this should not affect the final Dataset)
3. Setup init script (fuseki as attachment with HOME, BASE and CONFIG
confifurations)
4. Start the service = service fuseki start (DB database is created)
5. Upload schema file through GUI (mobilePhonesCustomClasses.ttl) to /inf
dataset
6. Try to query through GUI = 200 OK

PREFIX : 
PREFIX owl: 

Select ?s ?p ?o
WHERE {
   ?s ?p ?o .
}
order by ?p


7. service fuseki restart
8. Query again

Error 500: Invalid id node for subject (null node):
([], [0022], [0054])


Fuseki - version 2.4.0 (Build date: 2016-05-10T11:59:39+)

The attachements are the init script, my turtle data/schema to be uploaded,
 config file for the dataset referenced in the init script.

Maybe I am doing something wrong so u will correct me :)

Thanks anyways!


2016-09-14 14:53 GMT+02:00 Andy Seaborne :

>
>
> On 14/09/16 13:39, Filip Masri wrote:
>
>> Well, I could not solve the problem with apache-jena-fuseki-2.4.0 but
>> apache-jena-fuseki-2.3.1
>>  worked without problem.
>>
>
> Ouch!
>
>
>> Do you want me to describe the whole process I did so you could possiby
>> stacktrace the problem?
>>
>
> Yes, please.
>
> Andy
>
>
>
>> Filip
>>
>> 2016-09-14 12:11 GMT+02:00 Andy Seaborne :
>>
>> Hi Filip,
>>>
>>> Error 500: Invalid id node for object (null node):
 ([3C3C], [0007AA], [3D18])

>>>
>>> This is usually a sign that the program exits without sync'ing a
>>> non-transaction TDB database.
>>>
>>> It is possible (probably) that building the inference model in the
>>> assembler is not transactional.  It becomes transactional on first
>>> request.
>>>
>>> So has at any time in the past, not the run which caused the 500, have
>>> you
>>> exited the server during start up (e.g. control-C) or before the first
>>> request to the inference model?  or another program access the same
>>> database?
>>>
>>> The other possible cause is two systems trying to modify the same
>>> database
>>> at the same time.  TDB tries to trap this and warn you but the test is
>>> not
>>> perfect.  (It looks like you are on Linux so the test is much better
>>> there
>>> - on Windows, it has been reported that Windows update can cause restarts
>>> where the process id is reused quiet quickly.)
>>>
>>> Could you please crosslink the stack overflow question to this thread?
>>> Thanks.
>>>
>>> Andy
>>>
>>>
>>>
>>> On 13/09/16 12:32, Filip Masri wrote:
>>>
>>> Dear Jena Community,

 I have a following fuseki dataset configuration:

 @prefix fuseki:  .
 @prefix rdf:  .
 @prefix rdfs:  .
 @prefix tdb:  .
 @prefix ja:  .
 @prefix sdb:  .


 [] a fuseki:Server ;
 fuseki:services ( <#tdb> ) .


 <#tdb> rdf:type fuseki:Service ;
  fuseki:name "ds" ; # http://host/inf
  fuseki:serviceQuery   "query" , "sparql" ;
  fuseki:serviceUpdate "update" ;
  fuseki:dataset <#dataset2> ; #select which set to use
  rdfs:label"TDB ds" ;
  fuseki:serviceReadGraphStore  "get" ;
  fuseki:serviceReadWriteGraphStore
"data" ;
  fuseki:serviceUpload  "upload" .

 [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
  tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
  tdb:GraphTDB rdfs:subClassOf ja:Model .

  <#dataset2> rdf:type ja:RDFDataset ;
   ja:defaultGraph <#model2> .

  <#model2> a ja:InfModel;
   ja:baseModel <#tdbGraph>;
   ja:reasoner
   [ ja:reasonerURL  ] .

  <#tdbGraph> rdf:type tdb:GraphTDB;
  tdb:dataset <#tdbDataset> .

  <#tdbDataset> rdf:type tdb:DatasetTDB ;
  tdb:location "...apache-jena-fuseki-2.4.0/run/databases/ds" .


 Then I start the server as ./fuseki-server --config=ds.ttl. The reasoner
 is
 working. I upload my basic schema saying that SmartPhone is a subClassOf
 MobilePhone etc...Then I post data about smartphones through the REST
 API.
 Everything is working. Now I restart the server.

 And when quering my data i get

 Error 500: Invalid id node for object (null node): ([3C3C],
 [0007AA], [3D18])

 Does you know how to configure it correctly? Is it possible?

 Thanks :)



>>
   .
 

Re: Restarting FUSEKI with TDB and OWL reasoner

2016-09-14 Thread Andy Seaborne



On 14/09/16 13:39, Filip Masri wrote:

Well, I could not solve the problem with apache-jena-fuseki-2.4.0 but
apache-jena-fuseki-2.3.1
 worked without problem.


Ouch!



Do you want me to describe the whole process I did so you could possiby
stacktrace the problem?


Yes, please.

Andy



Filip

2016-09-14 12:11 GMT+02:00 Andy Seaborne :


Hi Filip,


Error 500: Invalid id node for object (null node):
([3C3C], [0007AA], [3D18])


This is usually a sign that the program exits without sync'ing a
non-transaction TDB database.

It is possible (probably) that building the inference model in the
assembler is not transactional.  It becomes transactional on first request.

So has at any time in the past, not the run which caused the 500, have you
exited the server during start up (e.g. control-C) or before the first
request to the inference model?  or another program access the same
database?

The other possible cause is two systems trying to modify the same database
at the same time.  TDB tries to trap this and warn you but the test is not
perfect.  (It looks like you are on Linux so the test is much better there
- on Windows, it has been reported that Windows update can cause restarts
where the process id is reused quiet quickly.)

Could you please crosslink the stack overflow question to this thread?
Thanks.

Andy



On 13/09/16 12:32, Filip Masri wrote:


Dear Jena Community,

I have a following fuseki dataset configuration:

@prefix fuseki:  .
@prefix rdf:  .
@prefix rdfs:  .
@prefix tdb:  .
@prefix ja:  .
@prefix sdb:  .


[] a fuseki:Server ;
fuseki:services ( <#tdb> ) .


<#tdb> rdf:type fuseki:Service ;
 fuseki:name "ds" ; # http://host/inf
 fuseki:serviceQuery   "query" , "sparql" ;
 fuseki:serviceUpdate "update" ;
 fuseki:dataset <#dataset2> ; #select which set to use
 rdfs:label"TDB ds" ;
 fuseki:serviceReadGraphStore  "get" ;
 fuseki:serviceReadWriteGraphStore
   "data" ;
 fuseki:serviceUpload  "upload" .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
 tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
 tdb:GraphTDB rdfs:subClassOf ja:Model .

 <#dataset2> rdf:type ja:RDFDataset ;
  ja:defaultGraph <#model2> .

 <#model2> a ja:InfModel;
  ja:baseModel <#tdbGraph>;
  ja:reasoner
  [ ja:reasonerURL  ] .

 <#tdbGraph> rdf:type tdb:GraphTDB;
 tdb:dataset <#tdbDataset> .

 <#tdbDataset> rdf:type tdb:DatasetTDB ;
 tdb:location "...apache-jena-fuseki-2.4.0/run/databases/ds" .


Then I start the server as ./fuseki-server --config=ds.ttl. The reasoner
is
working. I upload my basic schema saying that SmartPhone is a subClassOf
MobilePhone etc...Then I post data about smartphones through the REST API.
Everything is working. Now I restart the server.

And when quering my data i get

Error 500: Invalid id node for object (null node): ([3C3C],
[0007AA], [3D18])

Does you know how to configure it correctly? Is it possible?

Thanks :)






Re: Restarting FUSEKI with TDB and OWL reasoner

2016-09-14 Thread Filip Masri
Well, I could not solve the problem with apache-jena-fuseki-2.4.0 but
apache-jena-fuseki-2.3.1
 worked without problem.

Do you want me to describe the whole process I did so you could possiby
stacktrace the problem?

Filip

2016-09-14 12:11 GMT+02:00 Andy Seaborne :

> Hi Filip,
>
> > Error 500: Invalid id node for object (null node):
> > ([3C3C], [0007AA], [3D18])
>
> This is usually a sign that the program exits without sync'ing a
> non-transaction TDB database.
>
> It is possible (probably) that building the inference model in the
> assembler is not transactional.  It becomes transactional on first request.
>
> So has at any time in the past, not the run which caused the 500, have you
> exited the server during start up (e.g. control-C) or before the first
> request to the inference model?  or another program access the same
> database?
>
> The other possible cause is two systems trying to modify the same database
> at the same time.  TDB tries to trap this and warn you but the test is not
> perfect.  (It looks like you are on Linux so the test is much better there
> - on Windows, it has been reported that Windows update can cause restarts
> where the process id is reused quiet quickly.)
>
> Could you please crosslink the stack overflow question to this thread?
> Thanks.
>
> Andy
>
>
>
> On 13/09/16 12:32, Filip Masri wrote:
>
>> Dear Jena Community,
>>
>> I have a following fuseki dataset configuration:
>>
>> @prefix fuseki:  .
>> @prefix rdf:  .
>> @prefix rdfs:  .
>> @prefix tdb:  .
>> @prefix ja:  .
>> @prefix sdb:  .
>>
>>
>> [] a fuseki:Server ;
>> fuseki:services ( <#tdb> ) .
>>
>>
>> <#tdb> rdf:type fuseki:Service ;
>>  fuseki:name "ds" ; # http://host/inf
>>  fuseki:serviceQuery   "query" , "sparql" ;
>>  fuseki:serviceUpdate "update" ;
>>  fuseki:dataset <#dataset2> ; #select which set to use
>>  rdfs:label"TDB ds" ;
>>  fuseki:serviceReadGraphStore  "get" ;
>>  fuseki:serviceReadWriteGraphStore
>>"data" ;
>>  fuseki:serviceUpload  "upload" .
>>
>> [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
>>  tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
>>  tdb:GraphTDB rdfs:subClassOf ja:Model .
>>
>>  <#dataset2> rdf:type ja:RDFDataset ;
>>   ja:defaultGraph <#model2> .
>>
>>  <#model2> a ja:InfModel;
>>   ja:baseModel <#tdbGraph>;
>>   ja:reasoner
>>   [ ja:reasonerURL  ] .
>>
>>  <#tdbGraph> rdf:type tdb:GraphTDB;
>>  tdb:dataset <#tdbDataset> .
>>
>>  <#tdbDataset> rdf:type tdb:DatasetTDB ;
>>  tdb:location "...apache-jena-fuseki-2.4.0/run/databases/ds" .
>>
>>
>> Then I start the server as ./fuseki-server --config=ds.ttl. The reasoner
>> is
>> working. I upload my basic schema saying that SmartPhone is a subClassOf
>> MobilePhone etc...Then I post data about smartphones through the REST API.
>> Everything is working. Now I restart the server.
>>
>> And when quering my data i get
>>
>> Error 500: Invalid id node for object (null node): ([3C3C],
>> [0007AA], [3D18])
>>
>> Does you know how to configure it correctly? Is it possible?
>>
>> Thanks :)
>>
>>


Re: Restarting FUSEKI with TDB and OWL reasoner

2016-09-14 Thread Andy Seaborne

Hi Filip,

> Error 500: Invalid id node for object (null node):
> ([3C3C], [0007AA], [3D18])

This is usually a sign that the program exits without sync'ing a 
non-transaction TDB database.


It is possible (probably) that building the inference model in the 
assembler is not transactional.  It becomes transactional on first request.


So has at any time in the past, not the run which caused the 500, have 
you exited the server during start up (e.g. control-C) or before the 
first request to the inference model?  or another program access the 
same database?


The other possible cause is two systems trying to modify the same 
database at the same time.  TDB tries to trap this and warn you but the 
test is not perfect.  (It looks like you are on Linux so the test is 
much better there - on Windows, it has been reported that Windows update 
can cause restarts where the process id is reused quiet quickly.)


Could you please crosslink the stack overflow question to this thread? 
Thanks.


Andy


On 13/09/16 12:32, Filip Masri wrote:

Dear Jena Community,

I have a following fuseki dataset configuration:

@prefix fuseki:  .
@prefix rdf:  .
@prefix rdfs:  .
@prefix tdb:  .
@prefix ja:  .
@prefix sdb:  .


[] a fuseki:Server ;
fuseki:services ( <#tdb> ) .


<#tdb> rdf:type fuseki:Service ;
 fuseki:name "ds" ; # http://host/inf
 fuseki:serviceQuery   "query" , "sparql" ;
 fuseki:serviceUpdate "update" ;
 fuseki:dataset <#dataset2> ; #select which set to use
 rdfs:label"TDB ds" ;
 fuseki:serviceReadGraphStore  "get" ;
 fuseki:serviceReadWriteGraphStore
   "data" ;
 fuseki:serviceUpload  "upload" .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
 tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
 tdb:GraphTDB rdfs:subClassOf ja:Model .

 <#dataset2> rdf:type ja:RDFDataset ;
  ja:defaultGraph <#model2> .

 <#model2> a ja:InfModel;
  ja:baseModel <#tdbGraph>;
  ja:reasoner
  [ ja:reasonerURL  ] .

 <#tdbGraph> rdf:type tdb:GraphTDB;
 tdb:dataset <#tdbDataset> .

 <#tdbDataset> rdf:type tdb:DatasetTDB ;
 tdb:location "...apache-jena-fuseki-2.4.0/run/databases/ds" .


Then I start the server as ./fuseki-server --config=ds.ttl. The reasoner is
working. I upload my basic schema saying that SmartPhone is a subClassOf
MobilePhone etc...Then I post data about smartphones through the REST API.
Everything is working. Now I restart the server.

And when quering my data i get

Error 500: Invalid id node for object (null node): ([3C3C],
[0007AA], [3D18])

Does you know how to configure it correctly? Is it possible?

Thanks :)



Restarting FUSEKI with TDB and OWL reasoner

2016-09-13 Thread Filip Masri
Dear Jena Community,

I have a following fuseki dataset configuration:

@prefix fuseki:  .
@prefix rdf:  .
@prefix rdfs:  .
@prefix tdb:  .
@prefix ja:  .
@prefix sdb:  .


[] a fuseki:Server ;
fuseki:services ( <#tdb> ) .


<#tdb> rdf:type fuseki:Service ;
 fuseki:name "ds" ; # http://host/inf
 fuseki:serviceQuery   "query" , "sparql" ;
 fuseki:serviceUpdate "update" ;
 fuseki:dataset <#dataset2> ; #select which set to use
 rdfs:label"TDB ds" ;
 fuseki:serviceReadGraphStore  "get" ;
 fuseki:serviceReadWriteGraphStore
   "data" ;
 fuseki:serviceUpload  "upload" .

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
 tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
 tdb:GraphTDB rdfs:subClassOf ja:Model .

 <#dataset2> rdf:type ja:RDFDataset ;
  ja:defaultGraph <#model2> .

 <#model2> a ja:InfModel;
  ja:baseModel <#tdbGraph>;
  ja:reasoner
  [ ja:reasonerURL  ] .

 <#tdbGraph> rdf:type tdb:GraphTDB;
 tdb:dataset <#tdbDataset> .

 <#tdbDataset> rdf:type tdb:DatasetTDB ;
 tdb:location "...apache-jena-fuseki-2.4.0/run/databases/ds" .


Then I start the server as ./fuseki-server --config=ds.ttl. The reasoner is
working. I upload my basic schema saying that SmartPhone is a subClassOf
MobilePhone etc...Then I post data about smartphones through the REST API.
Everything is working. Now I restart the server.

And when quering my data i get

Error 500: Invalid id node for object (null node): ([3C3C],
[0007AA], [3D18])

Does you know how to configure it correctly? Is it possible?

Thanks :)