[jira] [Commented] (JENA-1402) Subtracting two xsd:Duration gives incorrect results in SPARQL query

2019-01-11 Thread Greg Albiston (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740821#comment-16740821
 ] 

Greg Albiston commented on JENA-1402:
-

I've had a quick look at _NodeValueDuration_ and where it is used in the ARQ 
module.

In _XSDFuncOp,_ there are checks to get and set fields (i.e. year, month) which 
aren't explicit on the _java.time.Duration_ as it only goes up to days. 
Converting days to months and years consistently could be problematic without a 
start date for context.

In _CastXSD,_ there are checks against the _xml.Duration_ fields for building 
new durations of type _xdt:dayTimeDuration_ or _xdt:yearMonthDuration_ (these 
aren't explicit in _java.time.Duration_). Same issue as above in distinguishing 
when x days becomes y months.

In _NodeValueOps,_ there are operations using _XMLGregorianCalendar_ for which 
_java.time.Duration_ doesn't have methods. _java.time.__LocalTime_ and 
_java.time.__OffsetTime_ can be built from parsing the 
_XMLGregorianCalendar.toString()_ but need to be selected based on whether 
there is a TimeZone offset. _LocalTime/__OffsetTime_ could then be used to 
operate on the _java.time.Duration._

So it could be quite difficult to swap to _java.time.Duration_ and retain the 
XML Datatype functionality. Perhaps the extra classes or approach Bruno 
mentioned might help.

> Subtracting two xsd:Duration gives incorrect results in SPARQL query
> 
>
> Key: JENA-1402
> URL: https://issues.apache.org/jira/browse/JENA-1402
> Project: Apache Jena
>  Issue Type: Bug
>  Components: ARQ
>Affects Versions: Jena 3.4.0
>Reporter: Greg Albiston
>Priority: Major
>
> There is an issue when subtracting two xsd:durations that include:
> * decimal seconds
> * non-zero minutes
> * second operand has a greater number of seconds than the first operand, i.e. 
> the minutes are reduced. 
> The result is a large number of minutes and incorrect seconds.
> For example:
> Integer, Larger: "PT2M3S" - "PT1M10S"  = "PT0M53S" CORRECT
> Decimal, Smaller: "PT2M3.123S" - "PT1M1.123S" = "PT1M2.000S" CORRECT
> Decimal, Larger, Seconds: "PT0M3.123S" - "PT1M10.123S"  = "-PT1M7.000S" 
> CORRECT
> Decimal, Larger, Minutes: "PT2M3.123S" - "PT1M10.123S"  = "PT883M0.020S" 
> INCORRECT
> Decimal, Larger, Hours: "PT1H4M3.123S" - "PT0M10.123S" = "PT1H3883M0.020S" 
> INCORRECT
> Example SPARQL:
> {code:sparql}
> SELECT ?res ?op1 ?op2
> WHERE{
>VALUES (?op1 ?op2) {
> ("PT2M3S"^^ 
> "PT1M10S"^^)
> ("PT2M3.123S"^^ 
> "PT1M1.123S"^^)
> ("PT0M3.123S"^^ 
> "PT1M10.123S"^^)
> ("PT2M3.123S"^^ 
> "PT1M10.123S"^^)
> ("PT1H4M3.123S"^^ 
> "PT0M10.123S"^^)
> }
> BIND(?op1 - ?op2 AS ?res)
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (JENA-1658) tdb2.tdbstats leaves behind tdb.lock

2019-01-11 Thread Andy Seaborne (JIRA)


 [ 
https://issues.apache.org/jira/browse/JENA-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne closed JENA-1658.
---

> tdb2.tdbstats  leaves behind tdb.lock 
> --
>
> Key: JENA-1658
> URL: https://issues.apache.org/jira/browse/JENA-1658
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Cmd line tools, Fuseki, TDB2
>Affects Versions: Jena 3.8.0, Jena 3.9.0, Jena 3.10.0
> Environment: Mac OS X 10.14.2 2.8 GHz Intel Core i7  16 GB 1600 MHz 
> DDR3
>Reporter: Amit Kumar
>Assignee: Andy Seaborne
>Priority: Minor
>
> Running tdb2.tdbstats on an existing TDB2 db  leaves behind the *tdb.lock* 
> file. Then if we try to start a fuseki-server using the same tdb directory it 
> gives an error 
>  
> {code:java}
> org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
> check TDB lock owner as the lock file contains invalid data
> doing:
> root: file:///my#tdb_dataset_readwrite with type: 
> http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
> at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
> at 
> org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
> ...
> ...
> Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
> lock owner as the lock file contains invalid data
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
> at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
> at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
> at 
> org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
> at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
> at 
> org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
> at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
> at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
> at 
> org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
> ... 41 more
> Caused by: java.lang.NumberFormatException: For input string: "41080
> "
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Integer.parseInt(Integer.java:580)
> at java.lang.Integer.parseInt(Integer.java:615)
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
> ... 54 more{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (JENA-1658) tdb2.tdbstats leaves behind tdb.lock

2019-01-11 Thread Andy Seaborne (JIRA)


 [ 
https://issues.apache.org/jira/browse/JENA-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne resolved JENA-1658.
-
Resolution: Information Provided
  Assignee: Andy Seaborne

> tdb2.tdbstats  leaves behind tdb.lock 
> --
>
> Key: JENA-1658
> URL: https://issues.apache.org/jira/browse/JENA-1658
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Cmd line tools, Fuseki, TDB2
>Affects Versions: Jena 3.8.0, Jena 3.9.0, Jena 3.10.0
> Environment: Mac OS X 10.14.2 2.8 GHz Intel Core i7  16 GB 1600 MHz 
> DDR3
>Reporter: Amit Kumar
>Assignee: Andy Seaborne
>Priority: Minor
>
> Running tdb2.tdbstats on an existing TDB2 db  leaves behind the *tdb.lock* 
> file. Then if we try to start a fuseki-server using the same tdb directory it 
> gives an error 
>  
> {code:java}
> org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
> check TDB lock owner as the lock file contains invalid data
> doing:
> root: file:///my#tdb_dataset_readwrite with type: 
> http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
> at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
> at 
> org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
> ...
> ...
> Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
> lock owner as the lock file contains invalid data
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
> at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
> at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
> at 
> org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
> at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
> at 
> org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
> at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
> at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
> at 
> org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
> ... 41 more
> Caused by: java.lang.NumberFormatException: For input string: "41080
> "
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Integer.parseInt(Integer.java:580)
> at java.lang.Integer.parseInt(Integer.java:615)
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
> ... 54 more{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1657) Close response stream of http connections

2019-01-11 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740755#comment-16740755
 ] 

ASF subversion and git services commented on JENA-1657:
---

Commit 78d6e2da5a09af3d1e90b8d210ecebfc75816177 in jena's branch 
refs/heads/master from Andy Seaborne
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=78d6e2d ]

JENA-1657: Close after ASK execution


> Close response stream of http connections
> -
>
> Key: JENA-1657
> URL: https://issues.apache.org/jira/browse/JENA-1657
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Major
> Fix For: Jena 3.11.0
>
>
> https://github.com/apache/jena/pull/520 from Vladislav Gordievskiy / 
> https://github.com/vgordievskiy.
> Various "exec" operations in QueryEngineHTTP, for model/dataset/JSON results.
> {{SELECT}} and {{ASK}} are OK.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1658) tdb2.tdbstats leaves behind tdb.lock

2019-01-11 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740748#comment-16740748
 ] 

Andy Seaborne commented on JENA-1658:
-

Glad we got that sorted.

I'll refine the help information.



> tdb2.tdbstats  leaves behind tdb.lock 
> --
>
> Key: JENA-1658
> URL: https://issues.apache.org/jira/browse/JENA-1658
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Cmd line tools, Fuseki, TDB2
>Affects Versions: Jena 3.8.0, Jena 3.9.0, Jena 3.10.0
> Environment: Mac OS X 10.14.2 2.8 GHz Intel Core i7  16 GB 1600 MHz 
> DDR3
>Reporter: Amit Kumar
>Priority: Minor
>
> Running tdb2.tdbstats on an existing TDB2 db  leaves behind the *tdb.lock* 
> file. Then if we try to start a fuseki-server using the same tdb directory it 
> gives an error 
>  
> {code:java}
> org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
> check TDB lock owner as the lock file contains invalid data
> doing:
> root: file:///my#tdb_dataset_readwrite with type: 
> http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
> at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
> at 
> org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
> ...
> ...
> Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
> lock owner as the lock file contains invalid data
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
> at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
> at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
> at 
> org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
> at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
> at 
> org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
> at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
> at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
> at 
> org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
> ... 41 more
> Caused by: java.lang.NumberFormatException: For input string: "41080
> "
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Integer.parseInt(Integer.java:580)
> at java.lang.Integer.parseInt(Integer.java:615)
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
> ... 54 more{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1658) tdb2.tdbstats leaves behind tdb.lock

2019-01-11 Thread Amit Kumar (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740742#comment-16740742
 ] 

Amit Kumar commented on JENA-1658:
--

[~andy.seaborne] You are right, 

here are the commands I was running 
{code:java}
./apache-jena-3.10.0/bin/tdb2.tdbloader --loc=data/db data/input/input.nq

./apache-jena-3.10.0/bin/tdb2.tdbstats --loc=data/db

{code}
 

and then when i was trying to run 
{code:java}
./fuseki-server  --loc=../data/db --debug -v  /my{code}
it was giving the error. Running the fuseki with tdb2 parameter fixed it 
{code:java}
./fuseki-server  --loc=../data/db --debug -v --tdb2 /my{code}
I'm just starting to play around with these and probably missed it. I now see 
some mention of this on 
[https://jena.apache.org/documentation/fuseki2/fuseki-run.html#fuseki-standalone-server]
 page. Probably the message printed on the command line with the --help option 
could be better. At least it should say that we should use the --tdb2 command 
if we want to use an existing tdb2 db
{code:java}
./fuseki-server --help
fuseki [--config=FILE] [--mem|--desc=AssemblerFile|--file=FILE] [--port PORT] 
/DatasetPathName
Fuseki
--desc= Assembler description file
--mem Create an in-memory, non-persistent dataset for the server
--file=FILE Create an in-memory, non-persistent dataset for the server, 
initialised with the contents of the file
--tdb2 Create command line persistent datasets with TDB2
--loc=DIR Use an existing TDB database (or create if does not exist){code}

> tdb2.tdbstats  leaves behind tdb.lock 
> --
>
> Key: JENA-1658
> URL: https://issues.apache.org/jira/browse/JENA-1658
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Cmd line tools, Fuseki, TDB2
>Affects Versions: Jena 3.8.0, Jena 3.9.0, Jena 3.10.0
> Environment: Mac OS X 10.14.2 2.8 GHz Intel Core i7  16 GB 1600 MHz 
> DDR3
>Reporter: Amit Kumar
>Priority: Minor
>
> Running tdb2.tdbstats on an existing TDB2 db  leaves behind the *tdb.lock* 
> file. Then if we try to start a fuseki-server using the same tdb directory it 
> gives an error 
>  
> {code:java}
> org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
> check TDB lock owner as the lock file contains invalid data
> doing:
> root: file:///my#tdb_dataset_readwrite with type: 
> http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
> at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
> at 
> org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
> ...
> ...
> Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
> lock owner as the lock file contains invalid data
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
> at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
> at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
> at 
> org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
> at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
> at 
> org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
> at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
> at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
> at 
> org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
> ... 41 more
> Caused by: java.lang.NumberFormatException: For input string: "41080
> "
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Integer.parseInt(Integer.java:580)
> at java.lang.Integer.parseInt(Integer.java:615)
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
> 

[jira] [Commented] (JENA-1658) tdb2.tdbstats leaves behind tdb.lock

2019-01-11 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740727#comment-16740727
 ] 

Andy Seaborne commented on JENA-1658:
-

It looks like you are running a TDB1 assembler on TDB2 command (tdb2.tdbstats).

The database are not compatible. {{tdb.lock}} in TDB1 has the process id of the 
owner; {{tdb.lock}} in TDB2, OS locking (via java {{FileChannel.lock}}) is used 
to get exclusive lock. They happen to have slightly different formats (TDB2 has 
a newline on the end as the stacktrace shows).

Leaving lock files around should not matter.

If it is really a TDB1 database, then delete the lock file and you can delete 
the empty TDB2 database created.

If it is really a TDB2 database, then the assembler configuration details are 
probably wrong (e.g. the wrong URl for the database rdf:type).

> tdb2.tdbstats  leaves behind tdb.lock 
> --
>
> Key: JENA-1658
> URL: https://issues.apache.org/jira/browse/JENA-1658
> Project: Apache Jena
>  Issue Type: Bug
>  Components: Cmd line tools, Fuseki, TDB2
>Affects Versions: Jena 3.8.0, Jena 3.9.0, Jena 3.10.0
> Environment: Mac OS X 10.14.2 2.8 GHz Intel Core i7  16 GB 1600 MHz 
> DDR3
>Reporter: Amit Kumar
>Priority: Minor
>
> Running tdb2.tdbstats on an existing TDB2 db  leaves behind the *tdb.lock* 
> file. Then if we try to start a fuseki-server using the same tdb directory it 
> gives an error 
>  
> {code:java}
> org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
> check TDB lock owner as the lock file contains invalid data
> doing:
> root: file:///my#tdb_dataset_readwrite with type: 
> http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
> at 
> org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
> at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
> at 
> org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
> ...
> ...
> Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
> lock owner as the lock file contains invalid data
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
> at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
> at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
> at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
> at 
> org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
> at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
> at 
> org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
> at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
> at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
> at 
> org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
> at 
> org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
> at 
> org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
> ... 41 more
> Caused by: java.lang.NumberFormatException: For input string: "41080
> "
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Integer.parseInt(Integer.java:580)
> at java.lang.Integer.parseInt(Integer.java:615)
> at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
> ... 54 more{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (JENA-1657) Close response stream of http connections

2019-01-11 Thread Andy Seaborne (JIRA)


 [ 
https://issues.apache.org/jira/browse/JENA-1657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne resolved JENA-1657.
-
   Resolution: Fixed
Fix Version/s: Jena 3.11.0

> Close response stream of http connections
> -
>
> Key: JENA-1657
> URL: https://issues.apache.org/jira/browse/JENA-1657
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Major
> Fix For: Jena 3.11.0
>
>
> https://github.com/apache/jena/pull/520 from Vladislav Gordievskiy / 
> https://github.com/vgordievskiy.
> Various "exec" operations in QueryEngineHTTP, for model/dataset/JSON results.
> {{SELECT}} and {{ASK}} are OK.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (JENA-1658) tdb2.tdbstats leaves behind tdb.lock

2019-01-11 Thread Amit Kumar (JIRA)


 [ 
https://issues.apache.org/jira/browse/JENA-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Amit Kumar updated JENA-1658:
-
Description: 
Running tdb2.tdbstats on an existing TDB2 db  leaves behind the *tdb.lock* 
file. Then if we try to start a fuseki-server using the same tdb directory it 
gives an error 

 
{code:java}
org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
check TDB lock owner as the lock file contains invalid data
doing:
root: file:///my#tdb_dataset_readwrite with type: 
http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
org.apache.jena.tdb.assembler.DatasetAssemblerTDB

at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
at 
org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
...
...

Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
lock owner as the lock file contains invalid data
at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
at 
org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
at 
org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
at 
org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
at 
org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
at 
org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
... 41 more
Caused by: java.lang.NumberFormatException: For input string: "41080
"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
... 54 more{code}

  was:
After running tdb2.tdbstats on an existing TDB2 db, it leave behind the 
tdb.lock file. Then if we try to start a fuseki-server using the same tdb 
directory  it gives an error 

 
{code:java}
org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
check TDB lock owner as the lock file contains invalid data
doing:
root: file:///my#tdb_dataset_readwrite with type: 
http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
org.apache.jena.tdb.assembler.DatasetAssemblerTDB

at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
at 
org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
...
...

Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
lock owner as the lock file contains invalid data
at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
at 
org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
at 
org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
at 

[jira] [Created] (JENA-1658) tdb2.tdbstats leaves behind tdb.lock

2019-01-11 Thread Amit Kumar (JIRA)
Amit Kumar created JENA-1658:


 Summary: tdb2.tdbstats  leaves behind tdb.lock 
 Key: JENA-1658
 URL: https://issues.apache.org/jira/browse/JENA-1658
 Project: Apache Jena
  Issue Type: Bug
  Components: Cmd line tools, Fuseki, TDB2
Affects Versions: Jena 3.10.0, Jena 3.9.0, Jena 3.8.0
 Environment: Mac OS X 10.14.2 2.8 GHz Intel Core i7  16 GB 1600 MHz 
DDR3
Reporter: Amit Kumar


After running tdb2.tdbstats on an existing TDB2 db, it leave behind the 
tdb.lock file. Then if we try to start a fuseki-server using the same tdb 
directory  it gives an error 

 
{code:java}
org.apache.jena.assembler.exceptions.AssemblerException: caught: Unable to 
check TDB lock owner as the lock file contains invalid data
doing:
root: file:///my#tdb_dataset_readwrite with type: 
http://jena.hpl.hp.com/2008/tdb#DatasetTDB assembler class: class 
org.apache.jena.tdb.assembler.DatasetAssemblerTDB

at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:165)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:345)
at 
org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:299)
...
...

Caused by: org.apache.jena.tdb.base.file.FileException: Unable to check TDB 
lock owner as the lock file contains invalid data
at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:111)
at org.apache.jena.tdb.base.file.LocationLock.canObtain(LocationLock.java:130)
at org.apache.jena.tdb.StoreConnection._makeAndCache(StoreConnection.java:267)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:231)
at org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:245)
at 
org.apache.jena.tdb.transaction.DatasetGraphTransaction.(DatasetGraphTransaction.java:72)
at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:80)
at 
org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.java:44)
at org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:89)
at org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:71)
at 
org.apache.jena.tdb.assembler.DatasetAssemblerTDB.make(DatasetAssemblerTDB.java:57)
at 
org.apache.jena.tdb.assembler.DatasetAssemblerTDB.createDataset(DatasetAssemblerTDB.java:48)
at 
org.apache.jena.sparql.core.assembler.DatasetAssembler.open(DatasetAssembler.java:43)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
... 41 more
Caused by: java.lang.NumberFormatException: For input string: "41080
"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at org.apache.jena.tdb.base.file.LocationLock.getOwner(LocationLock.java:106)
... 54 more{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1657) Close response stream of http connections

2019-01-11 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740628#comment-16740628
 ] 

ASF subversion and git services commented on JENA-1657:
---

Commit 9152d60d2f2b16785b34db4df4d6dd4f56bc18ca in jena's branch 
refs/heads/master from Andy Seaborne
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=9152d60 ]

Merge pull request #520 from vgordievskiy/master

JENA-1657: correct closing of http connections

> Close response stream of http connections
> -
>
> Key: JENA-1657
> URL: https://issues.apache.org/jira/browse/JENA-1657
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Major
>
> https://github.com/apache/jena/pull/520 from Vladislav Gordievskiy / 
> https://github.com/vgordievskiy.
> Various "exec" operations in QueryEngineHTTP, for model/dataset/JSON results.
> {{SELECT}} and {{ASK}} are OK.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1657) Close response stream of http connections

2019-01-11 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740627#comment-16740627
 ] 

ASF subversion and git services commented on JENA-1657:
---

Commit a83373a780242a26e88c9843a33f7f6877e844bd in jena's branch 
refs/heads/master from Vladislav Gordievskiy
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=a83373a ]

JENA-1657: fix review comments


> Close response stream of http connections
> -
>
> Key: JENA-1657
> URL: https://issues.apache.org/jira/browse/JENA-1657
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Major
>
> https://github.com/apache/jena/pull/520 from Vladislav Gordievskiy / 
> https://github.com/vgordievskiy.
> Various "exec" operations in QueryEngineHTTP, for model/dataset/JSON results.
> {{SELECT}} and {{ASK}} are OK.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1402) Subtracting two xsd:Duration gives incorrect results in SPARQL query

2019-01-11 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740362#comment-16740362
 ] 

Andy Seaborne commented on JENA-1402:
-

Greg - thanks for tracking this.

Given the lead time, and Java12 is not LTS, maybe we should swap to 
{{java.time.Duration}} in {{NodeValueDuration}} for this one case?


> Subtracting two xsd:Duration gives incorrect results in SPARQL query
> 
>
> Key: JENA-1402
> URL: https://issues.apache.org/jira/browse/JENA-1402
> Project: Apache Jena
>  Issue Type: Bug
>  Components: ARQ
>Affects Versions: Jena 3.4.0
>Reporter: Greg Albiston
>Priority: Major
>
> There is an issue when subtracting two xsd:durations that include:
> * decimal seconds
> * non-zero minutes
> * second operand has a greater number of seconds than the first operand, i.e. 
> the minutes are reduced. 
> The result is a large number of minutes and incorrect seconds.
> For example:
> Integer, Larger: "PT2M3S" - "PT1M10S"  = "PT0M53S" CORRECT
> Decimal, Smaller: "PT2M3.123S" - "PT1M1.123S" = "PT1M2.000S" CORRECT
> Decimal, Larger, Seconds: "PT0M3.123S" - "PT1M10.123S"  = "-PT1M7.000S" 
> CORRECT
> Decimal, Larger, Minutes: "PT2M3.123S" - "PT1M10.123S"  = "PT883M0.020S" 
> INCORRECT
> Decimal, Larger, Hours: "PT1H4M3.123S" - "PT0M10.123S" = "PT1H3883M0.020S" 
> INCORRECT
> Example SPARQL:
> {code:sparql}
> SELECT ?res ?op1 ?op2
> WHERE{
>VALUES (?op1 ?op2) {
> ("PT2M3S"^^ 
> "PT1M10S"^^)
> ("PT2M3.123S"^^ 
> "PT1M1.123S"^^)
> ("PT0M3.123S"^^ 
> "PT1M10.123S"^^)
> ("PT2M3.123S"^^ 
> "PT1M10.123S"^^)
> ("PT1H4M3.123S"^^ 
> "PT0M10.123S"^^)
> }
> BIND(?op1 - ?op2 AS ?res)
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (JENA-1657) Close response stream of http connections

2019-01-11 Thread Andy Seaborne (JIRA)


[ 
https://issues.apache.org/jira/browse/JENA-1657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740337#comment-16740337
 ] 

Andy Seaborne commented on JENA-1657:
-

{{execAsk}} may have a better pattern for operations that read all their 
results before returning.  It uses try-with-resource.


> Close response stream of http connections
> -
>
> Key: JENA-1657
> URL: https://issues.apache.org/jira/browse/JENA-1657
> Project: Apache Jena
>  Issue Type: Task
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>Priority: Major
>
> https://github.com/apache/jena/pull/520 from Vladislav Gordievskiy / 
> https://github.com/vgordievskiy.
> Various "exec" operations in QueryEngineHTTP, for model/dataset/JSON results.
> {{SELECT}} and {{ASK}} are OK.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (JENA-1657) Close response stream of http connections

2019-01-11 Thread Andy Seaborne (JIRA)
Andy Seaborne created JENA-1657:
---

 Summary: Close response stream of http connections
 Key: JENA-1657
 URL: https://issues.apache.org/jira/browse/JENA-1657
 Project: Apache Jena
  Issue Type: Task
Reporter: Andy Seaborne
Assignee: Andy Seaborne


https://github.com/apache/jena/pull/520 from Vladislav Gordievskiy / 
https://github.com/vgordievskiy.

Various "exec" operations in QueryEngineHTTP, for model/dataset/JSON results.

{{SELECT}} and {{ASK}} are OK.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)