You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Jean-Marc Vanel <je...@gmail.com> on 2022/01/01 19:45:02 UTC

Datatype format exception : float - detect the incorrect triple

During TDB initialization, I get this warning :
WARN  o.apache.jena.sparql.expr.NodeValue - Datatype format exception:
"4,77962"^^xsd:float

But I am unable to detect the incorrect triple , with this query :
PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
SELECT * WHERE {
  ?S ?P "4,77962"^^xsd:float .
}

I also tried this:
SELECT * WHERE {
  ?S ?P ?O.
  FILTER ( STR(?O) = "4,77962" )
}

This uses the latest jena Version 4.3.2 , with TDB 1 .
I suspect this bad data prevents geosparl queries from getting any result.

Jean-Marc Vanel
<http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr

Re: Datatype format exception : float - detect the incorrect triple

Posted by Andy Seaborne <an...@apache.org>.

On 01/01/2022 22:04, Jean-Marc Vanel wrote:
> Le sam. 1 janv. 2022 à 21:50, Andy Seaborne <an...@apache.org> a écrit :
> 
>>
>> On 01/01/2022 19:45, Jean-Marc Vanel wrote:
>>> During TDB initialization, I get this warning :
>>> WARN  o.apache.jena.sparql.expr.NodeValue - Datatype format exception:
>>> "4,77962"^^xsd:float
>>>
>>> But I am unable to detect the incorrect triple , with this query :
>>> PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
>>> SELECT * WHERE {
>>>     ?S ?P "4,77962"^^xsd:float .
>>> }
>>>
>>> I also tried this:
>>> SELECT * WHERE {
>>>     ?S ?P ?O.
>>>     FILTER ( STR(?O) = "4,77962" )
>>
>> Try
>>
>> FILTER ( CONTAINS(STR(?O), "779") )
>>
> See result below.
> 
>> }
>>>
>>> This uses the latest jena Version 4.3.2 , with TDB 1 .
>>> I suspect this bad data prevents geosparl queries from getting any
>> result.
>>
>> Did it work in a previous version?
>>
> Yes, that's an old database that I kept using for maybe 3 years .

Which version?

> 
>> Did you load the TDB database with 4.3.2?
>>
> No.
> 
>> Does it work with TDB2?
>>
>   Didn't try .
> 
>> Does the original data have a comma in a float?
>>
> yes it had that; I tried to remove it but it seems that there is still some
> bad data present.
> 
> It seems that my database is corrupted, the query does not terminate. And
> alas I have non recent  backup.
> If I try to make a backup now it stops with the same error and stack as
> below: *AtlasException: Unknown escape: \< *. Happily it produces a partial
> dump .
> 
> cat test-andy.rq
> SELECT * WHERE {
> graph ?g {
>    ?S ?P ?O.
>    FILTER ( CONTAINS(STR(?O), "779") )
> }}
> $JENA/bin/tdbquery --loc=TDB --query test-andy.rq

That's a lot of junk in the database.
You would have got thos emessages from your queries.
(or have corrupted the database since)

 > org.apache.jena.atlas.AtlasException: Unknown escape: \<
  at org.apache.jena.atlas.lib.EscapeStr.unescape(EscapeStr.java:249)

No idea.


> 21:30:31 WARN  NodeValue       :: Datatype format exception:
> "-2700000000-01-01T00:00:00Z"^^xsd:dateTime

jena currently only handles "-2 billion"

> 21:30:32 WARN  NodeValue       :: Datatype format exception:
> "1778-1-10"^^xsd:date

"1778-01-10"

> 21:30:32 WARN  NodeValue       :: Datatype format exception:
> "1707-5-23"^^xsd:date
> 21:30:32 WARN  NodeValue       :: Datatype format exception:
> "2013-6-23"^^xsd:date
> 21:30:32 WARN  NodeValue       :: Datatype format exception:
> "-287"^^xsd:gYear
> 21:30:32 WARN  NodeValue       :: Datatype format exception:
> "-371"^^xsd:gYear
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(5.71,None,None)"^^xsd:double

That's not an xsd:double

> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1427,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(6925,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(2012,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1600,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(45,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1212.8,None,None)"^^xsd:double
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(167,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(8.48,None,None)"^^xsd:double
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(69278,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(4029,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1990,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(69730,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(45,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(475,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "1885-9-25"^^xsd:date
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "1810-5-10"^^xsd:date
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(2009,None,None)"^^xsd:integer
> 21:30:33 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(978,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(35,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(40,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1933,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(2003,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(83,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "1957-8-30"^^xsd:date
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(15.69,None,None)"^^xsd:double
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1322,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(4442,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(2012,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1600,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(45,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(283.1,None,None)"^^xsd:double
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(163,None,None)"^^xsd:integer
> 21:30:34 WARN  NodeValue       :: Datatype format exception:
> "1853-4-9"^^xsd:date
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "1837-1-29"^^xsd:date
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "1799-5-26"^^xsd:date
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(7.98,None,None)"^^xsd:double
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(38531,None,None)"^^xsd:integer
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(383,None,None)"^^xsd:integer
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(1990,None,None)"^^xsd:integer
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(38620,None,None)"^^xsd:integer
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(45,None,None)"^^xsd:integer
> 21:30:37 WARN  NodeValue       :: Datatype format exception:
> "ParseResult(48,None,None)"^^xsd:integer
> 21:30:37 ERROR BindingTDB      :: get1(?P)
> *org.apache.jena.atlas.AtlasException: Unknown escape: \<*
> at org.apache.jena.atlas.lib.EscapeStr.unescape(EscapeStr.java:249)
> ~[jena-base-4.3.2.jar:4.3.2]
> at org.apache.jena.atlas.lib.EscapeStr.unescapeStr(EscapeStr.java:158)
> ~[jena-base-4.3.2.jar:4.3.2]
> at org.apache.jena.atlas.lib.EscapeStr.unescapeStr(EscapeStr.java:154)
> ~[jena-base-4.3.2.jar:4.3.2]
> at org.apache.jena.atlas.lib.StrUtils.unescapeString(StrUtils.java:285)
> ~[jena-base-4.3.2.jar:4.3.2]
> at org.apache.jena.tdb.store.nodetable.NodecSSE.decode(NodecSSE.java:114)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at org.apache.jena.tdb.lib.NodeLib.decode(NodeLib.java:118)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at org.apache.jena.tdb.lib.NodeLib.fetchDecode(NodeLib.java:95)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.tdb.store.nodetable.NodeTableNative.readNodeFromTable(NodeTableNative.java:182)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.tdb.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:108)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.tdb.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:67)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.tdb.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:128)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:82)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:49)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at org.apache.jena.tdb.solver.BindingTDB.get1(BindingTDB.java:126)
> ~[jena-tdb-4.3.2.jar:4.3.2]
> at
> org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:111)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.sparql.engine.binding.BindingBuilder.addAll(BindingBuilder.java:155)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.sparql.engine.binding.BindingFactory.copy(BindingFactory.java:137)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.sparql.resultset.ResultSetMem.<init>(ResultSetMem.java:90)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.query.ResultSetFactory.makeRewindable(ResultSetFactory.java:312)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at org.apache.jena.query.ResultSet.rewindable(ResultSet.java:90)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.output$(ResultSetWriterText.java:132)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:120)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:116)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.write(ResultSetWriterText.java:59)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:161)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:131)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.sparql.util.QueryExecUtils.outputResultSet(QueryExecUtils.java:153)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.sparql.util.QueryExecUtils.doSelectQuery(QueryExecUtils.java:170)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at
> org.apache.jena.sparql.util.QueryExecUtils.executeQuery(QueryExecUtils.java:101)
> ~[jena-arq-4.3.2.jar:4.3.2]
> at arq.query.lambda$queryExec$0(query.java:237) ~[jena-cmds-4.3.2.jar:4.3.2]
> at org.apache.jena.system.Txn.exec(Txn.java:77) [jena-arq-4.3.2.jar:4.3.2]
> at org.apache.jena.system.Txn.executeRead(Txn.java:115)
> [jena-arq-4.3.2.jar:4.3.2]
> at arq.query.queryExec(query.java:234) [jena-cmds-4.3.2.jar:4.3.2]
> at arq.query.exec(query.java:157) [jena-cmds-4.3.2.jar:4.3.2]
> at org.apache.jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
> [jena-cmds-4.3.2.jar:4.3.2]
> at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:58)
> [jena-cmds-4.3.2.jar:4.3.2]
> at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:45)
> [jena-cmds-4.3.2.jar:4.3.2]
> at tdb.tdbquery.main(tdbquery.java:33) [jena-cmds-4.3.2.jar:4.3.2]
> Exception
> java.lang.NullPointerException: check(?P, null): null node value
> at
> org.apache.jena.sparql.engine.binding.BindingBuilder.checkAdd(BindingBuilder.java:393)
> at
> org.apache.jena.sparql.engine.binding.BindingBuilder.add(BindingBuilder.java:145)
> at
> org.apache.jena.sparql.engine.binding.BindingBuilder.addAll(BindingBuilder.java:156)
> at
> org.apache.jena.sparql.engine.binding.BindingFactory.copy(BindingFactory.java:137)
> at
> org.apache.jena.sparql.resultset.ResultSetMem.<init>(ResultSetMem.java:90)
> at
> org.apache.jena.query.ResultSetFactory.makeRewindable(ResultSetFactory.java:312)
> at org.apache.jena.query.ResultSet.rewindable(ResultSet.java:90)
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.output$(ResultSetWriterText.java:132)
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:120)
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:116)
> at
> org.apache.jena.riot.resultset.rw.ResultSetWriterText.write(ResultSetWriterText.java:59)
> at
> org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:161)
> at
> org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:131)
> at
> org.apache.jena.sparql.util.QueryExecUtils.outputResultSet(QueryExecUtils.java:153)
> at
> org.apache.jena.sparql.util.QueryExecUtils.doSelectQuery(QueryExecUtils.java:170)
> at
> org.apache.jena.sparql.util.QueryExecUtils.executeQuery(QueryExecUtils.java:101)
> at arq.query.lambda$queryExec$0(query.java:237)
> at org.apache.jena.system.Txn.exec(Txn.java:77)
> at org.apache.jena.system.Txn.executeRead(Txn.java:115)
> at arq.query.queryExec(query.java:234)
> at arq.query.exec(query.java:157)
> at org.apache.jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
> at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:58)
> at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:45)
> at tdb.tdbquery.main(tdbquery.java:33)
> 
> That was querying with Jena 4.3.2 ; same result with 4.0.0
> 
> 
>>       Andy
>>
>>>
>>> Jean-Marc Vanel
>>> <
>> http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
>>>
>>> +33 (0)6 89 16 29 52
>>> Twitter: @jmvanel , @jmvanel_fr
>>>
>>
> 

Re: Datatype format exception : float - detect the incorrect triple

Posted by Jean-Marc Vanel <je...@gmail.com>.
Le sam. 1 janv. 2022 à 21:50, Andy Seaborne <an...@apache.org> a écrit :

>
> On 01/01/2022 19:45, Jean-Marc Vanel wrote:
> > During TDB initialization, I get this warning :
> > WARN  o.apache.jena.sparql.expr.NodeValue - Datatype format exception:
> > "4,77962"^^xsd:float
> >
> > But I am unable to detect the incorrect triple , with this query :
> > PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
> > SELECT * WHERE {
> >    ?S ?P "4,77962"^^xsd:float .
> > }
> >
> > I also tried this:
> > SELECT * WHERE {
> >    ?S ?P ?O.
> >    FILTER ( STR(?O) = "4,77962" )
>
> Try
>
> FILTER ( CONTAINS(STR(?O), "779") )
>
See result below.

> }
> >
> > This uses the latest jena Version 4.3.2 , with TDB 1 .
> > I suspect this bad data prevents geosparl queries from getting any
> result.
>
> Did it work in a previous version?
>
Yes, that's an old database that I kept using for maybe 3 years .

> Did you load the TDB database with 4.3.2?
>
No.

> Does it work with TDB2?
>
 Didn't try .

> Does the original data have a comma in a float?
>
yes it had that; I tried to remove it but it seems that there is still some
bad data present.

It seems that my database is corrupted, the query does not terminate. And
alas I have non recent  backup.
If I try to make a backup now it stops with the same error and stack as
below: *AtlasException: Unknown escape: \< *. Happily it produces a partial
dump .

cat test-andy.rq
SELECT * WHERE {
graph ?g {
  ?S ?P ?O.
  FILTER ( CONTAINS(STR(?O), "779") )
}}
$JENA/bin/tdbquery --loc=TDB --query test-andy.rq
21:30:31 WARN  NodeValue       :: Datatype format exception:
"-2700000000-01-01T00:00:00Z"^^xsd:dateTime
21:30:32 WARN  NodeValue       :: Datatype format exception:
"1778-1-10"^^xsd:date
21:30:32 WARN  NodeValue       :: Datatype format exception:
"1707-5-23"^^xsd:date
21:30:32 WARN  NodeValue       :: Datatype format exception:
"2013-6-23"^^xsd:date
21:30:32 WARN  NodeValue       :: Datatype format exception:
"-287"^^xsd:gYear
21:30:32 WARN  NodeValue       :: Datatype format exception:
"-371"^^xsd:gYear
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(5.71,None,None)"^^xsd:double
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1427,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(6925,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(2012,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1600,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(45,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1212.8,None,None)"^^xsd:double
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(167,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(8.48,None,None)"^^xsd:double
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(69278,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(4029,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1990,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(69730,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(45,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(475,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"1885-9-25"^^xsd:date
21:30:33 WARN  NodeValue       :: Datatype format exception:
"1810-5-10"^^xsd:date
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(2009,None,None)"^^xsd:integer
21:30:33 WARN  NodeValue       :: Datatype format exception:
"ParseResult(978,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(35,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(40,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1933,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(2003,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(83,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"1957-8-30"^^xsd:date
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(15.69,None,None)"^^xsd:double
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1322,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(4442,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(2012,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1600,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(45,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(283.1,None,None)"^^xsd:double
21:30:34 WARN  NodeValue       :: Datatype format exception:
"ParseResult(163,None,None)"^^xsd:integer
21:30:34 WARN  NodeValue       :: Datatype format exception:
"1853-4-9"^^xsd:date
21:30:37 WARN  NodeValue       :: Datatype format exception:
"1837-1-29"^^xsd:date
21:30:37 WARN  NodeValue       :: Datatype format exception:
"1799-5-26"^^xsd:date
21:30:37 WARN  NodeValue       :: Datatype format exception:
"ParseResult(7.98,None,None)"^^xsd:double
21:30:37 WARN  NodeValue       :: Datatype format exception:
"ParseResult(38531,None,None)"^^xsd:integer
21:30:37 WARN  NodeValue       :: Datatype format exception:
"ParseResult(383,None,None)"^^xsd:integer
21:30:37 WARN  NodeValue       :: Datatype format exception:
"ParseResult(1990,None,None)"^^xsd:integer
21:30:37 WARN  NodeValue       :: Datatype format exception:
"ParseResult(38620,None,None)"^^xsd:integer
21:30:37 WARN  NodeValue       :: Datatype format exception:
"ParseResult(45,None,None)"^^xsd:integer
21:30:37 WARN  NodeValue       :: Datatype format exception:
"ParseResult(48,None,None)"^^xsd:integer
21:30:37 ERROR BindingTDB      :: get1(?P)
*org.apache.jena.atlas.AtlasException: Unknown escape: \<*
at org.apache.jena.atlas.lib.EscapeStr.unescape(EscapeStr.java:249)
~[jena-base-4.3.2.jar:4.3.2]
at org.apache.jena.atlas.lib.EscapeStr.unescapeStr(EscapeStr.java:158)
~[jena-base-4.3.2.jar:4.3.2]
at org.apache.jena.atlas.lib.EscapeStr.unescapeStr(EscapeStr.java:154)
~[jena-base-4.3.2.jar:4.3.2]
at org.apache.jena.atlas.lib.StrUtils.unescapeString(StrUtils.java:285)
~[jena-base-4.3.2.jar:4.3.2]
at org.apache.jena.tdb.store.nodetable.NodecSSE.decode(NodecSSE.java:114)
~[jena-tdb-4.3.2.jar:4.3.2]
at org.apache.jena.tdb.lib.NodeLib.decode(NodeLib.java:118)
~[jena-tdb-4.3.2.jar:4.3.2]
at org.apache.jena.tdb.lib.NodeLib.fetchDecode(NodeLib.java:95)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.tdb.store.nodetable.NodeTableNative.readNodeFromTable(NodeTableNative.java:182)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.tdb.store.nodetable.NodeTableNative._retrieveNodeByNodeId(NodeTableNative.java:108)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.tdb.store.nodetable.NodeTableNative.getNodeForNodeId(NodeTableNative.java:67)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.tdb.store.nodetable.NodeTableCache._retrieveNodeByNodeId(NodeTableCache.java:128)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.tdb.store.nodetable.NodeTableCache.getNodeForNodeId(NodeTableCache.java:82)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.tdb.store.nodetable.NodeTableWrapper.getNodeForNodeId(NodeTableWrapper.java:49)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.tdb.store.nodetable.NodeTableInline.getNodeForNodeId(NodeTableInline.java:66)
~[jena-tdb-4.3.2.jar:4.3.2]
at org.apache.jena.tdb.solver.BindingTDB.get1(BindingTDB.java:126)
~[jena-tdb-4.3.2.jar:4.3.2]
at
org.apache.jena.sparql.engine.binding.BindingBase.get(BindingBase.java:111)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.sparql.engine.binding.BindingBuilder.addAll(BindingBuilder.java:155)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.sparql.engine.binding.BindingFactory.copy(BindingFactory.java:137)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.sparql.resultset.ResultSetMem.<init>(ResultSetMem.java:90)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.query.ResultSetFactory.makeRewindable(ResultSetFactory.java:312)
~[jena-arq-4.3.2.jar:4.3.2]
at org.apache.jena.query.ResultSet.rewindable(ResultSet.java:90)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.output$(ResultSetWriterText.java:132)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:120)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:116)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.write(ResultSetWriterText.java:59)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:161)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:131)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.sparql.util.QueryExecUtils.outputResultSet(QueryExecUtils.java:153)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.sparql.util.QueryExecUtils.doSelectQuery(QueryExecUtils.java:170)
~[jena-arq-4.3.2.jar:4.3.2]
at
org.apache.jena.sparql.util.QueryExecUtils.executeQuery(QueryExecUtils.java:101)
~[jena-arq-4.3.2.jar:4.3.2]
at arq.query.lambda$queryExec$0(query.java:237) ~[jena-cmds-4.3.2.jar:4.3.2]
at org.apache.jena.system.Txn.exec(Txn.java:77) [jena-arq-4.3.2.jar:4.3.2]
at org.apache.jena.system.Txn.executeRead(Txn.java:115)
[jena-arq-4.3.2.jar:4.3.2]
at arq.query.queryExec(query.java:234) [jena-cmds-4.3.2.jar:4.3.2]
at arq.query.exec(query.java:157) [jena-cmds-4.3.2.jar:4.3.2]
at org.apache.jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
[jena-cmds-4.3.2.jar:4.3.2]
at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:58)
[jena-cmds-4.3.2.jar:4.3.2]
at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:45)
[jena-cmds-4.3.2.jar:4.3.2]
at tdb.tdbquery.main(tdbquery.java:33) [jena-cmds-4.3.2.jar:4.3.2]
Exception
java.lang.NullPointerException: check(?P, null): null node value
at
org.apache.jena.sparql.engine.binding.BindingBuilder.checkAdd(BindingBuilder.java:393)
at
org.apache.jena.sparql.engine.binding.BindingBuilder.add(BindingBuilder.java:145)
at
org.apache.jena.sparql.engine.binding.BindingBuilder.addAll(BindingBuilder.java:156)
at
org.apache.jena.sparql.engine.binding.BindingFactory.copy(BindingFactory.java:137)
at
org.apache.jena.sparql.resultset.ResultSetMem.<init>(ResultSetMem.java:90)
at
org.apache.jena.query.ResultSetFactory.makeRewindable(ResultSetFactory.java:312)
at org.apache.jena.query.ResultSet.rewindable(ResultSet.java:90)
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.output$(ResultSetWriterText.java:132)
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:120)
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.output(ResultSetWriterText.java:116)
at
org.apache.jena.riot.resultset.rw.ResultSetWriterText.write(ResultSetWriterText.java:59)
at
org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:161)
at
org.apache.jena.riot.resultset.rw.ResultsWriter.write(ResultsWriter.java:131)
at
org.apache.jena.sparql.util.QueryExecUtils.outputResultSet(QueryExecUtils.java:153)
at
org.apache.jena.sparql.util.QueryExecUtils.doSelectQuery(QueryExecUtils.java:170)
at
org.apache.jena.sparql.util.QueryExecUtils.executeQuery(QueryExecUtils.java:101)
at arq.query.lambda$queryExec$0(query.java:237)
at org.apache.jena.system.Txn.exec(Txn.java:77)
at org.apache.jena.system.Txn.executeRead(Txn.java:115)
at arq.query.queryExec(query.java:234)
at arq.query.exec(query.java:157)
at org.apache.jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:58)
at org.apache.jena.cmd.CmdMain.mainRun(CmdMain.java:45)
at tdb.tdbquery.main(tdbquery.java:33)

That was querying with Jena 4.3.2 ; same result with 4.0.0


>      Andy
>
> >
> > Jean-Marc Vanel
> > <
> http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> >
> > +33 (0)6 89 16 29 52
> > Twitter: @jmvanel , @jmvanel_fr
> >
>

Re: Datatype format exception : float - detect the incorrect triple

Posted by Andy Seaborne <an...@apache.org>.

On 01/01/2022 22:24, Jean-Marc Vanel wrote:
> The situation with my data is not so bad !
> Doing SPARQL query on rdf:type of my 2 main classes works fine (I have only
> a handful of user entered RDF classes, the rest are copies of Internet RDF
> data ).
> And strangely, I get correct float data for this particular triple in the
> original post:
>      <http://semantic-forms.cc:1952/ldp/1640450652251-3388247986206631>
>               <http://www.w3.org/2003/01/geo/wgs84_pos#long>
>                      *"4.77962"*^^<http://www.w3.org/2001/XMLSchema#float> .
                          ^^^
And that's a decimal point.

xsd:float are not locale sensitive.

See the javadoc for Float.toString.

> So my binary TDB database is corrupted, but once again, I'm able to recover
> the important data.
> And that 's an opportunity to test TDB2 ...

TDB2 is transactional only. This will get concurrency right for you.

     Andy

> 
> Jean-Marc Vanel
> <http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
> +33
> (0)6 89 16 29 52
> 
> 
> Le sam. 1 janv. 2022 à 22:36, Andy Seaborne <an...@apache.org> a écrit :
> 
>>
>>
>> On 01/01/2022 20:50, Andy Seaborne wrote:
>>>
>>>
>>> On 01/01/2022 19:45, Jean-Marc Vanel wrote:
>>>> During TDB initialization, I get this warning :
>>>> WARN  o.apache.jena.sparql.expr.NodeValue - Datatype format exception:
>>>> "4,77962"^^xsd:float
>>>>
>>>> But I am unable to detect the incorrect triple , with this query :
>>>> PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
>>>> SELECT * WHERE {
>>>>     ?S ?P "4,77962"^^xsd:float .
>>>> }
>>>>
>>>> I also tried this:
>>>> SELECT * WHERE {
>>>>     ?S ?P ?O.
>>>>     FILTER ( STR(?O) = "4,77962" )
>>>
>>> Try
>>>
>>> FILTER ( CONTAINS(STR(?O), "779") )
>>>
>>>> }
>>>>
>>>> This uses the latest jena Version 4.3.2 , with TDB 1 .
>>>> I suspect this bad data prevents geosparl queries from getting any
>>>> result.
>>
>> "4,77962"^^xsd:float has no value.
>>
>> So if you are using geo, you have a lat without a long or viceversa.
>> It's not legal data and will not be indexes or in the results of a
>> geo-spatial query.
>>
>>>
>>> Did it work in a previous version?
>>> Did you load the TDB database with 4.3.2?
>>> Does it work with TDB2?
>>> Does the original data have a comma in a float?
>>>
>>>       Andy
>>>
>>>>
>>>> Jean-Marc Vanel
>>>> <
>> http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
>>
>>>>
>>>> +33 (0)6 89 16 29 52
>>>> Twitter: @jmvanel , @jmvanel_fr
>>>>
>>
> 

Re: Datatype format exception : float - detect the incorrect triple

Posted by Jean-Marc Vanel <je...@gmail.com>.
The situation with my data is not so bad !
Doing SPARQL query on rdf:type of my 2 main classes works fine (I have only
a handful of user entered RDF classes, the rest are copies of Internet RDF
data ).
And strangely, I get correct float data for this particular triple in the
original post:
    <http://semantic-forms.cc:1952/ldp/1640450652251-3388247986206631>
             <http://www.w3.org/2003/01/geo/wgs84_pos#long>
                    *"4.77962"*^^<http://www.w3.org/2001/XMLSchema#float> .

So my binary TDB database is corrupted, but once again, I'm able to recover
the important data.
And that 's an opportunity to test TDB2 ...

Jean-Marc Vanel
<http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
+33
(0)6 89 16 29 52


Le sam. 1 janv. 2022 à 22:36, Andy Seaborne <an...@apache.org> a écrit :

>
>
> On 01/01/2022 20:50, Andy Seaborne wrote:
> >
> >
> > On 01/01/2022 19:45, Jean-Marc Vanel wrote:
> >> During TDB initialization, I get this warning :
> >> WARN  o.apache.jena.sparql.expr.NodeValue - Datatype format exception:
> >> "4,77962"^^xsd:float
> >>
> >> But I am unable to detect the incorrect triple , with this query :
> >> PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
> >> SELECT * WHERE {
> >>    ?S ?P "4,77962"^^xsd:float .
> >> }
> >>
> >> I also tried this:
> >> SELECT * WHERE {
> >>    ?S ?P ?O.
> >>    FILTER ( STR(?O) = "4,77962" )
> >
> > Try
> >
> > FILTER ( CONTAINS(STR(?O), "779") )
> >
> >> }
> >>
> >> This uses the latest jena Version 4.3.2 , with TDB 1 .
> >> I suspect this bad data prevents geosparl queries from getting any
> >> result.
>
> "4,77962"^^xsd:float has no value.
>
> So if you are using geo, you have a lat without a long or viceversa.
> It's not legal data and will not be indexes or in the results of a
> geo-spatial query.
>
> >
> > Did it work in a previous version?
> > Did you load the TDB database with 4.3.2?
> > Does it work with TDB2?
> > Does the original data have a comma in a float?
> >
> >      Andy
> >
> >>
> >> Jean-Marc Vanel
> >> <
> http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
>
> >>
> >> +33 (0)6 89 16 29 52
> >> Twitter: @jmvanel , @jmvanel_fr
> >>
>

Re: Datatype format exception : float - detect the incorrect triple

Posted by Andy Seaborne <an...@apache.org>.

On 01/01/2022 20:50, Andy Seaborne wrote:
> 
> 
> On 01/01/2022 19:45, Jean-Marc Vanel wrote:
>> During TDB initialization, I get this warning :
>> WARN  o.apache.jena.sparql.expr.NodeValue - Datatype format exception:
>> "4,77962"^^xsd:float
>>
>> But I am unable to detect the incorrect triple , with this query :
>> PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
>> SELECT * WHERE {
>>    ?S ?P "4,77962"^^xsd:float .
>> }
>>
>> I also tried this:
>> SELECT * WHERE {
>>    ?S ?P ?O.
>>    FILTER ( STR(?O) = "4,77962" )
> 
> Try
> 
> FILTER ( CONTAINS(STR(?O), "779") )
> 
>> }
>>
>> This uses the latest jena Version 4.3.2 , with TDB 1 .
>> I suspect this bad data prevents geosparl queries from getting any 
>> result.

"4,77962"^^xsd:float has no value.

So if you are using geo, you have a lat without a long or viceversa. 
It's not legal data and will not be indexes or in the results of a 
geo-spatial query.

> 
> Did it work in a previous version?
> Did you load the TDB database with 4.3.2?
> Does it work with TDB2?
> Does the original data have a comma in a float?
> 
>      Andy
> 
>>
>> Jean-Marc Vanel
>> <http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me> 
>>
>> +33 (0)6 89 16 29 52
>> Twitter: @jmvanel , @jmvanel_fr
>>

Re: Datatype format exception : float - detect the incorrect triple

Posted by Andy Seaborne <an...@apache.org>.

On 01/01/2022 19:45, Jean-Marc Vanel wrote:
> During TDB initialization, I get this warning :
> WARN  o.apache.jena.sparql.expr.NodeValue - Datatype format exception:
> "4,77962"^^xsd:float
> 
> But I am unable to detect the incorrect triple , with this query :
> PREFIX xsd:  <http://www.w3.org/2001/XMLSchema#>
> SELECT * WHERE {
>    ?S ?P "4,77962"^^xsd:float .
> }
> 
> I also tried this:
> SELECT * WHERE {
>    ?S ?P ?O.
>    FILTER ( STR(?O) = "4,77962" )

Try

FILTER ( CONTAINS(STR(?O), "779") )

> }
> 
> This uses the latest jena Version 4.3.2 , with TDB 1 .
> I suspect this bad data prevents geosparl queries from getting any result.

Did it work in a previous version?
Did you load the TDB database with 4.3.2?
Does it work with TDB2?
Does the original data have a comma in a float?

     Andy

> 
> Jean-Marc Vanel
> <http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
> +33 (0)6 89 16 29 52
> Twitter: @jmvanel , @jmvanel_fr
>