Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/13/09 15:07:31 (15 years ago)
Author:
gkronber
Message:

worked on CEDMA DB-backend. Select() interface to RDF_Store is not powerful enough => need Query() interface. #419
(work in progress - doesn't build!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSet.cs

    r1106 r1116  
    4848        // lazy loading of problem from DB
    4949        if (problem == null) {
    50           IList<Statement> persistedData = Store.Select(new Statement(new Entity(Ontology.CedmaNameSpace + Guid), Ontology.PredicateSerializedData, Ontology.AnyEntity));
    51           if (persistedData.Count == 1) {
    52             Literal persistedLiteral = (Literal)persistedData[0].Property;
     50          var persistedData = Store.Select(new Statement(new Entity(Ontology.CedmaNameSpace + Guid), Ontology.PredicateSerializedData, Ontology.AnyEntity));
     51          if (persistedData.Count() == 1) {
     52            Literal persistedLiteral = (Literal)persistedData.First().Property;
    5353            this.problem = (Problem)PersistenceManager.RestoreFromGZip(Convert.FromBase64String((string)persistedLiteral.Value));
    5454          } else
    5555            this.problem = new Problem(); // no entry in the DB => create a new problem
    5656        }
    57         return problem; 
     57        return problem;
    5858      }
    5959    }
     
    6969      Store = store;
    7070      guid = new Guid(dataSetEntity.Uri.Remove(0, Ontology.CedmaNameSpace.Length));
    71       IList<Statement> names = store.Select(new Statement(dataSetEntity, Ontology.PredicateName, Ontology.AnyEntity));
    72       if (names.Count > 0) name = (string)((Literal)names[0].Property).Value;
     71      var names = store.Select(new Statement(dataSetEntity, Ontology.PredicateName, Ontology.AnyEntity));
     72      if (names.Count() > 0) name = (string)((Literal)names.First().Property).Value;
    7373      else name = guid.ToString();
    7474    }
Note: See TracChangeset for help on using the changeset viewer.