Free cookie consent management tool by TermsFeed Policy Generator

source: branches/plugins/HeuristicLab.CEDMA.DB.Interfaces/3.2/Ontology.cs @ 3703

Last change on this file since 3703 was 1130, checked in by gkronber, 16 years ago
  • re-enabled security for all WCF services;
  • debugged rdf queries
  • added tracing for WCF services
  • implemented simple version of quality based dispatching
  • extended ontology to include a number of predefined model-attributes (quality, size, evaluated solutions etc.)

ticket: #419 (Refactor CEDMA plugins)

File size: 6.5 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Linq;
25using System.Text;
26using HeuristicLab.CEDMA.DB.Interfaces;
27using System.Runtime.Serialization;
28
29namespace HeuristicLab.CEDMA.DB.Interfaces {
30  public static class Ontology {
31    public static string CedmaNameSpace {
32      get { return "http://www.heuristiclab.com/cedma/"; }
33    }
34
35    #region model attribute types
36    /// <summary>
37    /// Attribute value is ordinal, values can be sorted.
38    /// Examples are quality measures or complexity measures.
39    /// </summary>
40    public static Entity TypeOrdinalAttribute {
41      get { return new Entity(CedmaNameSpace + "TypeOrdinalAttribute"); }
42    }
43    /// <summary>
44    /// Attribute value is categorical and thus can't be sorted.
45    /// Examples is target-variable.
46    /// </summary>
47    public static Entity TypeCategoricalAttribute {
48      get { return new Entity(CedmaNameSpace + "TypeCategoricalAttribute"); }
49    }
50    /// <summary>
51    /// Attribute is a quality measure
52    /// </summary>
53    public static Entity TypeQualityAttribute {
54      get { return new Entity(CedmaNameSpace + "TypeQualityAttribute"); }
55    }
56    /// <summary>
57    /// Attribute is a complexity measure
58    /// </summary>
59    public static Entity TypeComplexityAttribute {
60      get { return new Entity(CedmaNameSpace + "TypeComplexityAttribute"); }
61    }
62    #endregion
63
64    #region meta-data predicates
65    public static Entity PredicateName {
66      get { return new Entity(CedmaNameSpace + "Name"); }
67    }
68    /// <summary>
69    /// Each entity can have a serialized XML representation that can be loaded in HL.
70    /// </summary>
71    public static Entity PredicateSerializedData {
72      get { return new Entity(CedmaNameSpace + "SerializedData"); }
73    }
74    /// <summary>
75    /// Link from data set to model.
76    /// A data set can have multiple models.
77    /// </summary>
78    public static Entity PredicateHasModel {
79      get { return new Entity(CedmaNameSpace + "Model"); }
80    }
81    /// <summary>
82    /// Link from model to algorithm.
83    /// An algorithm can generate multiple models, each model is generated by exactly one algorithm.
84    /// </summary>
85    public static Entity PredicateGeneratedBy {
86      get { return new Entity(CedmaNameSpace + "GeneratedBy"); }
87    }
88    #endregion
89
90    #region types and type relations
91    public static Entity PredicateInstanceOf {
92      get { return new Entity(CedmaNameSpace + "InstanceOf"); }
93    }
94    public static Entity TypeGeneticProgrammingFunctionTree {
95      get { return new Entity(CedmaNameSpace + "FunctionTree"); }
96    }
97    public static Entity TypeDataSet {
98      get { return new Entity(CedmaNameSpace + "DataSet"); }
99    }
100    public static Entity TypeAlgorithm {
101      get { return new Entity(CedmaNameSpace + "Algorithm"); }
102    }
103    public static Entity TypeModel {
104      get { return new Entity(CedmaNameSpace + "Model"); }
105    }
106    #endregion
107
108    #region default attributes
109    public static Entity TargetVariable {
110      get { return new Entity(CedmaNameSpace + "TargetVariable"); }
111    }
112    public static Entity TrainingMeanSquaredError {
113      get { return new Entity(CedmaNameSpace + "TrainingMeanSquaredError"); }
114    }
115    public static Entity ValidationMeanSquaredError {
116      get { return new Entity(CedmaNameSpace + "ValidationMeanSquaredError"); }
117    }
118    public static Entity TrainingMeanAbsolutePercentageError {
119      get { return new Entity(CedmaNameSpace + "TrainingMeanAbsolutePercentageError"); }
120    }
121    public static Entity ValidationMeanAbsolutePercentageError {
122      get { return new Entity(CedmaNameSpace + "ValidationMeanAbsolutePercentageError"); }
123    }
124    public static Entity TreeSize {
125      get { return new Entity(CedmaNameSpace + "TreeSize"); }
126    }
127    public static Entity TreeHeight {
128      get { return new Entity(CedmaNameSpace + "TreeHeight"); }
129    }
130    public static Entity EvaluatedSolutions {
131      get { return new Entity(CedmaNameSpace + "EvaluatedSolutions"); }
132    }
133    #endregion
134
135    public static ICollection<Statement> InitialStatements {
136      get {
137        return new List<Statement> {
138          new Statement(TargetVariable, PredicateInstanceOf, TypeCategoricalAttribute),
139          new Statement(TrainingMeanSquaredError, PredicateInstanceOf, TypeOrdinalAttribute),
140          new Statement(TrainingMeanSquaredError, PredicateInstanceOf, TypeQualityAttribute),
141          new Statement(ValidationMeanSquaredError, PredicateInstanceOf, TypeOrdinalAttribute),
142          new Statement(ValidationMeanSquaredError, PredicateInstanceOf, TypeQualityAttribute),
143          new Statement(TrainingMeanAbsolutePercentageError, PredicateInstanceOf, TypeOrdinalAttribute),
144          new Statement(TrainingMeanAbsolutePercentageError, PredicateInstanceOf, TypeQualityAttribute),
145          new Statement(ValidationMeanAbsolutePercentageError, PredicateInstanceOf, TypeOrdinalAttribute),
146          new Statement(ValidationMeanAbsolutePercentageError, PredicateInstanceOf, TypeQualityAttribute),
147          new Statement(TreeSize, PredicateInstanceOf, TypeOrdinalAttribute),
148          new Statement(TreeSize, PredicateInstanceOf, TypeComplexityAttribute),
149          new Statement(TreeHeight, PredicateInstanceOf, TypeOrdinalAttribute),
150          new Statement(TreeHeight, PredicateInstanceOf, TypeComplexityAttribute),
151          new Statement(EvaluatedSolutions, PredicateInstanceOf, TypeOrdinalAttribute)
152        };
153      }
154    }
155
156
157    /// <summary>
158    /// Wildcard entity for filtering.
159    /// </summary>
160    public static Entity AnyEntity {
161      get { return new Entity(null); }
162    }
163
164  }
165}
Note: See TracBrowser for help on using the repository browser.