Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Charting/BubbleChart.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Charting/BubbleChart.cs	(revision 1150)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Charting/BubbleChart.cs	(revision 1151)
@@ -116,5 +116,5 @@
       double minSize = 1;
       try {
-        if (sizeDimension != null && Results.OrdinalVariables.Contains(sizeDimension)) {
+        if (sizeDimension != null && results.OrdinalVariables.Contains(sizeDimension)) {
           var sizes = records
             .Select(x => Convert.ToDouble(x.Get(sizeDimension)))
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Results.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Results.cs	(revision 1150)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Results.cs	(revision 1151)
@@ -37,10 +37,22 @@
 namespace HeuristicLab.CEDMA.Core {
   public class Results : ItemBase {
-    public static string[] CategoricalVariables {
-      get { return new string[] { "TargetVariable" }; }
+    private string[] categoricalVariables = null;
+    public string[] CategoricalVariables {
+      get {
+        if (categoricalVariables == null) {
+          LoadModelAttributes();
+        }
+        return categoricalVariables;
+      }
     }
 
-    public static string[] OrdinalVariables {
-      get { return new string[] { "ValidationMeanAbsolutePercentageError" }; }
+    private string[] ordinalVariables = null;
+    public string[] OrdinalVariables {
+      get {
+        if (ordinalVariables == null) {
+          LoadModelAttributes();
+        }
+        return ordinalVariables;
+      }
     }
 
@@ -73,68 +85,40 @@
     private IEnumerable<ResultsEntry> SelectRows() {
       if (store == null) yield break;
+      entries = new List<ResultsEntry>();
+      var results = store.Query("<"+dataSetEntity + "> <" + Ontology.PredicateHasModel + "> ?Model ." + Environment.NewLine +
+        "?Model ?Attribute ?Value .")
+        .GroupBy(x=>(Entity)x.Get("Model"));
+      foreach (var modelBindings in results) {
+        ResultsEntry entry = new ResultsEntry(modelBindings.Key.Uri);
+        foreach (var binding in modelBindings) {
+          if (binding.Get("Value") is Literal) {
+            string name = ((Entity)binding.Get("Attribute")).Uri.Replace(Ontology.CedmaNameSpace, "");
+            if (entry.Get(name) == null) {
+              object value = ((Literal)binding.Get("Value")).Value;
+              entry.Set(name, value);
+            }
+          }
+        }
+        entries.Add(entry);
+        yield return entry;
+      }
 
-      //var models = store.Select(new Statement(dataSetEntity, Ontology.PredicateHasModel, Ontology.AnyEntity));
-
-      ////var results = store.Select(new Statement(dataSetEntity, Ontology.PredicateHasModel, Ontology.AnyEntity))
-      ////   .SelectMany(x => store.Select(new SelectFilter(
-      ////     new Entity[] { (Entity)x.Property },
-      ////     new Entity[] { Ontology.PredicateModelAttribute },
-      ////     new Resource[] { Ontology.AnyEntity })))
-      ////   .SelectMany(x =>
-      ////     store.Select(
-      ////        new SelectFilter(
-      ////        new Entity[] { (Entity)x.Property },
-      ////        new Entity[] { Ontology.PredicateModelAttributeName },
-      ////        new Entity[] { Ontology.AnyEntity })).Select(y =>
-      ////          new {
-      ////            Model = x.Subject,
-      ////            Attribute = (Entity)x.Property,
-      ////            AttributeName = (Literal)y.Property
-      ////          }))
-      ////   .SelectMany(x =>
-      ////     store.Select(
-      ////       new Statement(x.Attribute, Ontology.PredicateModelAttributeValue, Ontology.AnyEntity))
-      ////       .Select(y =>
-      ////         new {
-      ////           Model = x.Model.Uri,
-      ////           AttributeName = x.AttributeName.Value,
-      ////           AttributeValue = ((Literal)y.Property).Value
-      ////         })).GroupBy(x => x.Model);
-
-      //entries = new List<ResultsEntry>();
-      //foreach (var model in models) {
-      //  var attributes = store.Select(new Statement((Entity)model.Property, Ontology.PredicateModelAttribute, Ontology.AnyEntity));
-
-      //  foreach (var attr in attributes) {
-      //    var namesAndValues = store
-      //      .Select(new SelectFilter(new Entity[] { (Entity)attr.Property },
-      //        new Entity[] { Ontology.PredicateModelAttributeName, Ontology.PredicateModelAttributeValue },
-      //        new Entity[] { Ontology.AnyEntity }));
-      //  }
-      //}
-
-      //foreach (var row in results) {
-      //  ResultsEntry entry = new ResultsEntry(row.First().Model);
-      //  foreach (var attr in row) {
-      //    entry.Set((string)attr.AttributeName, attr.AttributeValue);
-      //  }
-      //  entries.Add(entry);
-      //  yield return entry;
-      //}
-
-      //FireChanged();
-      //cached = true;
+      FireChanged();
+      cached = true;
     }
 
     internal IEnumerable<string> SelectModelAttributes() {
-      if (store == null) yield break;
+      return CategoricalVariables.Concat(OrdinalVariables);
+    }
 
-      //var attributeNames =
-      //  store.Select(new Statement(Ontology.AnyEntity, Ontology.PredicateModelAttributeName, Ontology.AnyEntity))
-      //  .Select(s => (string)((Literal)s.Property).Value)        
-      //  .Distinct();
-      //foreach (var name in attributeNames) {
-      //  yield return name;
-      //}
+    private void LoadModelAttributes() {
+      this.ordinalVariables =
+        store.Query("?ModelAttribute <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeOrdinalAttribute + "> .")
+        .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
+        .ToArray();
+      this.categoricalVariables =
+        store.Query("?ModelAttribute <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeCategoricalAttribute + "> .")
+        .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
+        .ToArray();
     }
   }
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.DB.Interfaces/Entity.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.DB.Interfaces/Entity.cs	(revision 1150)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.DB.Interfaces/Entity.cs	(revision 1151)
@@ -35,4 +35,8 @@
     }
 
+    public override string ToString() {
+      return Uri;
+    }
+
     public override bool Equals(object obj) {
       if(this == obj) return true;
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs	(revision 1150)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/Dispatcher.cs	(revision 1151)
@@ -69,10 +69,4 @@
       var modelMAPE = new HeuristicLab.CEDMA.DB.Interfaces.Variable("ModelMAPE");
 
-      //var query = new Statement[] {
-      //  new Statement(dataSetEntity, Ontology.PredicateHasModel, modelVar),
-      //  new Statement(modelVar, Ontology.TargetVariable, targetVar),
-      //  new Statement(modelVar, Ontology.ValidationMeanAbsolutePercentageError, modelMAPE)
-      //};
-
       var query = "<" + dataSetEntity.Uri + "> <" + Ontology.PredicateHasModel.Uri + "> ?Model ." + Environment.NewLine +
         "?Model <" + Ontology.TargetVariable.Uri + "> ?TargetVariable ." + Environment.NewLine +
@@ -100,5 +94,5 @@
       int nConfigurations = utilization.Length;
       for (int j = nConfigurations - 1; j > nConfigurations * 0.8; j--) {
-        int targetVariable = dataSet.Problem.AllowedTargetVariables[j];
+        int targetVariable = dataSet.Problem.AllowedTargetVariables[idx[j]];
         IEngine engine = CreateEngine(dataSet.Problem, targetVariable);
         if (engine != null) {
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.Grid/ServerForm.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.Grid/ServerForm.cs	(revision 1150)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.Grid/ServerForm.cs	(revision 1151)
@@ -66,5 +66,5 @@
       internalHost = new ServiceHost(jobStore, new Uri(internalAddressTextBox.Text));
       ServiceThrottlingBehavior throttlingBehavior = new ServiceThrottlingBehavior();
-      throttlingBehavior.MaxConcurrentSessions = 20;
+      throttlingBehavior.MaxConcurrentSessions = 100;
       internalHost.Description.Behaviors.Add(throttlingBehavior);
       try {
