On 1/09/2016 10:44, Adam Kimball wrote:

Holger,

That helps a ton.  However, a couple more things come to mind:

1. Is there a difference between *.ui.* and *.spin.* - are there other variants where the filename has implications on something?


Yes there seems to be a difference in that the SPIN templates don't get registered from .ui. files.

Another one is .sms. for SPARQLMotion services (most of which can now also be expressed and used in SWP).

2. How do prefix's work? I'm not a big fan of having the templates (or swp modules) living global lives, I'd like them to at least be behind a namespace. So in my simplistic example, I want to call /template/myPrefix/HelloWorld. I've noticed some # prefix: <somePrefix> statements in the TTL - are these related? How is the prefix shared with TBL?


Whenever you use prefixes, make sure that these are unique, and no other file re-defines them with a different namespace. The # prefix line is not needed - it's just a hint for TopBraid so that it knows which prefix is defined in which file, without having to parse the whole file. The tbl/template servlet will recognize all prefixes defined in .spin. files.

HTH
Holger


Thanks a ton!

Adam

*From: *<[email protected]> on behalf of Holger Knublauch <[email protected]> *Reply-To: *"[email protected]" <[email protected]>
*Date: *Wednesday, August 31, 2016 at 5:50 PM
*To: *"[email protected]" <[email protected]>
*Subject: *Re: [topbraid-users] Spin templates not found

The file naming such as .spin. or .ui. determines whether a service is globally known to the system when called via the servlet. SPIN templates usually cannot depend on SWP/SWON, however SWP can reference SPIN, so a natural organization of your code would be to split it into multiple files - one for the (more general) SPIN modules and others for the SWP stuff. The SWP file can owl:import the SPIN file. That's also the way that we usually organize our code.

The name of the file has no relation with the qnames - that's an orthogonal topic.

Holger

On 1/09/2016 9:47, Adam Kimball wrote:

    Thanks for the reply.

    How does the name effect the binding of a template? My plan was to
    group logically related templates together in a single file with a
    name that represents the use case or application that they enable.
    In my work now this means I have a named select template paired
with a SWP/SWON element to fulfill some integration use case. Does the name have a certain relationship to the qname? Do the
    prefixes I declare in this file map to the qname of the template?

    Mostly I want a sense of the underlying implementation so that I
    properly understand what is going on.

    -Adam

    On Wednesday, August 31, 2016 at 5:34:55 PM UTC-6, Holger
    Knublauch wrote:

        Renaming the file to helloworld.spin.ttlx worked for me. Could
        you try that?

        Also note that if you run this stand-alone, without the file
        in TBC-ME open, you will get a NullPointer because no query
        graph has been specified. Use the _base argument to pass that
        in, if you get to that stage.

        Thanks
        Holger

        On 1/09/2016 9:14, Adam Kimball wrote:

            Hi all,

            I'm pulling my hair out trying to invoke a spin template
            via the swp servlet in TB Live via TBC ME.  I've created a
            new file /hello.world.ui.ttlx. /The complete definition is
            utterly simple:

            service-sdl:HelloWorld
              rdf:type spin:SelectTemplate ;
              spin:body [
                  rdf:type sp:Select ;
                  sp:limit "100"^^xsd:long ;
                  sp:where (
                      [
                        sp:object [
                            sp:varName "p"^^xsd:string ;
                          ] ;
                        sp:predicate [
                            sp:varName "p"^^xsd:string ;
                          ] ;
                        sp:subject [
                            sp:varName "s"^^xsd:string ;
                          ] ;
                      ]
                    ) ;
                ] ;
              rdfs:label "The simplest test"^^xsd:string ;
              rdfs:subClassOf spin:SelectTemplate ;
            .

            In other worlds, we have a hello world template that
            returns 200 triples with no other considerations.  The
            file itself declares the prefix:

            # baseURI: http://metadata.healthwise.org/services/sdl
            <http://metadata.healthwise.org/services/sdl>
            # imports: http://uispin.org/swon
            # prefix: service-sdl
            ...boiler-plate...
            @prefix service-sdl:
            <http://metadata.healthwise.org/services/sdl#>
            <http://metadata.healthwise.org/services/sdl> .

            When I hit the TBL web services report, I clearly see it
            listed and the generated docs tell me I can get to it via:

            |template//HelloWorld?|

            or

            |template?_template=:HelloWorld&|


            However, I get a 500 Error when I hit:
            http://localhost:8083/tbl/template//HelloWorld
            <http://localhost:8083/tbl/template/HelloWorld>? (

            Summary: [Cannot find a SPIN template with qname 
service-sdl:HelloWorld]) or by adding a qname 
at:http://localhost:8083/tbl/template/service-sdl/HelloWorld?

            Gives me more or less the same error:   Summary: [Cannot find a 
SPIN template with qname :HelloWorld]

            I have spent more time than I care to admit fighting to get this 
working.  I've refreshed the registries regularly and everything else that 
holds promise.  But the fact is that I simply don't understand how the qname's 
are bound, how they can show in the web service docs but be unavailable.

            It can't be this difficult, I know there is a bone-headed mistake I 
am making - but what?

            -Adam

            -- You received this message because you are subscribed to
            the Google Group "TopBraid Suite Users", the topics of
            which include the TopBraid Suite family of products and
            its base technologies such as SPARQLMotion, SPARQL Web
            Pages and SPIN. To post to this group, send email to
            [email protected] <javascript:> --- 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] <javascript:>.
            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
    the TopBraid Suite family of products and its base technologies
    such as SPARQLMotion, SPARQL Web Pages and SPIN. To post to this
    group, send email to [email protected]
    <mailto:[email protected]> --- 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 the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
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 the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
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 the TopBraid Suite family of products and 
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
--- 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