Paul,
We have to add to IdAS API the ability to add/find/delete a sub-Context within a Context. I hope SergeyL can suggest
a straw man change.
As I undersntand, we should use the following mapping for NG4J interfaces:
a) Context to NamedGraphSet interface.
b) SubContext to NamedGraph interface.
NamedGraphSet is just a collection of NamedGraphs, so, it is not possible for a SubContest to contain its own SubContexts (only a "root" Context can contain SubContexts).
As a result, I would propose:
1. rename the current IContext interface to something like IBaseContext interface.
2. add ISubContext interface extends IBaseContext interface.
3. add IContext interface, that extends IBaseContext, with the following methods:
a) Iterator getSubContexts();
b) ISubContext getSubContext(URI subContextID) (where subContextID is a name of an appropriate graph);
c) ISubContext addSubContext(URI subContextID);
d) ISubContext removeSubContext(URI subContextID);
e) ISubContext contextualize(entityid, attributes[]);
f) void contextualize(entityid, attributes[], ISubContext) - moves attributes into passed subcontext;
BTW, because NamedGraph can contain a separate triplets, we can add the following methods to contextualize an individual value:
g) ISubContext contextualize(IEntity, IValue);
h) void contextualize(IEntity, IValue, ISubContext).