Hi Monika,

the SPIN API is designed to be driven in the same way that SPIN files are driven - by declarations in RDF. In other words, the proper way of defining SPIN functions is to edit them with an RDF editor (such as TopBraid or a text editor) and then simply load the function definitions into the module registry. This is shown in the KennedysInferencingAndConstraintsExample via

        // Register locally defined functions
        SPINModuleRegistry.get().registerAll(ontModel, null);

then just use them in your SPARQL/SPIN queries. In the SPIN RDF syntax - if you ever want to generate that programmatically, use the Jena API to create the corresponding triples - a SPIN function call is simply an instance of the function class.

You may want to clarify which parts of your application are statically edited and which ones are dynamically produced for further advise.

Holger


On 7/20/2014 5:16, Monika Solanki wrote:
I am fairly new to SPIN and the SPIN API. I am looking for examples that show how to create a user defined function using the SPIN API and use it within a query that runs over a model. I am mostly aware of how I could develop the second part, but I would like help on programmatically creating the user defined function.

Many Thanks,

Monika
--
-- 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 Insight, 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] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
-- 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 Insight, 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/d/optout.

Reply via email to