Lewis,

It has been awhile since I was in this part of the code base but....

in the tpl you will find:

[snip]
#set( $ds = $mgt.dataset($request, "") )
#set( $srvQuery = $mgt.serviceQuery($ds) )
[snip]

      <form action="${ds}/${srvQuery}" method="GET"  accept-charset="UTF-8">
[snip]

so when the form is submitted it will call whatever the dataset
serviceQuery url is.

The SPARQLServer.java contains the code that configures the server.
 Without knowing what changes you have made to your configuration the rest
of this gets a bit difficult, but I will attempt to follow the standard
flow.

in org.apache.jena.fuseki.server.SPARQLServer.builderServer() at approx
line 238 (I'm looking at v 2.10.2-SNAPSHOT)

[snip]
 if ( installManager || installServices ) {
            // TODO Respect port.
            if ( serverConfig.pagesPort != serverConfig.port )
                serverLog.warn("Not supported yet - pages on a different
port to services") ;

            String base = serverConfig.pages ;
            Map<String, Object> data = new HashMap<String, Object>() ;
            data.put("mgt", new MgtFunctions()) ;
            SimpleVelocityServlet templateEngine = new
SimpleVelocityServlet(base, data) ;
            addServlet(context, templateEngine, "*.tpl", false) ;
        }
[snip]

This codes provides the mgt variable ($mgt above) in the tpl file.
All *.tpl flow through the templateEngine servlet.

At line approx line 320 you will find

[snip]
        HttpServlet sparqlQuery = new SPARQL_QueryDataset() ;
        HttpServlet sparqlUpdate = new SPARQL_Update() ;
        HttpServlet sparqlUpload = new SPARQL_Upload() ;
        HttpServlet sparqlHttpR = new SPARQL_REST_R() ;
        HttpServlet sparqlHttpRW = new SPARQL_REST_RW() ;
        HttpServlet sparqlDataset = new SPARQL_UberServlet.AccessByConfig()
;

        if ( !überServlet ) {
            // If uberserver, these are unnecessary but can be used.
            // If just means the überservlet isn't handling these
operations.
            addServlet(context, datasetPath, sparqlQuery, dsDesc.query,
enableCompression) ;
            addServlet(context, datasetPath, sparqlUpdate, dsDesc.update,
false) ;
            addServlet(context, datasetPath, sparqlUpload, dsDesc.upload,
false) ; // No point - no results of any size.
            addServlet(context, datasetPath, sparqlHttpR,
dsDesc.readGraphStore, enableCompression) ;
            addServlet(context, datasetPath, sparqlHttpRW,
dsDesc.readWriteGraphStore, enableCompression) ;
            // This adds direct operations on the dataset itself.
            // addServlet(context, datasetPath, sparqlDataset,
            // ListOfEmptyString, enableCompression) ;
        } else {
 [snip]

This is where the sparqlQuery servlet is registered to handle the general
/{dataset}/sparql endpoint.

in org.apache.jena.fuseki.servlets.SPARQL_QueryDataset at approx line 44 is
the method decideDataset().  That method should be called when fuseki
attempts to match the query with the dataset you want to query.  A
breakpoint in that method should get you into the code that is executing.

Hope this helps,
Claude


On Fri, Aug 2, 2013 at 12:58 AM, Lewis John Mcgibbney <
lewis.mcgibb...@gmail.com> wrote:

> Hi Andy,
> On Wed, Jul 24, 2013 at 12:32 AM, Andy Seaborne <a...@apache.org> wrote:
>
> >
> > Also I've never worked with .tpl files before... they look similar but I
> am
> >> not familiar...
> >>
> >
> > .tpl files are Velocity files.  I decided to hide the technology used by
> > calling them "tpl" not "vm" in case it changes.
> >
> >
>
> I have the feeling that I need to edit the velocity file (.tpl) as well as
> the .html if I want to add modify the query form.
> Can you confirm if this is the case.
> I am trying to follow my query through from form submission to execution of
> the Java code within the Fuseki servlets... right now this is not happening
> for me.
> Any guidance on how I can get dug in here would be great.
> It would also make my life that little bit easier... oh and my upcoming
> weekend (what weekend!!!) that little bit easier :0)
> Thank you v much.
> Lewis
>



-- 
I like: Like Like - The likeliest place on the web<http://like-like.xenei.com>
Identity: https://www.identify.nu/user.php?cla...@xenei.com
LinkedIn: http://www.linkedin.com/in/claudewarren

Reply via email to