It seems to be again an issue of using sp:arg instead of sp:arg1.
Admittedly the error message could be better, but please make sure that
none of your functions uses sp:arg. We'll make it more robust in the future.
HTH
Holger
On 6/15/2013 1:05, Alison Callahan wrote:
Hello all,
I have created a SPIN function, let's call it :myAskQuery, that has an
ASK query as its spin:body and thus returns a boolean.
When I try to use this function in the spin:body of another function,
let's call it :returnNumber, that has sp:arg1 as its spin:constraint,
as follows:
SELECT ?returnMe
WHERE {
BIND(:myAskQuery(*?arg1*) AS ?boolean) .
BIND(IF((?boolean = true), 1, 0) AS ?returnMe) .
}
I get the following TopBraid error:
****************
Operation failed.
On: 14-Jun-2013 10:30:14 AM
Reason:
java.lang.IllegalArgumentException: Function
http://example.org#returnNumber does not define a valid body
at org.topbraid.spin.arq.SPINARQFunction.<init>(SPINARQFunction.java:92)
at
org.topbraid.spin.arq.SPINBodyFunctionDriver.doCreate(SPINBodyFunctionDriver.java:21)
at
org.topbraid.spin.arq.SPINBodyFunctionDriver.create(SPINBodyFunctionDriver.java:16)
at
org.topbraid.spin.arq.SPINFunctionDrivers.create(SPINFunctionDrivers.java:50)
at
org.topbraid.spintb.modules.SessionSPINFunctions.getFunctionFactoryFromModel(SessionSPINFunctions.java:107)
at
org.topbraid.spintb.modules.SessionSPINFunctions.getFunctionFactory(SessionSPINFunctions.java:88)
at
org.topbraid.spintb.modules.SPINSessionFunctionRegistry.get(SPINSessionFunctionRegistry.java:58)
at
org.topbraid.spin.arq.SPINThreadFunctionRegistry.get(SPINThreadFunctionRegistry.java:107)
at
org.topbraid.spin.system.SPINModuleRegistry.registerARQFunction(SPINModuleRegistry.java:248)
at
org.topbraid.spin.system.SPINModuleRegistry.register(SPINModuleRegistry.java:204)
at
org.topbraidcomposer.spin.functions.FunctionBodyChangeEngineListener.refreshFunction(FunctionBodyChangeEngineListener.java:62)
at
org.topbraidcomposer.spin.functions.FunctionBodyChangeEngineListener.changeOperationPerformed(FunctionBodyChangeEngineListener.java:43)
at
org.topbraid.core.change.AbstractChangeEngine.notifyListeners(AbstractChangeEngine.java:294)
at
org.topbraidcomposer.core.change.TBCChangeEngine.notifyListeners(TBCChangeEngine.java:232)
at
org.topbraid.core.change.AbstractChangeEngine.handleExecution(AbstractChangeEngine.java:251)
at
org.topbraid.core.change.AbstractChangeEngine.execute(AbstractChangeEngine.java:277)
at
org.topbraidcomposer.core.change.TBCChangeEngine.access$0(TBCChangeEngine.java:1)
at
org.topbraidcomposer.core.change.TBCChangeEngine$2.run(TBCChangeEngine.java:163)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.NumberFormatException: For input string: ""
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:504)
at java.lang.Integer.valueOf(Integer.java:582)
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.util.SPINExpressions.printExpressionString(SPINExpressions.java:204)
at
org.topbraid.spin.model.impl.AbstractSPINResourceImpl.printNestedExpressionString(AbstractSPINResourceImpl.java:146)
at
org.topbraid.spin.model.impl.AbstractSPINResourceImpl.printNestedExpressionString(AbstractSPINResourceImpl.java:141)
at org.topbraid.spin.model.impl.BindImpl.print(BindImpl.java:54)
at
org.topbraid.spin.model.impl.ElementListImpl.print(ElementListImpl.java:139)
at
org.topbraid.spin.model.impl.AbstractSPINResourceImpl.printNestedElementList(AbstractSPINResourceImpl.java:132)
at org.topbraid.spin.model.impl.QueryImpl.printWhere(QueryImpl.java:177)
at org.topbraid.spin.model.impl.SelectImpl.print(SelectImpl.java:99)
at
org.topbraid.spin.arq.ARQFactory.createCommandString(ARQFactory.java:117)
at org.topbraid.spin.arq.SPINARQFunction.<init>(SPINARQFunction.java:71)
... 18 more
****************
Why is the above spin:body not valid?
Thanks,
Alison
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise
Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.