2 using System
.Collections
;
7 using SemWeb
.Reasoning
;
9 namespace SemWeb
.Stores
{
11 public class KnowledgeModel
: Store
{
13 SemWeb
.Stores
.MultiStore stores
;
16 public KnowledgeModel() {
17 stores
= new SemWeb
.Stores
.MultiStore();
21 public KnowledgeModel(RdfReader parser
) : this() {
22 stores
.Add(new MemoryStore(parser
));
25 public SemWeb
.Stores
.MultiStore Storage { get { return stores; }
}
27 public void Add(Store storage
) {
31 public void AddReasoning(ReasoningEngine engine
) {
32 mainstore
= new InferenceStore(mainstore
, engine
);
35 public override Entity
[] GetAllEntities() { return stores.GetAllEntities(); }
37 public override Entity
[] GetAllPredicates() { return stores.GetAllPredicates(); }
39 public override bool Contains(Statement statement
) {
40 return mainstore
.Contains(statement
);
43 public override void Select(Statement template
, SelectPartialFilter partialFilter
, StatementSink result
) {
44 mainstore
.Select(template
, partialFilter
, result
);
47 public override void Select(Statement
[] templates
, SelectPartialFilter partialFilter
, StatementSink result
) {
48 mainstore
.Select(templates
, partialFilter
, result
);
51 public override int StatementCount { get { return stores.StatementCount; }
}
53 public override void Clear() { throw new InvalidOperationException(); }
54 public override void Add(Statement statement
) { throw new InvalidOperationException(); }
55 public override void Remove(Statement statement
) { throw new InvalidOperationException(); }
57 public override void Replace(Entity a
, Entity b
) {
58 mainstore
.Replace(a
, b
);
61 public override void Replace(Statement find
, Statement replacement
) {
62 mainstore
.Replace(find
, replacement
);
65 public override Entity
[] FindEntities(Statement
[] filters
) {
66 return mainstore
.FindEntities(filters
);