Aklakan opened a new issue, #1557:
URL: https://github.com/apache/jena/issues/1557

   ### Version
   
   4.7.0-SNAPSHOT
   
   ### Feature
   
   As a follow up to the performance issue encountered with [Counting all 
triples performance and named 
graphs](https://www.mail-archive.com/[email protected]&q=subject:%22Re%5C%3A+Counting+all+triples+performance+and+named+graphs%22&o=newest)
 I created an assembler + syntax transform that pushes FROM (NAMED) into 
filters over graphs, such as illustrated below:
   ```
   SELECT * FROM <a> FROM <b> { ?s ?p ?o }
   becomes
   SELECT ?s ?p ?o { GRAPH ?g { ?s ?p ?o } FILTER (?g IN (<a>, <b>)) }
   ```
   Of course this is a non-standard interpretation because it misses the RDF 
merge / DISTINCT operations mandated by the SPARQL spec. However, for large 
datasets having the possibility to explicitly enable this interpretation via a 
custom `(QueryEngineFactoryFromAsFilter, DatasetGraphFromAsFilter)` pair seemed 
reasonable.
   
   The issue is, that Fuseki clears the from (named) clauses in 
[SPARQL_QueryDataset](https://github.com/apache/jena/blob/main/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_QueryDataset.java#L55).
   So my `QueryEngineFactoryFromAsFilter` never gets a change to perform the 
rewriting.
   
   
   The relevant snippet is:
   ```java
   public Pair<DatasetGraph, Query> decideDatasetDynamic(HttpAction action, 
Query query, String queryStringLog) {
           DatasetGraph dsg = getDataset(action);
           DatasetDescription dsDesc = 
SPARQLProtocol.getDatasetDescription(action, query);
           if ( dsDesc != null ) {
               dsg = DynamicDatasets.dynamicDataset(dsDesc, dsg, false);
   ```
   
   My impression is that `DynamicDatasets.dynamicDataset` is NOT needed at this 
place. As I expected, I see that `QueryEngineBase` and `QueryEngineTDB` already 
call `DynamicDatasets` - so is there a reason to also have this in Fuseki?
   I locally changed the method to simply push the protocol graphs (if given) 
into the query and there are no failing tests.
   
   
   
   ### Are you interested in contributing a solution yourself?
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to