Fixed #374055:Only the first "tag" is detected in digikam.
[beagle.git] / Util / SemWeb / KnowledgeModel.cs
blob8872fda89fbf0963e2b9ca69508f3bb8cacecd83
1 using System;
2 using System.Collections;
3 using System.IO;
4 using System.Text;
6 using SemWeb;
7 using SemWeb.Reasoning;
9 namespace SemWeb.Stores {
11 public class KnowledgeModel : Store {
13 SemWeb.Stores.MultiStore stores;
14 Store mainstore;
16 public KnowledgeModel() {
17 stores = new SemWeb.Stores.MultiStore();
18 mainstore = stores;
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) {
28 Storage.Add(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);