Some rough ideas before my day ends, Tim:

- you can expose SPARQLMotion scripts as web service
- you can turn SPARQLMotion scripts into SPIN functions - if they just return a 
single RDF node.

Assuming you want to return RDF with your function, I believe you could call it 
with SERVICE in SPARQL.

Sorry I didn't have time to try this out yet, but maybe a call against 

SERVICE <http://localhost:8083/tbl/sparqlmotion?id=myScript&id=Test>

could work, if the SPARQLMotion script returns sml:ReturnSPARQLResults. The 
query that SPARQL sends to the end point would be ignored, but the SERVICE 
itself would use the id argument. You would construct the SERVICE URL with a 
variable, e.g. 

BIND (IRI(CONCAT(..., ?id)) AS ?serviceURL) .
SERVICE ?serviceURL { }

Looks like we should add a magic property

        (?s ?p ?o) sm:invokeRDFService (ex:MyService ?arg1 ?arg2) .

for services that use sml:ReturnRDF and

        (?resultVar1 ?resultVar2) sm:invokeSPARQLService (ex:MyService ?arg1 
?arg2) 

for services that use sml:ReturnSPARQLResults as a cleaner alternative...

Holger



On Jan 25, 2013, at 1:23 PM, Tim Smith wrote:

> Hi,
> 
> I have a situation where I'm extracting a recipe from an oracle database 
> (relational).
> 
> Each recipe consists of a list of ingredients.  Each ingredient may consist 
> of one or more ingredients and so on... (think of making a cake with frosting 
> - the frosting is an ingredient for the cake recipe but the frosting really 
> consists of many other ingredients).  The ingredient "hierarchy" can be many 
> levels deep.
> 
> Using a web service, I can retrieve, via xml, a recipe with it's main 
> ingredients.  Repeatedly calling the web service allows me to retrieve all of 
> child ingredients for each "main" ingredient in the recipe.
> 
> Given that this is fully recursive, it seems like an ideal fit for using SPIN 
> with TOPSPIN inferencing.  I was thinking that I could add a SPIN rule that 
> would enable each ingredient to ask for all of it's children ingredients.  
> The inference engine would then iterate until all the children have been 
> retrieved, regardless of the depth of the ingredient hierarchy.
> 
> The only thing that is stopping me is I do not know how to call the web 
> service and convert it to RDF inside a SPIN rule.  I can create an SM script 
> that takes an ingredient ID as input and outputs the xml as RDF but I do now 
> know to call the SM script from within a SPIN rule.
> 
> Is this even possible?  Or should I just do this completely in an SM script?
> 
> Thanks for your input!
> 
> Tim
> 
> -- 
> -- 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
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