Changeset 2137 for trunk/sources/HeuristicLab.CEDMA.DB/3.3/Store.cs
- Timestamp:
- 07/06/09 19:52:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.DB/3.3/Store.cs
r2053 r2137 75 75 SemWeb.N3Reader n3Reader = new SemWeb.N3Reader(new StringReader(query)); 76 76 SemWeb.Query.GraphMatch matcher = new SemWeb.Query.GraphMatch(n3Reader); 77 matcher.Run(store, resultSink); 77 if (memStore == null) { 78 CacheStore(); 79 } 80 matcher.Run(memStore, resultSink); 78 81 return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList(); 79 82 } 80 83 } 81 84 85 SemWeb.Store memStore; 86 private void CacheStore() { 87 memStore = new SemWeb.MemoryStore(); 88 memStore.Import(store); 89 } 90 82 91 public ICollection<VariableBindings> Query(ICollection<Statement> query, int page, int pageSize) { 83 92 lock (bigLock) { 84 93 MyQueryResultSink resultSink = new MyQueryResultSink(); 85 Translate(query).Run(store, resultSink); 94 if (memStore == null) { 95 CacheStore(); 96 } 97 Translate(query).Run(memStore, resultSink); 86 98 return resultSink.Bindings.Skip(page * pageSize).Take(pageSize).ToList(); 87 99 }
Note: See TracChangeset
for help on using the changeset viewer.