Error java.lang.NumberFormatException

33 views
Skip to first unread message

Idafen Santana Pérez

unread,
Oct 14, 2011, 1:33:49 PM10/14/11
to topbrai...@googlegroups.com
Hello,

I'm working with the spin java API (1.2.0 version) and found something
I think could be considered as a bug. The following code works fine
with the "OWL_DL_MEM_TRANS_INF" spec for loading the OntModel:

Resource r = ontModel.getResource(sQuery);
Resource body = r.getProperty(SPIN.body).getResource();
org.topbraid.spin.model.Query spinQuery = SPINFactory.asQuery(body);
com.hp.hpl.jena.query.Query arqQuery = ARQFactory.get().createQuery(spinQuery);

But when I use the "OWL_MEM_MICRO_RULE_INF" spec (which is a little
more complete one) the program fails at the third line:

Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:470)
at java.lang.Integer.valueOf(Integer.java:554)
at org.topbraid.spin.model.impl.FunctionCallImpl.getArgumentProperties(FunctionCallImpl.java:64)
at org.topbraid.spin.model.impl.FunctionCallImpl.getArguments(FunctionCallImpl.java:49)
at org.topbraid.spin.model.impl.FunctionCallImpl.print(FunctionCallImpl.java:172)
at org.topbraid.spin.model.impl.SelectImpl.printProjectExpression(SelectImpl.java:148)
at org.topbraid.spin.model.impl.SelectImpl.print(SelectImpl.java:78)
at org.topbraid.spin.model.impl.AbstractSPINResourceImpl.toString(AbstractSPINResourceImpl.java:183)
at org.topbradi.spin.examples.utils.mappings.QueryRetriever.getArq(QueryRetriever.java:347)
at org.topbraid.spin.examples.tests.TestQueryRetriever.main(TestQueryRetriever.java:25)

It seems to be a parsing problem, but I'm not really sure. The Sparql
query I'm trying to load is the following:

SELECT ((xsd:float(?nc) * xsd:float(?power)) AS ?ress)
WHERE {
?arg1 myexample:hasNumberCore ?nc .
?arg1 myexample:hasPoer ?power .
}

Has anyone else dealt with this issue or it's just an specific problem
of my model/code? I haven't found any help over the Internet, only a
thread in the group, but it doesn't seem to be the same problem:

http://www.mail-archive.com/topbrai...@googlegroups.com/msg02115.html

Thanks in advance

Regards
Idafen

Holger Knublauch

unread,
Oct 14, 2011, 5:56:15 PM10/14/11
to topbrai...@googlegroups.com

On Oct 15, 2011, at 3:33 AM, Idafen Santana Pérez wrote:

> Hello,
>
> I'm working with the spin java API (1.2.0 version) and found something
> I think could be considered as a bug. The following code works fine
> with the "OWL_DL_MEM_TRANS_INF" spec for loading the OntModel:

Idafen,

activating Jena inferencing over a SPIN RDF graph is not supported because it may infer additional triples that corrupt the structure of SPIN RDF query expressions. If you need inferencing, please only do so over the ontologies/instances but not over the sub-graphs that contain SPIN blank nodes.

Holger

> --
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> topbrai...@googlegroups.com
> To unsubscribe from this group, send email to
> topbraid-user...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en

Reply all
Reply to author
Forward
0 new messages