Alison; Make sure you are importing all of the necessary file,
including http://spinrdf.org/spin, http://spinrdf.org/spl, etc.

TopBraid Composer/Live takes care of these details when running inside
of the tool suite.  But when using the SPIN API, you will need to
reproduce the environment that TopBraid
 sets up.  In particular, TopBraid registers all .spin files so that
their functions can be used in any open model. There may be a way to
set this up within the SPIN API, and Holger can say more in that
respect.

-- Scott

On Jun 20, 9:32 am, Alison Callahan <[email protected]> wrote:
> Hello Scott and Holger,
> Thanks for your previous replies.
> Using TopBraid Composer 3.5.0 I have successfully used the '+' operator in
> test SPARQL queries and also in a spin:rule, which adds new triples when I
> run inferences in TBC. However, when I load the same RDF SPIN file
> containing this rule using the TopBraid SPIN API 1.2.0 and run the
> inferences using the SPINInferences.run() method with the following
> signature,
>
> public static int
> run(com.hp.hpl.jena.rdf.model.Model queryModel,
> com.hp.hpl.jena.rdf.model.Model newTriples, SPINExplanations
> explanations, List<SPINStatistics> statistics, boolean singlePass,
> ProgressMonitor monitor)
>
> no new triples are added to the newTriples model and the following WARN
> message is printed:
>
> WARN [main] (E_Function.java:70) - URI <http://spinrdf.org/sp#add> has no
> registered function factory
>
> The SPIN RDF file importshttp://spinrdf.org/spinas well as my ontology,
> which describes the classes/object properties/data properties used in the
> spin:rule. Why doesn't the '+' operator work when I load this RDF as a model
> using the TopBraid SPIN API and Jena?
>
> Thanks,
>
> Alison
>
> On Wed, Jun 15, 2011 at 7:07 PM, Holger Knublauch 
> <[email protected]>wrote:
>
>
>
>
>
>
>
> > The functions from the sp: namespace are just the URIs used by the SPIN RDF
> > syntax to represent the SPARQL built-ins. Please use + etc as Scott
> > suggested instead.
>
> > Holger
>
> > On Jun 16, 2011, at 1:32 AM, Alison Callahan wrote:
>
> > Hello all,
>
> > I am trying to execute a SPARQL query in like the one below TopBraid
> > Composer 3.5.0. The query includes the sp:add() function as follows:
>
> > SELECT ?sum
> > WHERE {
> >         ....
> >         [some SPARQL to get ?numberone and ?numbertwo]
> >         .....
> >   ?numberone test:has-value ?nonevalue .
> >  ?numbertwo rule-test:has-value ?ntwovalue .
> > LET(?sum := sp:add(?nonevalue, ?ntwovalue)) .
> > }
>
> > The problem is that when I execute this query, the returned ?sum variable
> > is empty. 'test:has-value' is a datatype property I defined in the test
> > ontology I am using to play around.
>
> > Any help is appreciated, thanks,
>
> > Alison
>
> > --
> > 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

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