Hi Holger ,

Thanks for pointing me in the right direction. The problem was caused by 
missing out an argument the ,"#" in the query below, although it was 
accepted as valid without it.

Whist on the subject of functions , if I could take the liberty of asking 
you to clarify what is the difference between spif:buildUri and 
smf:buildUri, I currently use smf:buildUri, I think I got the reference 
from one of the tutorials or the scripts file, but looking at the help 
pages function is listed with  spif as the qname

Thanks again John

CONSTRUCT {
    ?this coreModel:source ?uri .
}
WHERE {
    BIND (afn:namespace(?this) AS ?nameSpace) .
    BIND (fn:substring(?nameSpace, 1, 42) AS ?subString) .
    BIND (fn:substring(?nameSpace, 44) AS ?subString1) .
    BIND (fn:substring(?subString1, 1, spif:lastIndexOf(?subString1, "#")) 
AS ?localName) .
    BIND (?localName AS ?boundLocalName) .
    BIND (smf:buildURI("{?subString}#{?boundLocalName}") AS ?uri) .
}



On Wednesday, 17 October 2012 00:04:34 UTC+1, John Perdoni wrote:
>
> Hi again
>
> Today I decided to clear up all models by going to the triples view and 
> deleting all triples with a J.0 etc namespace. 
>
> However when completing this task (not really  sure if it is relavant)  
> when I now  try to run inferences i get the following error 
>
> Message Could not execute inferences
>
> Exception Stack Trace
>
> ava.lang.reflect.InvocationTargetException
>     at 
> org.topbraidcomposer.inference.change.InferenceChange.run(InferenceChange.java:106)
>     at 
> org.topbraidcomposer.inference.change.InferenceChange.execute(InferenceChange.java:58)
>     at 
> org.topbraid.core.change.ChangeOperation.execute(ChangeOperation.java:105)
>     at 
> org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
>     at 
> org.topbraid.core.change.AbstractChangeEngine.execute(AbstractChangeEngine.java:271)
>     at 
> org.topbraidcomposer.core.change.TBCChangeEngine.execute(TBCChangeEngine.java:193)
>     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.NullPointerException
>     at 
> org.topbraid.spin.functions.internal.string.AbstractIndexOfFunction.exec(AbstractIndexOfFunction.java:25)
>     at 
> org.topbraid.spin.arq.AbstractFunction3.exec(AbstractFunction3.java:24)
>     at 
> org.topbraid.spin.arq.AbstractFunction.exec(AbstractFunction.java:92)
>     at 
> com.hp.hpl.jena.sparql.expr.E_Function.evalSpecial(E_Function.java:52)
>     at 
> com.hp.hpl.jena.sparql.expr.ExprFunctionN.eval(ExprFunctionN.java:90)
>     at 
> com.hp.hpl.jena.sparql.function.FunctionBase.exec(FunctionBase.java:48)
>     at 
> com.hp.hpl.jena.sparql.expr.E_Function.evalSpecial(E_Function.java:52)
>     at 
> com.hp.hpl.jena.sparql.expr.ExprFunctionN.eval(ExprFunctionN.java:90)
>     at com.hp.hpl.jena.sparql.core.VarExprList.get(VarExprList.java:64)
>     at 
> com.hp.hpl.jena.sparql.engine.iterator.QueryIterAssign.accept(QueryIterAssign.java:43)
>     at 
> com.hp.hpl.jena.sparql.engine.iterator.QueryIterProcessBinding.hasNextBinding(QueryIterProcessBinding.java:52)
>     at 
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66)
>     at 
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:28)
>     at 
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66)
>     at 
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorWrapper.hasNextBinding(QueryIteratorWrapper.java:28)
>     at 
> com.hp.hpl.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:66)
>     at 
> com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execConstruct(QueryExecutionBase.java:117)
>     at 
> com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execConstruct(QueryExecutionBase.java:100)
>     at 
> org.topbraid.spin.inference.SPINInferences.runCommandOnClass(SPINInferences.java:326)
>     at 
> org.topbraid.spin.inference.SPINInferences.run(SPINInferences.java:251)
>     at 
> org.topbraid.spin.sparqlmotion.modules.impl.ApplyTopSPINModule.addNewTriples(ApplyTopSPINModule.java:126)
>     at 
> org.topbraid.spintb.inference.SPINInferenceEngine.addTriples(SPINInferenceEngine.java:84)
>     at 
> org.topbraid.inference.change.AbstractInferenceChange.runReallyNow(AbstractInferenceChange.java:158)
>     at 
> org.topbraid.inference.change.AbstractInferenceChange.runReally(AbstractInferenceChange.java:125)
>     at 
> org.topbraidcomposer.inference.change.InferenceChange.access$0(InferenceChange.java:1)
>     at 
> org.topbraidcomposer.inference.change.InferenceChange$3.run(InferenceChange.java:90)
>     at java.lang.Thread.run(Unknown Source)
>
> Session Data
>
> eclipse.buildId=unknown
> java.version=1.6.0_26
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
> Command-line arguments:  -os win32 -ws win32 -arch x86_64
>
> Any ideas ...
>
> Regards John
>
> ps version of TBC is Version: 3.6.1.v20120622-1546R
>
>

-- 
-- 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


Reply via email to