Changeset 2047


Ignore:
Timestamp:
06/16/09 09:42:50 (12 years ago)
Author:
gkronber
Message:

Improved schema for variable impacts. #644

Location:
trunk/sources
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Charting/3.3/BubbleChart.cs

    r1529 r2047  
    266266        ResultsEntry entry = GetResultsEntry(point);
    267267        if (entry != null) {
    268           string serializedData = (string)entry.Get(Ontology.PredicateSerializedData.Uri.Replace(Ontology.CedmaNameSpace, ""));
     268          string serializedData = (string)entry.Get(Ontology.SerializedData.Uri.Replace(Ontology.CedmaNameSpace, ""));
    269269          var model = (IItem)PersistenceManager.RestoreFromGZip(Convert.FromBase64String(serializedData));
    270270          PluginManager.ControlManager.ShowControl(model.CreateView());
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/Console.cs

    r2000 r2047  
    7272    internal void Connect(string serverUri) {
    7373      IStore store = new StoreProxy(serverUri);
    74       var variableBindings = store.Query("?Dataset <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 10).ToArray();
     74      var variableBindings = store.Query("?Dataset <" + Ontology.InstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 10).ToArray();
    7575      if (variableBindings.Length > 0) {
    7676        dataSet = new DataSet(store, (Entity)variableBindings[0].Get("Dataset"));
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/DataSet.cs

    r2000 r2047  
    5050        if (problem == null) {
    5151          var persistedData = Store.Query(
    52             "<" + Ontology.CedmaNameSpace + Guid + "> <" + Ontology.PredicateSerializedData.Uri + "> ?SerializedData .", 0, 10);
     52            "<" + Ontology.CedmaNameSpace + Guid + "> <" + Ontology.SerializedData.Uri + "> ?SerializedData .", 0, 10);
    5353          if (persistedData.Count() == 1) {
    5454            Literal persistedLiteral = (Literal)persistedData.First().Get("SerializedData");
     
    8383    public void Activate() {
    8484      Entity myEntity = new Entity(Ontology.CedmaNameSpace + Guid);
    85       Store.Add(new Statement(myEntity, Ontology.PredicateInstanceOf, Ontology.TypeDataSet));
    86       Store.Add(new Statement(myEntity, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(PersistenceManager.SaveToGZip(problem)))));
    87       Store.Add(new Statement(myEntity, Ontology.PredicateName, new Literal(name)));
     85      Store.Add(new Statement(myEntity, Ontology.InstanceOf, Ontology.TypeDataSet));
     86      Store.Add(new Statement(myEntity, Ontology.SerializedData, new Literal(Convert.ToBase64String(PersistenceManager.SaveToGZip(problem)))));
     87      Store.Add(new Statement(myEntity, Ontology.Name, new Literal(name)));
    8888      activated = true;
    8989    }
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/Results.cs

    r2000 r2047  
    8787      entries = new List<ResultsEntry>();
    8888      do {
    89         var allBindings = store.Query("?Dataset <" + Ontology.PredicateHasModel + "> ?Model ." + Environment.NewLine +
     89        var allBindings = store.Query("?Dataset <" + Ontology.HasModel + "> ?Model ." + Environment.NewLine +
    9090          "?Model ?Attribute ?Value .", page, PAGE_SIZE);
    9191        var allModelBindings = allBindings.GroupBy(x => (Entity)x.Get("Model"));
     
    125125    private void LoadModelAttributes() {
    126126      this.ordinalVariables =
    127         store.Query("?ModelAttribute <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeOrdinalAttribute + "> .", 0, 100)
     127        store.Query("?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeOrdinalAttribute + "> .", 0, 100)
    128128        .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
    129129        .ToArray();
    130130      this.categoricalVariables =
    131         store.Query("?ModelAttribute <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeCategoricalAttribute + "> .", 0, 100)
     131        store.Query("?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeCategoricalAttribute + "> .", 0, 100)
    132132        .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
    133133        .ToArray();
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/TableResultsView.cs

    r1529 r2047  
    6868        DataGridView.HitTestInfo hitInfo = dataGridView.HitTest(e.X, e.Y);
    6969        ResultsEntry entry = (ResultsEntry)dataGridView.Rows[hitInfo.RowIndex].Tag;
    70         string serializedData =  (string)entry.Get(Ontology.PredicateSerializedData.Uri.Replace(Ontology.CedmaNameSpace, ""));
     70        string serializedData =  (string)entry.Get(Ontology.SerializedData.Uri.Replace(Ontology.CedmaNameSpace, ""));
    7171        var model = (IItem)PersistenceManager.RestoreFromGZip(Convert.FromBase64String(serializedData));
    7272        PluginManager.ControlManager.ShowControl(model.CreateView());
  • trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/3.3/Ontology.cs

    r2045 r2047  
    6363
    6464    #region meta-data predicates
    65     public static Entity PredicateName {
     65    public static Entity Name {
    6666      get { return new Entity(CedmaNameSpace + "Name"); }
    6767    }
     
    6969    /// Each entity can have a serialized XML representation that can be loaded in HL.
    7070    /// </summary>
    71     public static Entity PredicateSerializedData {
     71    public static Entity SerializedData {
    7272      get { return new Entity(CedmaNameSpace + "SerializedData"); }
    7373    }
     
    7676    /// A data set can have multiple models.
    7777    /// </summary>
    78     public static Entity PredicateHasModel {
     78    public static Entity HasModel {
    7979      get { return new Entity(CedmaNameSpace + "Model"); }
    8080    }
     
    8383    /// An algorithm can generate multiple models, each model is generated by exactly one algorithm.
    8484    /// </summary>
    85     public static Entity PredicateGeneratedBy {
     85    public static Entity GeneratedBy {
    8686      get { return new Entity(CedmaNameSpace + "GeneratedBy"); }
    8787    }
     88    /// <summary>
     89    /// Link from model to input variable impact
     90    /// Each model can have multiple input variables and each of the input variables can have a different impact on the model.
     91    /// </summary>
     92    public static Entity HasInputVariable {
     93      get { return new Entity(CedmaNameSpace + "InputVariable"); }
     94    }
    8895    #endregion
    8996
    9097    #region types and type relations
    91     public static Entity PredicateInstanceOf {
     98    public static Entity InstanceOf {
    9299      get { return new Entity(CedmaNameSpace + "InstanceOf"); }
    93100    }
     
    102109    }
    103110    public static Entity TypeVariableImpact {
    104       get { return new Entity(CedmaNameSpace + "VariableQualityImpact"); }
    105     }
    106     #endregion
    107 
    108     #region default attributes
     111      get { return new Entity(CedmaNameSpace + "VariableImpact"); }
     112    }
     113    #endregion
     114
     115    #region attributes for models
    109116    public static Entity TargetVariable {
    110117      get { return new Entity(CedmaNameSpace + "TargetVariable"); }
    111118    }
    112     public static Entity AlgorithmName {
    113       get { return new Entity(CedmaNameSpace + "AlgorithmName"); }
    114     }
    115119    public static Entity TrainingMeanSquaredError {
    116120      get { return new Entity(CedmaNameSpace + "TrainingMeanSquaredError"); }
     
    184188    public static Entity EvaluatedSolutions {
    185189      get { return new Entity(CedmaNameSpace + "EvaluatedSolutions"); }
     190    }
     191    #endregion
     192    #region attributes for input variables
     193    public static Entity EvaluationImpact {
     194      get { return new Entity(CedmaNameSpace + "EvaluationImpact"); }
     195    }
     196    public static Entity QualityImpact {
     197      get { return new Entity(CedmaNameSpace + "QualityImpact"); }
    186198    }
    187199    #endregion
     
    190202      get {
    191203        return new List<Statement> {
    192           new Statement(TargetVariable, PredicateInstanceOf, TypeCategoricalAttribute),
    193           new Statement(AlgorithmName, PredicateInstanceOf, TypeCategoricalAttribute),
    194           new Statement(TrainingMeanSquaredError, PredicateInstanceOf, TypeOrdinalAttribute),
    195           new Statement(TrainingMeanSquaredError, PredicateInstanceOf, TypeQualityAttribute),
    196           new Statement(ValidationMeanSquaredError, PredicateInstanceOf, TypeOrdinalAttribute),
    197           new Statement(ValidationMeanSquaredError, PredicateInstanceOf, TypeQualityAttribute),
    198           new Statement(TestMeanSquaredError, PredicateInstanceOf, TypeOrdinalAttribute),
    199           new Statement(TestMeanSquaredError, PredicateInstanceOf, TypeQualityAttribute),
    200           new Statement(TrainingMeanAbsolutePercentageError, PredicateInstanceOf, TypeOrdinalAttribute),
    201           new Statement(TrainingMeanAbsolutePercentageError, PredicateInstanceOf, TypeQualityAttribute),
    202           new Statement(ValidationMeanAbsolutePercentageError, PredicateInstanceOf, TypeOrdinalAttribute),
    203           new Statement(ValidationMeanAbsolutePercentageError, PredicateInstanceOf, TypeQualityAttribute),
    204           new Statement(TestMeanAbsolutePercentageError, PredicateInstanceOf, TypeOrdinalAttribute),
    205           new Statement(TestMeanAbsolutePercentageError, PredicateInstanceOf, TypeQualityAttribute),
    206           new Statement(TrainingMeanAbsolutePercentageOfRangeError, PredicateInstanceOf, TypeOrdinalAttribute),
    207           new Statement(TrainingMeanAbsolutePercentageOfRangeError, PredicateInstanceOf, TypeQualityAttribute),
    208           new Statement(ValidationMeanAbsolutePercentageOfRangeError, PredicateInstanceOf, TypeOrdinalAttribute),
    209           new Statement(ValidationMeanAbsolutePercentageOfRangeError, PredicateInstanceOf, TypeQualityAttribute),
    210           new Statement(TestMeanAbsolutePercentageOfRangeError, PredicateInstanceOf, TypeOrdinalAttribute),
    211           new Statement(TestMeanAbsolutePercentageOfRangeError, PredicateInstanceOf, TypeQualityAttribute),
    212           new Statement(TrainingCoefficientOfDetermination, PredicateInstanceOf, TypeOrdinalAttribute),
    213           new Statement(TrainingCoefficientOfDetermination, PredicateInstanceOf, TypeQualityAttribute),
    214           new Statement(ValidationCoefficientOfDetermination, PredicateInstanceOf, TypeOrdinalAttribute),
    215           new Statement(ValidationCoefficientOfDetermination, PredicateInstanceOf, TypeQualityAttribute),
    216           new Statement(TestCoefficientOfDetermination, PredicateInstanceOf, TypeOrdinalAttribute),
    217           new Statement(TestCoefficientOfDetermination, PredicateInstanceOf, TypeQualityAttribute),
    218           new Statement(TrainingAccuracy, PredicateInstanceOf, TypeOrdinalAttribute),
    219           new Statement(TrainingAccuracy, PredicateInstanceOf, TypeQualityAttribute),
    220           new Statement(ValidationAccuracy, PredicateInstanceOf, TypeOrdinalAttribute),
    221           new Statement(ValidationAccuracy, PredicateInstanceOf, TypeQualityAttribute),
    222           new Statement(TestAccuracy, PredicateInstanceOf, TypeOrdinalAttribute),
    223           new Statement(TestAccuracy, PredicateInstanceOf, TypeQualityAttribute),
    224           new Statement(TrainingTheilsInequalityCoefficient, PredicateInstanceOf, TypeOrdinalAttribute),
    225           new Statement(TrainingTheilsInequalityCoefficient, PredicateInstanceOf, TypeQualityAttribute),
    226           new Statement(ValidationTheilsInequalityCoefficient, PredicateInstanceOf, TypeOrdinalAttribute),
    227           new Statement(ValidationTheilsInequalityCoefficient, PredicateInstanceOf, TypeQualityAttribute),
    228           new Statement(TestTheilsInequalityCoefficient, PredicateInstanceOf, TypeOrdinalAttribute),
    229           new Statement(TestTheilsInequalityCoefficient, PredicateInstanceOf, TypeQualityAttribute),
    230 
    231           new Statement(TreeSize, PredicateInstanceOf, TypeOrdinalAttribute),
    232           new Statement(TreeSize, PredicateInstanceOf, TypeComplexityAttribute),
    233           new Statement(TreeHeight, PredicateInstanceOf, TypeOrdinalAttribute),
    234           new Statement(TreeHeight, PredicateInstanceOf, TypeComplexityAttribute),
    235           new Statement(EvaluatedSolutions, PredicateInstanceOf, TypeOrdinalAttribute)
     204          new Statement(TargetVariable, InstanceOf, TypeCategoricalAttribute),
     205          new Statement(TrainingMeanSquaredError, InstanceOf, TypeOrdinalAttribute),
     206          new Statement(TrainingMeanSquaredError, InstanceOf, TypeQualityAttribute),
     207          new Statement(ValidationMeanSquaredError, InstanceOf, TypeOrdinalAttribute),
     208          new Statement(ValidationMeanSquaredError, InstanceOf, TypeQualityAttribute),
     209          new Statement(TestMeanSquaredError, InstanceOf, TypeOrdinalAttribute),
     210          new Statement(TestMeanSquaredError, InstanceOf, TypeQualityAttribute),
     211          new Statement(TrainingMeanAbsolutePercentageError, InstanceOf, TypeOrdinalAttribute),
     212          new Statement(TrainingMeanAbsolutePercentageError, InstanceOf, TypeQualityAttribute),
     213          new Statement(ValidationMeanAbsolutePercentageError, InstanceOf, TypeOrdinalAttribute),
     214          new Statement(ValidationMeanAbsolutePercentageError, InstanceOf, TypeQualityAttribute),
     215          new Statement(TestMeanAbsolutePercentageError, InstanceOf, TypeOrdinalAttribute),
     216          new Statement(TestMeanAbsolutePercentageError, InstanceOf, TypeQualityAttribute),
     217          new Statement(TrainingMeanAbsolutePercentageOfRangeError, InstanceOf, TypeOrdinalAttribute),
     218          new Statement(TrainingMeanAbsolutePercentageOfRangeError, InstanceOf, TypeQualityAttribute),
     219          new Statement(ValidationMeanAbsolutePercentageOfRangeError, InstanceOf, TypeOrdinalAttribute),
     220          new Statement(ValidationMeanAbsolutePercentageOfRangeError, InstanceOf, TypeQualityAttribute),
     221          new Statement(TestMeanAbsolutePercentageOfRangeError, InstanceOf, TypeOrdinalAttribute),
     222          new Statement(TestMeanAbsolutePercentageOfRangeError, InstanceOf, TypeQualityAttribute),
     223          new Statement(TrainingCoefficientOfDetermination, InstanceOf, TypeOrdinalAttribute),
     224          new Statement(TrainingCoefficientOfDetermination, InstanceOf, TypeQualityAttribute),
     225          new Statement(ValidationCoefficientOfDetermination, InstanceOf, TypeOrdinalAttribute),
     226          new Statement(ValidationCoefficientOfDetermination, InstanceOf, TypeQualityAttribute),
     227          new Statement(TestCoefficientOfDetermination, InstanceOf, TypeOrdinalAttribute),
     228          new Statement(TestCoefficientOfDetermination, InstanceOf, TypeQualityAttribute),
     229          new Statement(TrainingAccuracy, InstanceOf, TypeOrdinalAttribute),
     230          new Statement(TrainingAccuracy, InstanceOf, TypeQualityAttribute),
     231          new Statement(ValidationAccuracy, InstanceOf, TypeOrdinalAttribute),
     232          new Statement(ValidationAccuracy, InstanceOf, TypeQualityAttribute),
     233          new Statement(TestAccuracy, InstanceOf, TypeOrdinalAttribute),
     234          new Statement(TestAccuracy, InstanceOf, TypeQualityAttribute),
     235          new Statement(TrainingTheilsInequalityCoefficient, InstanceOf, TypeOrdinalAttribute),
     236          new Statement(TrainingTheilsInequalityCoefficient, InstanceOf, TypeQualityAttribute),
     237          new Statement(ValidationTheilsInequalityCoefficient, InstanceOf, TypeOrdinalAttribute),
     238          new Statement(ValidationTheilsInequalityCoefficient, InstanceOf, TypeQualityAttribute),
     239          new Statement(TestTheilsInequalityCoefficient, InstanceOf, TypeOrdinalAttribute),
     240          new Statement(TestTheilsInequalityCoefficient, InstanceOf, TypeQualityAttribute),
     241
     242          new Statement(TreeSize, InstanceOf, TypeOrdinalAttribute),
     243          new Statement(TreeSize, InstanceOf, TypeComplexityAttribute),
     244          new Statement(TreeHeight, InstanceOf, TypeOrdinalAttribute),
     245          new Statement(TreeHeight, InstanceOf, TypeComplexityAttribute),
     246          new Statement(EvaluatedSolutions, InstanceOf, TypeOrdinalAttribute),
     247
     248          new Statement(Name, InstanceOf, TypeCategoricalAttribute),
     249          new Statement(QualityImpact, InstanceOf, TypeOrdinalAttribute),
     250          new Statement(EvaluationImpact, InstanceOf, TypeOrdinalAttribute)
    236251        };
    237252      }
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherBase.cs

    r2012 r2047  
    4848    public IAlgorithm GetNextJob() {
    4949      if (dataset == null) {
    50         var datasetEntities = store.Query("?DataSet <" + Ontology.PredicateInstanceOf.Uri + "> <" + Ontology.TypeDataSet.Uri + "> .", 0, 1)
     50        var datasetEntities = store.Query("?DataSet <" + Ontology.InstanceOf.Uri + "> <" + Ontology.TypeDataSet.Uri + "> .", 0, 1)
    5151          .Select(x => (Entity)x.Get("DataSet"));
    5252        if (datasetEntities.Count() == 0) return null;
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterBase.cs

    r2045 r2047  
    7171    protected void StoreResults(IAlgorithm finishedAlgorithm) {
    7272      Entity modelEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
    73       // store.Add(new Statement(finishedAlgorithm.DataSetEntity, Ontology.PredicateHasModel, modelEntity));
    74       StoreModelAttribute(modelEntity, Ontology.TargetVariable, finishedAlgorithm.Model.TargetVariable);
    75       StoreModelAttribute(modelEntity, Ontology.AlgorithmName, finishedAlgorithm.Description);
     73      store.Add(new Statement(modelEntity, Ontology.InstanceOf, Ontology.TypeModel));
     74      StoreEntityAttribute(modelEntity, Ontology.TargetVariable, finishedAlgorithm.Model.TargetVariable);
     75      StoreEntityAttribute(modelEntity, Ontology.AlgorithmName, finishedAlgorithm.Description);
    7676     
    7777      IModel model = finishedAlgorithm.Model;
    78       StoreModelAttribute(modelEntity, Ontology.TrainingMeanSquaredError, model.TrainingMeanSquaredError);
    79       StoreModelAttribute(modelEntity, Ontology.ValidationMeanSquaredError, model.ValidationMeanSquaredError);
    80       StoreModelAttribute(modelEntity, Ontology.TestMeanSquaredError, model.TestMeanSquaredError);
    81       StoreModelAttribute(modelEntity, Ontology.TrainingCoefficientOfDetermination, model.TrainingCoefficientOfDetermination);
    82       StoreModelAttribute(modelEntity, Ontology.ValidationCoefficientOfDetermination, model.ValidationCoefficientOfDetermination);
    83       StoreModelAttribute(modelEntity, Ontology.TestCoefficientOfDetermination, model.TestCoefficientOfDetermination);
    84       StoreModelAttribute(modelEntity, Ontology.TrainingVarianceAccountedFor, model.TrainingVarianceAccountedFor);
    85       StoreModelAttribute(modelEntity, Ontology.ValidationVarianceAccountedFor, model.ValidationVarianceAccountedFor);
    86       StoreModelAttribute(modelEntity, Ontology.TestVarianceAccountedFor, model.TestVarianceAccountedFor);
    87       StoreModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageError, model.TrainingMeanAbsolutePercentageError);
    88       StoreModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageError, model.ValidationMeanAbsolutePercentageError);
    89       StoreModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageError, model.TestMeanAbsolutePercentageError);
    90       StoreModelAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageOfRangeError, model.TrainingMeanAbsolutePercentageOfRangeError);
    91       StoreModelAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageOfRangeError, model.ValidationMeanAbsolutePercentageOfRangeError);
    92       StoreModelAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageOfRangeError, model.TestMeanAbsolutePercentageOfRangeError);
     78      StoreEntityAttribute(modelEntity, Ontology.TrainingMeanSquaredError, model.TrainingMeanSquaredError);
     79      StoreEntityAttribute(modelEntity, Ontology.ValidationMeanSquaredError, model.ValidationMeanSquaredError);
     80      StoreEntityAttribute(modelEntity, Ontology.TestMeanSquaredError, model.TestMeanSquaredError);
     81      StoreEntityAttribute(modelEntity, Ontology.TrainingCoefficientOfDetermination, model.TrainingCoefficientOfDetermination);
     82      StoreEntityAttribute(modelEntity, Ontology.ValidationCoefficientOfDetermination, model.ValidationCoefficientOfDetermination);
     83      StoreEntityAttribute(modelEntity, Ontology.TestCoefficientOfDetermination, model.TestCoefficientOfDetermination);
     84      StoreEntityAttribute(modelEntity, Ontology.TrainingVarianceAccountedFor, model.TrainingVarianceAccountedFor);
     85      StoreEntityAttribute(modelEntity, Ontology.ValidationVarianceAccountedFor, model.ValidationVarianceAccountedFor);
     86      StoreEntityAttribute(modelEntity, Ontology.TestVarianceAccountedFor, model.TestVarianceAccountedFor);
     87      StoreEntityAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageError, model.TrainingMeanAbsolutePercentageError);
     88      StoreEntityAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageError, model.ValidationMeanAbsolutePercentageError);
     89      StoreEntityAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageError, model.TestMeanAbsolutePercentageError);
     90      StoreEntityAttribute(modelEntity, Ontology.TrainingMeanAbsolutePercentageOfRangeError, model.TrainingMeanAbsolutePercentageOfRangeError);
     91      StoreEntityAttribute(modelEntity, Ontology.ValidationMeanAbsolutePercentageOfRangeError, model.ValidationMeanAbsolutePercentageOfRangeError);
     92      StoreEntityAttribute(modelEntity, Ontology.TestMeanAbsolutePercentageOfRangeError, model.TestMeanAbsolutePercentageOfRangeError);
    9393
    9494      for (int i = 0; i < finishedAlgorithm.Dataset.Columns; i++) {
    9595        try {
    96           double qualImpact = model.GetVariableQualityImpact(finishedAlgorithm.Dataset.GetVariableName(i));
    97           Entity impactEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
    98           store.Add(new Statement(impactEntity, Ontology.PredicateInstanceOf, Ontology.TypeVariableQualityImpact));
    99           store.Add(new Statement(modelEntity, impactEntity, new Literal(qualImpact)));
     96          string variableName = finishedAlgorithm.Dataset.GetVariableName(i);
     97          double qualImpact = model.GetVariableQualityImpact(variableName);
     98          double evalImpact = model.GetVariableEvaluationImpact(variableName);
     99
     100          Entity inputVariableEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid());
     101          store.Add(new Statement(inputVariableEntity, Ontology.InstanceOf, Ontology.TypeVariableImpact));
     102          store.Add(new Statement(modelEntity, Ontology.HasInputVariable, inputVariableEntity));
     103          StoreEntityAttribute(inputVariableEntity, Ontology.EvaluationImpact, evalImpact);
     104          StoreEntityAttribute(inputVariableEntity, Ontology.QualityImpact, qualImpact);
     105          StoreEntityAttribute(inputVariableEntity, Ontology.Name, variableName);
    100106        }
    101107        catch (ArgumentException) {
     
    105111
    106112      byte[] serializedModel = PersistenceManager.SaveToGZip(model.Data);
    107       store.Add(new Statement(modelEntity, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(serializedModel))));
     113      store.Add(new Statement(modelEntity, Ontology.SerializedData, new Literal(Convert.ToBase64String(serializedModel))));
    108114    }
    109115
    110     private void StoreModelAttribute(Entity model, Entity predicate, object value) {
    111       store.Add(new Statement(model, predicate, new Literal(value)));
     116    private void StoreEntityAttribute(Entity entity, Entity predicate, object value) {
     117      store.Add(new Statement(entity, predicate, new Literal(value)));
    112118    }
    113119
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs

    r2012 r2047  
    100100      var datasetEntity = store
    101101        .Query(
    102         "?Dataset <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 1)
     102        "?Dataset <" + Ontology.InstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 1)
    103103        .Select(x => (Entity)x.Get("Dataset")).ElementAt(0);
    104104      DataSet ds = new DataSet(store, datasetEntity);
     
    107107        .Query(
    108108        "?Model <" + Ontology.TargetVariable + "> ?TargetVariable ." + Environment.NewLine +
    109         "?Model <" + Ontology.AlgorithmName + "> ?AlgoName .",
     109        "?Model <" + Ontology.Name + "> ?AlgoName .",
    110110        0, 1000)
    111111        .Select(x => new Resource[] { (Literal)x.Get("TargetVariable"), (Literal)x.Get("AlgoName") });
Note: See TracChangeset for help on using the changeset viewer.