History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-849
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: James Leigh
Reporter: Jeen Broekstra
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Sesame

Make default dataset configurable

Created: 10/Oct/11 08:06 AM   Updated: 27/Mar/12 05:18 PM
Component/s: Query Engine, SPARQL
Affects Version/s: None
Fix Version/s: 2.6.5

Issue Links:
Duplicate
This issue duplicates:
SES-428 Make default graph/scope for queries ... Major Reopened
 
Related
This issue is related to:
SES-848 Default graph should correspond 1:1 t... Critical Resolved
This issue is related to:
SES-850 Introduce "pseudo" named graph for ad... Major Open


 Description   
The SPARQL engine's default dataset is currently fixed in the implementation: it consists of a default graph that includes all triples in the store, and zero or more named graphs that correspond to all contexts in the store.

For some use cases, a different dataset strategy would be useful, where the default graph corresponds to _only_ the triples that have no context. In a previous proposal we suggested making this the default mode of operation, but after discussion it was decided not to do this to avoid breaking existing deployments.

However, if it were possible to optionally configure the SPARQL engine or the Repository to adopt a different interpretation, that would gain us a lot of flexibility. Two dataset-modes can immediately be identified:

 * INCLUSIVE (the current behaviour, and this will be the default - the default graph includes everything in the store)
 * EXCLUSIVE (the default graph contains only the triples without a context)




 All   Comments   Change History      Sort Order:
Comment by Arjohn Kampman [11/Oct/11 11:57 AM]
Looks like a dup of SES-428.

Comment by Jeen Broekstra [11/Oct/11 10:01 PM]
Quite right, well spotted, thanks. I'll look into what's available on the 3.0 branch and see about backporting it to Sesame 2 ok?

Comment by James Leigh [22/Mar/12 10:07 PM]
This can already be done with the ContextAwareRepository, by providing the null context as the only readContext.

Comment by James Leigh [24/Mar/12 07:14 PM]
The HTTP protocol has been extended to support the string "null" in graph parameter values as a token to indicate the null context in revision 11681.

ContextAwareConnection con = new ContextAwareConnection(testCon);
URI defaultGraph = null; // null context
con.setReadContexts(defaultGraph);
con.setInsertContext(defaultGraph);
con.setRemoveContexts(defaultGraph);
// any further operations on con (w/o an explicit context)
// will operate on the null context exclusively.

Comment by Jeen Broekstra [26/Mar/12 11:18 PM]
I am not quite sure what the exact cause is, but I am reopening this issue for you to take another look, because the build is currently broken. The following tests currently fail in the build:

>>> org.openrdf.repository.http.RDFSchemaHTTPRepositoryConnectionTest.testDefaultContext 2.187 4
>>> org.openrdf.repository.http.RDFSchemaHTTPRepositoryConnectionTest.testDefaultInsertContext 1.936 4
>>> org.openrdf.repository.http.RDFSchemaHTTPRepositoryConnectionTest.testExclusiveNullContext
>>> org.openrdf.repository.http.RDFSchemaHTTPRepositoryConnectionTest.testExclusiveNullContext 2.992 1
>>> org.openrdf.repository.sail.memory.RDFSchemaMemoryRepositoryConnectionTest.testExclusiveNullContext 0.02 1
>>> org.openrdf.repository.sail.nativerdf.RDFSchemaNativeRepositoryConnectionTest.testExclusiveNullContext 0.026 1
>>> org.openrdf.repository.sail.memory.RDFSchemaMemoryRepositoryConnectionTest.testDefaultContext 0.027 2
>>> org.openrdf.repository.sail.memory.RDFSchemaMemoryRepositoryConnectionTest.testDefaultInsertContext 0.01 2
>>> org.openrdf.repository.sail.nativerdf.RDFSchemaNativeRepositoryConnectionTest.testDefaultContext 0.037 2
>>> org.openrdf.repository.sail.nativerdf.RDFSchemaNativeRepositoryConnectionTest.testDefaultInsertContext 0.02 2

Can you check what's going on?

Comment by James Leigh [26/Mar/12 11:56 PM]
Thanks, those tests don't consider inferencing in the expected number of results. I will adjust the assertions.

Comment by James Leigh [27/Mar/12 05:18 PM]
I disabled the tests for RDF Schema repositories