- Timestamp:
- 12/15/08 01:22:08 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSet.cs
r957 r988 32 32 public class DataSet { 33 33 public IStore Store { get; set; } 34 public long Id { get; set; } 35 public string Name { get; set; } 34 35 private Guid guid; 36 public Guid Guid { 37 get { return guid; } 38 } 39 40 private string name; 41 public string Name { 42 get { return name; } 43 } 44 36 45 private Problem problem; 37 38 46 public Problem Problem { 39 47 get { return problem; } … … 42 50 public DataSet() 43 51 : base() { 52 guid = Guid.NewGuid(); 44 53 problem = new Problem(); 45 54 } 46 55 47 public DataSet(IStore store, long id)56 public DataSet(IStore store, Entity dataSetEntity) 48 57 : this() { 49 58 Store = store; 50 Id = id; 51 } 52 53 public void Save() { 54 throw new NotImplementedException(); 59 guid = new Guid(dataSetEntity.Uri.Remove(0, Ontology.CedmaNameSpace.Length)); 60 IList<Statement> names = store.Select(new Statement(dataSetEntity, Ontology.PredicateName, Ontology.AnyEntity)); 61 if (names.Count > 0) name = (string)((Literal)names[0].Property).Value; 62 else name = guid.ToString(); 55 63 } 56 64 57 65 public void Activate() { 58 throw new NotImplementedException(); 59 } 60 61 private void UpdateDataSet(long Id, byte[] p) { 62 throw new NotImplementedException(); 66 Entity myEntity = new Entity (Ontology.CedmaNameSpace + Guid); 67 Store.Add(new Statement(myEntity, Ontology.PredicateInstanceOf, Ontology.TypeDataSet)); 68 Store.Add(new Statement(myEntity, Ontology.PredicateSerializedData, new Literal(PersistenceManager.SaveToGZip(problem)))); 69 Store.Add(new Statement(myEntity, Ontology.PredicateName, new Literal(name))); 63 70 } 64 71
Note: See TracChangeset
for help on using the changeset viewer.