Seong; By this do you mean that when you create a template instance for spin:query that it does not appear in the Query Library? If so, this might be an enhancement we can look into, but I'd like to hear a bit more on what you mean by "I use this function [query library] like a template" Just in case there is a mismatch between what yo are looking for an SPIN templates, let em explain a bit.
Using a SPIN template takes two steps. The first is to define the template, specifying the spin:constraints for parameters. The second is to create an instance of the template, binding parameters values to arguments in the instance. (There is a nice blog on this at http://composing-the-semantic-web.blogspot.com/2009/01/understanding-spin-templates.html) A nice example can be found in kspin:InferGrandParent in TopBraid/ Examples/kennedysSPIN.rdf. This defines a template with two parameters, ?gender and ?predicate. Two instances of this template are found in the spin:rule definitions of the kennedys:Person class: a. one passes kspin:grandFather for ?predicate and kennedys:male for ? gender b. the other passes kspin:grandmother for ?predicate and kennedys:female for ?gender When executing, the arguments are bound to the parameters to create a query. For example, the query created by instantiating kspin:InferGrandParent in b. (the :grandFather rule) is: CONSTRUCT { ?this kspin:grandFather ?grandParent . } WHERE { ?this kennedys:parent ?parent . ?parent kennedys:parent ?grandParent . ?grandParent kennedys:gender kennedys:male . } Instances of templates are created by choosing the context menu next to any spin:query property (note spin:rule, etc. are subproperties of spin:query) and choose "Create From SPIN Template". Choose the template name and fill in the arguments that appear. Given this definition, I suppose it could make sense to run a template in the query library, but there would need to be some way to determine the scope of the query. Is it a specific class, (as with :InferGrandParent applied to :Parent) or the entire model, etc. Let us know what your thought and questions are. -- Scott On Apr 11, 11:52 am, seong <[email protected]> wrote: > I'm using Topbraid Composer 3.4.2 and I use the Query Library (in the > SPARQL tab) a lot. I store some queries in the Query Library, and use > them like templates. A query of the query library is saved as a > spin:query in the selected resoruce. It's really good I can store > related queries in a owl file. However since I use this function like > a template, it will be very useful if I can use spin:templates > directly (with arguments) for a query in the Query Editor. Are > spin:templates designed only for spin:constraint, spin:construct,a nd > spin:rule? > > Thanks for your comments in advance!! > > Best regards, > Seong -- 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
