IInMemoryQueryableStoreExecuteQuery Method (IRdfHandler, ISparqlResultsHandler, String)
Note: This API is now obsolete.
[ObsoleteAttribute("This method of making queries is often error prone due to misconceptions about what data is being queries and we recommend using an ISparqlQueryProcessor instead, see remarks for more discussion")] void ExecuteQuery( IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string query )
This method of making queries often leads to no results because of misconceptions about what data is being queries. dotNetRDF's SPARQL engine only queries the default unnamed graph of the triple store (the graph added with a null URI) by default unless your query uses FROM clauses to change the default graph or you use GRAPH clauses to access named graphs in the store. Therefore a common mistake is to add a single graph to the store and then query the store which typically results in no results because usually the added graph is named and so is not queried.
We recommend using a ISparqlQueryProcessor instead for making queries over in-memory data since using our standard implementation (LeviathanQueryProcessor) affords you much more explicit control over which graphs are queried.