Hi All

Following up on a previous discussion by colleague Tim had 
(http://mail-archives.apache.org/mod_mbox/incubator-jena-users/201102.mbox/%[email protected]%3E)
 with regards to adding FROM/FROM NAMED support to Fuseki.

We need this for our own work so are willing to do the coding and submit it to 
the project as a patch we'd just appreciated some guidance on how best to 
implement this.

It is easy to find where to turn off the automatic error messages for use of a 
FROM/FROM NAMED clause as that just requires commenting out a couple of lines 
of code in SPARQL_QueryDataset in the validateQuery() method.  What we are 
struggling to understand is how we can actually get the dataset to change, 
there is a decideDataset() method which would seem to be the obvious place to 
make changes to the dataset and this is what we have so far:

    @Override
    protected Dataset decideDataset(HttpActionQuery action, Query query, String 
queryStringLog)
    {
       if (query.hasDatasetDescription())
       {
             if (query.getGraphURIs().size() > 0)
             {
                    return DatasetFactory.create(query.getGraphURIs(), 
query.getNamedGraphURIs(), null, null);
             }
             else
             {
                    //TODO: How do we create a dataset that preserves the known 
default graph and just adds the named graphs?
                    errorBadRequest("Query with FROM NAMED without any FROM 
clauses not yet supported");
                    return null;
             }
       }
       else
       {
             return DatasetFactory.create(action.dsg) ;
       }
    }

Are we on the right lines here or is this not an appropriate place/way to 
achieve this?

Also how would you suggest handling the second case where we have some FROM 
NAMED clauses but no FROM clauses i.e. the default graph remains unchanged.  
How exactly do we construct a dataset that expresses that?

Thanks,

Rob Vesse

Reply via email to