Aklakan commented on code in PR #3184: URL: https://github.com/apache/jena/pull/3184#discussion_r2256603786
########## jena-examples/src/main/java/arq/examples/ExampleDBpediaViaRemoteDataset.java: ########## @@ -0,0 +1,43 @@ +package arq.examples; + +import java.util.concurrent.TimeUnit; + +import org.apache.jena.rdflink.RDFLinkHTTP; +import org.apache.jena.rdflink.dataset.DatasetGraphOverRDFLink; +import org.apache.jena.sparql.algebra.Table; +import org.apache.jena.sparql.core.DatasetGraph; +import org.apache.jena.sparql.engine.dispatch.SparqlDispatcherRegistry; +import org.apache.jena.sparql.exec.QueryExec; +import org.apache.jena.sparql.exec.RowSetOps; + +/** + * An example that sends a query to the DBpedia endpoint via the {@link DatasetGraphOverRDFLink} abstraction. + * Technically, the query is passed through Jena's default {@link SparqlDispatcherRegistry}. + */ +public class ExampleDBpediaViaRemoteDataset { + public static void main(String... argv) { + // The query string is sent to the DBpedia endpoint as is (without parsing). + // By default, Jena would fail to parse it because of the undeclared prefixes. Review Comment: The thing is that in this example the query goes via `QueryExec.dataset(dsg)` - at this level the machinery does not see any HTTP involvement. `DatasetGraphOverSparql.initContext()` sets `ARQ.parseCheck=false` for its context. This flag is picked up by `QueryExecBuilderDataset`. Calling `QueryExecBuilder.build()` forwards the query string to `SparqlDispatcherRegistry` . `ChainingQueryDispatcherForDatasetGraphOverRDFLink.java` handles `DatasetGraphOverRDFLink` and forwards the query string on the `RDFLink`. The handler is registered to the global ``SparqlDispatcherRegistry`` in `jena-rdfconnection`. -- 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: pr-unsubscr...@jena.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org For additional commands, e-mail: pr-h...@jena.apache.org