Hi Gerrit,

I may need more information to understand this issue. I tried the following and 
got no error. I changed the KennedysInferencingAndConstraintsExample so that it 
also loads the SMF function file
                
                // Create OntModel with imports
                OntModel ontModel = 
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, baseModel);
                Model smfModel = ModelFactory.createDefaultModel();
                smfModel.read("http://topbraid.org/functions-smf";);
                ontModel.addSubModel(smfModel);

And it then ran fine. In your exception trace it seems that the system fails to 
parse the body of that smf:deriveURI function. Could you provide more details 
on how you set up your Java code before you run the constraints?

Thanks
Holger



On Jun 9, 2011, at 7:10 PM, Gerrit wrote:

> When performing constraint checking using
> 
>               // Run all constraints
>               List<ConstraintViolation> cvs = SPINConstraints.check(model, 
> null);
>               System.out.println("Constraint violations:");
>               for(ConstraintViolation cv : cvs) {
>                       System.out.println(" - at " +
> SPINLabels.get().getLabel(cv.getRoot()) + ": " + cv.getMessage());
>               }
> 
> I get the following error:
> 
> java.lang.IllegalArgumentException: Function 
> http://topbraid.org/sparqlmotionfunctions#deriveURI
> does not define a valid body
>       at org.topbraid.spin.arq.SPINARQFunction.<init>(SPINARQFunction.java:
> 71)
>       at
> org.topbraid.spin.arq.SPINBodyFunctionDriver.doCreate(SPINBodyFunctionDriver.java:
> 21)
>       at
> org.topbraid.spin.arq.SPINFunctionDrivers.create(SPINFunctionDrivers.java:
> 31)
>       at
> org.topbraid.spin.system.SPINModuleRegistry.registerARQFunction(SPINModuleRegistry.java:
> 222)
>       at
> org.topbraid.spin.system.SPINModuleRegistry.register(SPINModuleRegistry.java:
> 176)
>       at
> org.topbraid.spin.system.SPINModuleRegistry.registerFunctions(SPINModuleRegistry.java:
> 258)
>       at
> org.topbraid.spin.system.SPINModuleRegistry.registerAll(SPINModuleRegistry.java:
> 207)
>       at
> org.topbraid.spin.system.SPINImports.getImportsModel(SPINImports.java:
> 120)
>       at
> org.topbraid.spin.constraints.SPINConstraints.run(SPINConstraints.java:
> 441)
>       at
> org.topbraid.spin.constraints.SPINConstraints.check(SPINConstraints.java:
> 313)
>       at
> org.topbraid.spin.constraints.SPINConstraints.check(SPINConstraints.java:
> 297)
>       at
> eu.sofia.adk.sib.model.semantic.SemanticModel.query(SemanticModel.java:
> 484)
>       at
> eu.sofia.adk.sib.model.request.QueryRequest.processRequest(QueryRequest.java:
> 135)
>       at eu.sofia.adk.sib.model.request.Request.run(Request.java:94)
>       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:
> 441)
>       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>       at java.util.concurrent.ThreadPoolExecutor
> $Worker.runTask(ThreadPoolExecutor.java:886)
>       at java.util.concurrent.ThreadPoolExecutor
> $Worker.run(ThreadPoolExecutor.java:908)
>       at java.lang.Thread.run(Thread.java:662)
> Caused by: 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.util.SPINExpressions.printExpressionString(SPINExpressions.java:
> 189)
>       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.model.impl.AbstractSPINResourceImpl.toString(AbstractSPINResourceImpl.java:
> 183)
>       at org.topbraid.spin.arq.SPINARQFunction.<init>(SPINARQFunction.java:
> 58)
>       ... 19 more
> 
> I am using SPIN 1.2.0, ARQ 2.8.7 and Jena 2.6.4.
> 
> Regards,
> Gerrit
> 
> -- 
> 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
> [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
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
[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

Reply via email to