Changeset 539 for trunk/sources
- Timestamp:
- 09/03/08 20:39:12 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/ServerForm.cs
r492 r539 37 37 using System.Threading; 38 38 using HeuristicLab.Grid; 39 using HeuristicLab.Data; 40 using HeuristicLab.Core; 39 41 40 42 namespace HeuristicLab.CEDMA.Server { … … 68 70 database = new Database(connectionString); 69 71 database.CreateNew(); 72 InitDefaultOntology(); 70 73 } else { 71 74 database = new Database(connectionString); 75 if(database.GetOntologyItems().Count==0) InitDefaultOntology(); 72 76 } 77 } 78 79 private void InitDefaultOntology() { 80 // init default ontology 81 StringData cedmaOntology = new StringData("CedmaOntology"); 82 StringData definesEntity = new StringData("definesEntity"); 83 StringData classGpFunctionTree = new StringData("class:GpFunctionTree"); 84 StringData classDataset = new StringData("class:Dataset"); 85 StringData instanceOf = new StringData("instanceOf"); 86 StringData hasModel = new StringData("hasModel"); 87 StringData modelOf = new StringData("modelOf"); 88 StringData targetVariable = new StringData("targetVariable"); 89 StringData trainingMse = new StringData("trainingMSE"); 90 StringData validationMse = new StringData("validationMSE"); 91 92 LinkItems(cedmaOntology, definesEntity, cedmaOntology); 93 LinkItems(cedmaOntology, definesEntity, definesEntity); 94 LinkItems(cedmaOntology, definesEntity, classGpFunctionTree); 95 LinkItems(cedmaOntology, definesEntity, classDataset); 96 LinkItems(cedmaOntology, definesEntity, instanceOf); 97 LinkItems(cedmaOntology, definesEntity, hasModel); 98 LinkItems(cedmaOntology, definesEntity, modelOf); 99 LinkItems(cedmaOntology, definesEntity, targetVariable); 100 LinkItems(cedmaOntology, definesEntity, trainingMse); 101 LinkItems(cedmaOntology, definesEntity, validationMse); 102 } 103 104 private void LinkItems(StringData subj, StringData pred, StringData prop) { 105 ItemEntry subjEntry = new ItemEntry(); 106 ItemEntry predEntry = new ItemEntry(); 107 ItemEntry propEntry = new ItemEntry(); 108 subjEntry.Guid = subj.Guid; 109 subjEntry.RawData = PersistenceManager.SaveToGZip(subj); 110 predEntry.Guid = pred.Guid; 111 predEntry.RawData = PersistenceManager.SaveToGZip(pred); 112 propEntry.Guid = prop.Guid; 113 propEntry.RawData = PersistenceManager.SaveToGZip(prop); 114 115 database.LinkItems(subjEntry, predEntry, propEntry); 73 116 } 74 117
Note: See TracChangeset
for help on using the changeset viewer.