Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/09 14:23:54 (15 years ago)
Author:
mkommend
Message:

reintegrated branch new heuristic.modeling database backend (ticket #712)

Location:
trunk/sources/HeuristicLab.CEDMA.Core/3.3
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/Console.cs

    r2047 r2223  
    2828using System.ServiceModel;
    2929using System.ServiceModel.Description;
    30 using HeuristicLab.CEDMA.DB.Interfaces;
     30using HeuristicLab.PluginInfrastructure;
     31using HeuristicLab.Modeling.Database.SQLServerCompact;
    3132
    3233namespace HeuristicLab.CEDMA.Core {
    3334  public class Console : ItemBase, IEditable {
    34     private string serverUri;
    35     public string ServerUri {
    36       get { return serverUri; }
     35    private static readonly string sqlServerCompactFile = AppDomain.CurrentDomain.BaseDirectory + "HeuristicLab.Modeling.database.sdf";
     36    private static readonly string sqlServerCompactConnectionString = @"Data Source=" + sqlServerCompactFile;
     37
     38    private Results results;
     39    public Results Results {
     40      get {
     41        if (results == null) ReloadResults();
     42        return results;
     43      }
    3744    }
    38 
    39     private DataSet dataSet;
    40     public DataSet DataSet {
    41       get { return dataSet; }
    42     }
    43 
    4445    public Console()
    4546      : base() {
    46       dataSet = new DataSet();
    4747    }
    4848
     
    5555    }
    5656
    57     #region serialization
    58     public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
    59       XmlNode node = base.GetXmlNode(name, document, persistedObjects);
    60       XmlAttribute uriAttribute = document.CreateAttribute("ServerURI");
    61       uriAttribute.Value = serverUri;
    62       node.Attributes.Append(uriAttribute);
    63       return node;
    64     }
    65 
    66     public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
    67       base.Populate(node, restoredObjects);
    68       serverUri = node.Attributes["ServerURI"].Value;
    69     }
    70     #endregion
    71 
    72     internal void Connect(string serverUri) {
    73       IStore store = new StoreProxy(serverUri);
    74       var variableBindings = store.Query("?Dataset <" + Ontology.InstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 10).ToArray();
    75       if (variableBindings.Length > 0) {
    76         dataSet = new DataSet(store, (Entity)variableBindings[0].Get("Dataset"));
    77       } else {
    78         dataSet.Store = store;
    79       }
     57    private void ReloadResults() {
     58      results = new Results(new DatabaseService(sqlServerCompactConnectionString));
    8059    }
    8160  }
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/ConsoleEditor.cs

    r2000 r2223  
    2929using HeuristicLab.PluginInfrastructure;
    3030using System.Drawing;
    31 using HeuristicLab.CEDMA.DB.Interfaces;
    3231
    3332namespace HeuristicLab.CEDMA.Core {
    3433  class ConsoleEditor : EditorBase {
    35     private System.Windows.Forms.TextBox uriTextBox;
    36     private System.Windows.Forms.Label uriLabel;
    37     private Button connectButton;
    38     private Panel serverPanel;
     34    private ComboBox viewComboBox;
     35    private Button resultsButton;
    3936    private Console console;
    4037
     
    4239      InitializeComponent();
    4340      this.console = console;
     41      PopulateViewComboBox();
    4442    }
    4543
    4644    #region autogenerated code
    4745    private void InitializeComponent() {
    48       this.uriTextBox = new System.Windows.Forms.TextBox();
    49       this.uriLabel = new System.Windows.Forms.Label();
    50       this.connectButton = new System.Windows.Forms.Button();
    51       this.serverPanel = new System.Windows.Forms.Panel();
     46      this.viewComboBox = new System.Windows.Forms.ComboBox();
     47      this.resultsButton = new System.Windows.Forms.Button();
    5248      this.SuspendLayout();
    5349      //
    54       // uriTextBox
     50      // viewComboBox
    5551      //
    56       this.uriTextBox.Location = new System.Drawing.Point(94, 3);
    57       this.uriTextBox.Name = "uriTextBox";
    58       this.uriTextBox.Size = new System.Drawing.Size(205, 20);
    59       this.uriTextBox.TabIndex = 0;
     52      this.viewComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     53      this.viewComboBox.FormattingEnabled = true;
     54      this.viewComboBox.Location = new System.Drawing.Point(3, 3);
     55      this.viewComboBox.Name = "viewComboBox";
     56      this.viewComboBox.Size = new System.Drawing.Size(121, 21);
     57      this.viewComboBox.TabIndex = 7;
    6058      //
    61       // uriLabel
     59      // resultsButton
    6260      //
    63       this.uriLabel.AutoSize = true;
    64       this.uriLabel.Location = new System.Drawing.Point(6, 6);
    65       this.uriLabel.Name = "uriLabel";
    66       this.uriLabel.Size = new System.Drawing.Size(82, 13);
    67       this.uriLabel.TabIndex = 1;
    68       this.uriLabel.Text = "CEDMA Server:";
    69       //
    70       // connectButton
    71       //
    72       this.connectButton.Location = new System.Drawing.Point(305, 1);
    73       this.connectButton.Name = "connectButton";
    74       this.connectButton.Size = new System.Drawing.Size(75, 23);
    75       this.connectButton.TabIndex = 3;
    76       this.connectButton.Text = "&Connect";
    77       this.connectButton.UseVisualStyleBackColor = true;
    78       this.connectButton.Click += new System.EventHandler(this.connectButton_Click);
    79       //
    80       // serverPanel
    81       //
    82       this.serverPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    83                   | System.Windows.Forms.AnchorStyles.Left)
    84                   | System.Windows.Forms.AnchorStyles.Right)));
    85       this.serverPanel.Location = new System.Drawing.Point(3, 29);
    86       this.serverPanel.Name = "serverPanel";
    87       this.serverPanel.Size = new System.Drawing.Size(439, 157);
    88       this.serverPanel.TabIndex = 4;
     61      this.resultsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     62      this.resultsButton.Location = new System.Drawing.Point(130, 1);
     63      this.resultsButton.Name = "resultsButton";
     64      this.resultsButton.Size = new System.Drawing.Size(86, 23);
     65      this.resultsButton.TabIndex = 6;
     66      this.resultsButton.Text = "Show results";
     67      this.resultsButton.UseVisualStyleBackColor = true;
     68      this.resultsButton.Click += new System.EventHandler(this.resultsButton_Click);
    8969      //
    9070      // ConsoleEditor
    9171      //
    9272      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    93       this.Controls.Add(this.serverPanel);
    94       this.Controls.Add(this.connectButton);
    95       this.Controls.Add(this.uriLabel);
    96       this.Controls.Add(this.uriTextBox);
     73      this.Controls.Add(this.viewComboBox);
     74      this.Controls.Add(this.resultsButton);
    9775      this.Name = "ConsoleEditor";
    9876      this.Size = new System.Drawing.Size(445, 189);
    9977      this.ResumeLayout(false);
    100       this.PerformLayout();
    10178
    10279    }
     
    10481    #endregion
    10582
    106     private void connectButton_Click(object sender, EventArgs e) {
    107       try {
    108         console.Connect(uriTextBox.Text);
    109         connectButton.Enabled = false;
    110         serverPanel.Enabled = true;
    111         serverPanel.Controls.Clear();
    112         Control dataSetView = (Control)console.DataSet.CreateView();
    113         dataSetView.Dock = DockStyle.Fill;
    114         serverPanel.Controls.Add(dataSetView);
    115       } catch(CommunicationException ex) {
    116         MessageBox.Show("Exception while trying to connect to " + uriTextBox.Text + "\n" + ex.Message);
    117       }
     83    private void PopulateViewComboBox() {
     84      DiscoveryService service = new DiscoveryService();
     85      IResultsViewFactory[] factories = service.GetInstances<IResultsViewFactory>();
     86      viewComboBox.DataSource = factories;
     87      viewComboBox.ValueMember = "Name";
     88    }
     89
     90
     91    private void resultsButton_Click(object sender, EventArgs e) {
     92      IResultsViewFactory factory = (IResultsViewFactory)viewComboBox.SelectedItem;
     93      IControl control = factory.CreateView(console.Results);
     94      PluginManager.ControlManager.ShowControl(control);
    11895    }
    11996  }
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/HeuristicLab.CEDMA.Core-3.3.csproj

    r2000 r2223  
    8888  </ItemGroup>
    8989  <ItemGroup>
    90     <Compile Include="StoreProxy.cs" />
    9190    <Compile Include="IResultsViewFactory.cs" />
    9291    <Compile Include="ResultsEntry.cs" />
     
    101100      <SubType>UserControl</SubType>
    102101    </Compile>
    103     <Compile Include="Problem.cs" />
    104     <Compile Include="DataSet.cs" />
    105     <Compile Include="DataSetView.cs">
    106       <SubType>UserControl</SubType>
    107     </Compile>
    108     <Compile Include="DataSetView.Designer.cs">
    109       <DependentUpon>DataSetView.cs</DependentUpon>
    110     </Compile>
    111102    <Compile Include="HeuristicLabCedmaCorePlugin.cs" />
    112     <Compile Include="ProblemView.cs">
    113       <SubType>UserControl</SubType>
    114     </Compile>
    115     <Compile Include="ProblemView.Designer.cs">
    116       <DependentUpon>ProblemView.cs</DependentUpon>
    117     </Compile>
    118103    <Compile Include="Properties\AssemblyInfo.cs" />
    119104    <Compile Include="Results.cs" />
     
    123108  </ItemGroup>
    124109  <ItemGroup>
    125     <ProjectReference Include="..\..\HeuristicLab.CEDMA.DB.Interfaces\3.3\HeuristicLab.CEDMA.DB.Interfaces-3.3.csproj">
    126       <Project>{4F9BB789-D561-436B-B226-2BF44B7D0804}</Project>
    127       <Name>HeuristicLab.CEDMA.DB.Interfaces-3.3</Name>
    128     </ProjectReference>
    129110    <ProjectReference Include="..\..\HeuristicLab.Core\3.2\HeuristicLab.Core-3.2.csproj">
    130111      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
     
    138119      <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
    139120      <Name>HeuristicLab.Data-3.2</Name>
     121    </ProjectReference>
     122    <ProjectReference Include="..\..\HeuristicLab.Modeling.Database.SQLServerCompact\3.2\HeuristicLab.Modeling.Database.SQLServerCompact-3.2.csproj">
     123      <Project>{EC1AA756-D612-4FA6-AA52-25CF4F8E3836}</Project>
     124      <Name>HeuristicLab.Modeling.Database.SQLServerCompact-3.2</Name>
     125    </ProjectReference>
     126    <ProjectReference Include="..\..\HeuristicLab.Modeling.Database\3.2\HeuristicLab.Modeling.Database-3.2.csproj">
     127      <Project>{E84E5717-79F8-498F-A5E0-A055C4EC086B}</Project>
     128      <Name>HeuristicLab.Modeling.Database-3.2</Name>
    140129    </ProjectReference>
    141130    <ProjectReference Include="..\..\HeuristicLab.Operators\3.2\HeuristicLab.Operators-3.2.csproj">
     
    155144      <DependentUpon>ConsoleEditor.cs</DependentUpon>
    156145      <SubType>Designer</SubType>
    157     </EmbeddedResource>
    158     <EmbeddedResource Include="DataSetView.resx">
    159       <DependentUpon>DataSetView.cs</DependentUpon>
    160     </EmbeddedResource>
    161     <EmbeddedResource Include="ProblemView.resx">
    162       <DependentUpon>ProblemView.cs</DependentUpon>
    163146    </EmbeddedResource>
    164147  </ItemGroup>
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/HeuristicLabCedmaCorePlugin.cs

    r1529 r2223  
    3131  [Dependency(Dependency = "HeuristicLab.Data-3.2")]
    3232  [Dependency(Dependency = "HeuristicLab.DataAnalysis-3.2")]
    33   [Dependency(Dependency = "HeuristicLab.CEDMA.DB.Interfaces-3.3")]
    3433  [Dependency(Dependency = "HeuristicLab.Operators-3.2")]
     34  [Dependency(Dependency = "HeuristicLab.Modeling.Database-3.2")]
     35  [Dependency(Dependency = "HeuristicLab.Modeling.Database.SQLServerCompact-3.2")]
    3536  public class HeuristicLabCedmaCorePlugin : PluginBase {
    3637  }
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/IResultsViewFactory.cs

    r1529 r2223  
    2626using HeuristicLab.Core;
    2727using System.Xml;
    28 using HeuristicLab.CEDMA.DB.Interfaces;
    2928using HeuristicLab.Operators;
    3029using System.Windows.Forms;
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/Results.cs

    r2146 r2223  
    2626using HeuristicLab.Core;
    2727using System.Collections;
    28 using HeuristicLab.CEDMA.DB.Interfaces;
    2928using System.Xml;
    3029using System.Runtime.Serialization;
     
    3433using HeuristicLab.DataAnalysis;
    3534using System.Drawing;
     35using HeuristicLab.Modeling.Database;
    3636
    3737namespace HeuristicLab.CEDMA.Core {
    3838  public class Results : ItemBase {
    39     private const int PAGE_SIZE = 1000;
    4039    private string[] categoricalVariables = null;
    4140    public string[] CategoricalVariables {
     
    5857    }
    5958
    60     private string[] multiDimensionalOrdinalVariables = new string[] { "VariableImpacts: EvaluationImpact", "VariableImpacts: QualityImpact" };
     59    private string[] multiDimensionalOrdinalVariables;
    6160    public string[] MultiDimensionalOrdinalVariables {
    6261      get { return multiDimensionalOrdinalVariables; }
     
    6867    }
    6968
    70     private IStore store;
    71     public IStore Store {
    72       get { return store; }
    73       set {
    74         store = value;
    75       }
    76     }
     69    private IModelingDatabase database;
    7770
    7871    private Dictionary<string, Dictionary<object, double>> categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>();
    7972
    80     public Results(IStore store) {
    81       this.store = store;
     73    public Results(IModelingDatabase database) {
     74      this.database = database;
     75      multiDimensionalOrdinalVariables = database.GetAllResultsForInputVariables().Select(x => "VariableImpacts: " + x.Name).ToArray();
    8276    }
    8377
     
    9185
    9286    private IEnumerable<ResultsEntry> SelectRows() {
    93       int page = 0;
    94       int resultsReturned = 0;
     87      database.Connect();     
    9588      entries = new List<ResultsEntry>();
    96       if (store == null) return entries;
    97       do {
    98         var allModels = store.Query(
    99           "?Model <" + Ontology.InstanceOf + "> <" + Ontology.TypeModel + "> ." +
    100           "?Model <" + Ontology.TargetVariable + "> ?TargetVariable ." +
    101           "?Model <" + Ontology.TestMeanSquaredError + "> ?TestMSE .",
    102           0, 3000)
    103           .Select(modelBinding => new {
    104             Model = ((Entity)modelBinding.Get("Model")).Uri,
    105             TestMSE = (double)((Literal)modelBinding.Get("TestMSE")).Value,
    106             TargetVariable = (string)((Literal)modelBinding.Get("TargetVariable")).Value
    107           })
    108           .Distinct()
    109           .GroupBy(m => m.TargetVariable)
    110           .Select(grouping => grouping.OrderBy(m => m.TestMSE));
    111         foreach (var targetVariableBindings in allModels) {
    112           resultsReturned = targetVariableBindings.Count();
    113           int nModels = Math.Max(10, resultsReturned * 10 / 100);
    114           nModels = Math.Min(nModels, resultsReturned);
    115           foreach (var modelBindings in targetVariableBindings.Take(nModels)) {
    116             ResultsEntry entry = new ResultsEntry();
    117             entry.Uri = modelBindings.Model;
    118             entries.Add(entry);
    119             SetModelAttributes(entry, modelBindings.Model);
    120             entry.Set("VariableImpacts", SelectVariableImpacts(modelBindings.Model));
     89      foreach (var model in database.GetAllModels()) {
     90        ResultsEntry modelEntry = new ResultsEntry();
     91        foreach (var modelResult in database.GetModelResults(model)) {
     92          modelEntry.Set(modelResult.Result.Name, modelResult.Value);
     93        }
     94        modelEntry.Set("PersistedData", database.GetModelData(model));
     95        modelEntry.Set("TargetVariable", model.TargetVariable.Name);
     96        Dictionary<HeuristicLab.Modeling.Database.IVariable, ResultsEntry> inputVariableResultsEntries =
     97          new Dictionary<HeuristicLab.Modeling.Database.IVariable, ResultsEntry>();
     98
     99        foreach (IInputVariableResult inputVariableResult in database.GetInputVariableResults(model)) {
     100          if (!inputVariableResultsEntries.ContainsKey(inputVariableResult.Variable)) {
     101            inputVariableResultsEntries[inputVariableResult.Variable] = new ResultsEntry();
     102            inputVariableResultsEntries[inputVariableResult.Variable].Set("InputVariableName", inputVariableResult.Variable.Name);
    121103          }
     104          inputVariableResultsEntries[inputVariableResult.Variable].Set(inputVariableResult.Result.Name, inputVariableResult.Value);
    122105        }
    123         page++;
    124       } while (resultsReturned == PAGE_SIZE);
     106        modelEntry.Set("VariableImpacts", inputVariableResultsEntries.Values);
     107        entries.Add(modelEntry);
     108      }
     109      database.Disconnect();
    125110      FireChanged();
    126111      cached = true;
    127112      return entries;
    128     }
    129 
    130     private void SetModelAttributes(ResultsEntry entry, string modelUri) {
    131       var modelBindings = store.Query(
    132         "<" + modelUri + "> ?Attribute ?Value .",
    133         0, PAGE_SIZE);
    134       foreach (var binding in modelBindings) {
    135         if (binding.Get("Value") is Literal) {
    136           string name = ((Entity)binding.Get("Attribute")).Uri.Replace(Ontology.CedmaNameSpace, "");
    137           if (entry.Get(name) == null) {
    138             object value = ((Literal)binding.Get("Value")).Value;
    139             entry.Set(name, value);
    140           }
    141         }
    142       }
    143     }
    144 
    145     private IEnumerable<ResultsEntry> SelectVariableImpacts(string modelUri) {
    146       var inputVariableNameBindings = store.Query(
    147           "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    148           "?InputVariable <" + Ontology.Name + "> ?InputName .",
    149           0, PAGE_SIZE);
    150 
    151       var qualityImpactBindings = store.Query(
    152           "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    153           "?InputVariable <" + Ontology.QualityImpact + "> ?QualityImpact .",
    154           0, PAGE_SIZE);
    155 
    156       var evaluationImpactBindings = store.Query(
    157            "<" + modelUri + "> <" + Ontology.HasInputVariable + "> ?InputVariable ." +
    158            "?InputVariable <" + Ontology.EvaluationImpact + "> ?EvaluationImpact .",
    159            0, PAGE_SIZE);
    160       Dictionary<object, ResultsEntry> inputVariableAttributes = new Dictionary<object, ResultsEntry>();
    161 
    162       foreach (var inputVariableNameBinding in inputVariableNameBindings) {
    163         object inputVariable = inputVariableNameBinding.Get("InputVariable");
    164         object name = ((Literal)inputVariableNameBinding.Get("InputName")).Value;
    165         if (!inputVariableAttributes.ContainsKey(inputVariable)) {
    166           inputVariableAttributes[inputVariable] = new ResultsEntry();
    167           inputVariableAttributes[inputVariable].Set("InputVariableName", name);
    168         }
    169       }
    170 
    171       foreach (var qualityImpactBinding in qualityImpactBindings) {
    172         double qualityImpact = (double)((Literal)qualityImpactBinding.Get("QualityImpact")).Value;
    173         object inputVariable = qualityImpactBinding.Get("InputVariable");
    174         if (!IsAlmost(qualityImpact, 1.0)) {
    175           if (inputVariableAttributes[inputVariable].Get("QualityImpact") == null)
    176             inputVariableAttributes[inputVariable].Set("QualityImpact", qualityImpact);
    177         } else inputVariableAttributes.Remove(inputVariable);
    178       }
    179 
    180       foreach (var evaluationImpactBinding in evaluationImpactBindings) {
    181         double evaluationImpact = (double)((Literal)evaluationImpactBinding.Get("EvaluationImpact")).Value;
    182         object inputVariable = evaluationImpactBinding.Get("InputVariable");
    183         if (!IsAlmost(evaluationImpact, 0.0)) {
    184           if (inputVariableAttributes.ContainsKey(inputVariable) && inputVariableAttributes[inputVariable].Get("EvaluationImpact") == null)
    185             inputVariableAttributes[inputVariable].Set("EvaluationImpact", evaluationImpact);
    186         } else inputVariableAttributes.Remove(inputVariable);
    187       }
    188 
    189       return inputVariableAttributes.Values;
    190113    }
    191114
     
    199122
    200123    private void LoadModelAttributes() {
    201       this.ordinalVariables =
    202         store
    203           .Query(
    204             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeModelAttribute + "> ." + Environment.NewLine +
    205             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeOrdinalAttribute + "> .", 0, 100)
    206           .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
    207           .Distinct()
    208           .ToArray();
    209       this.categoricalVariables =
    210         store
    211           .Query(
    212             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeModelAttribute + "> ." + Environment.NewLine +
    213             "?ModelAttribute <" + Ontology.InstanceOf + "> <" + Ontology.TypeCategoricalAttribute + "> .", 0, 100)
    214           .Select(s => ((Entity)s.Get("ModelAttribute")).Uri.Replace(Ontology.CedmaNameSpace, ""))
    215           .Distinct()
    216           .ToArray();
     124      ordinalVariables = database.GetAllResults().Select(r => r.Name).ToArray();
     125      categoricalVariables = new string[] { "TargetVariable" };
    217126    }
    218127
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/ResultsEntry.cs

    r2139 r2223  
    2626using HeuristicLab.Core;
    2727using System.Collections;
    28 using HeuristicLab.CEDMA.DB.Interfaces;
    2928using System.Xml;
    3029using System.Runtime.Serialization;
  • trunk/sources/HeuristicLab.CEDMA.Core/3.3/TableResultsView.cs

    r2139 r2223  
    1010using HeuristicLab.CEDMA.Core;
    1111using HeuristicLab.PluginInfrastructure;
    12 using HeuristicLab.CEDMA.DB.Interfaces;
    1312
    1413namespace HeuristicLab.CEDMA.Core {
     
    6968      if (e.Button == MouseButtons.Left && e.Clicks == 2) {
    7069        DataGridView.HitTestInfo hitInfo = dataGridView.HitTest(e.X, e.Y);
    71         ResultsEntry entry = (ResultsEntry)dataGridView.Rows[hitInfo.RowIndex].Tag;
    72         string serializedData =  (string)entry.Get(Ontology.SerializedData.Uri.Replace(Ontology.CedmaNameSpace, ""));
    73         var model = (IItem)PersistenceManager.RestoreFromGZip(Convert.FromBase64String(serializedData));
     70        ResultsEntry entry = (ResultsEntry)dataGridView.Rows[hitInfo.RowIndex].Tag;       
     71        var model = (IItem)PersistenceManager.RestoreFromGZip((byte[])entry.Get("PersistedData"));
    7472        PluginManager.ControlManager.ShowControl(model.CreateView());
    7573      }
Note: See TracChangeset for help on using the changeset viewer.