Changeset 551
- Timestamp:
- 09/11/08 21:06:23 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/HeuristicLab.CEDMA.DB.Interfaces.csproj ¶
r544 r551 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 <ProductVersion>9.0. 30729</ProductVersion>6 <ProductVersion>9.0.21022</ProductVersion> 7 7 <SchemaVersion>2.0</SchemaVersion> 8 8 <ProjectGuid>{4F9BB789-D561-436B-B226-2BF44B7D0804}</ProjectGuid> … … 33 33 <WarningLevel>4</WarningLevel> 34 34 </PropertyGroup> 35 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 36 <DebugSymbols>true</DebugSymbols> 37 <OutputPath>bin\Debug\</OutputPath> 38 <DefineConstants>DEBUG;TRACE</DefineConstants> 39 <DebugType>full</DebugType> 40 <PlatformTarget>x86</PlatformTarget> 41 <ErrorReport>prompt</ErrorReport> 42 </PropertyGroup> 43 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 44 <OutputPath>bin\x86\Release\</OutputPath> 45 <DefineConstants>TRACE</DefineConstants> 46 <Optimize>true</Optimize> 47 <DebugType>pdbonly</DebugType> 48 <PlatformTarget>x86</PlatformTarget> 49 <ErrorReport>prompt</ErrorReport> 50 </PropertyGroup> 35 51 <ItemGroup> 36 52 <Reference Include="System" /> … … 55 71 <ItemGroup> 56 72 <Compile Include="AgentEntry.cs" /> 73 <Compile Include="SelectFilter.cs" /> 57 74 <Compile Include="SerializedLiteral.cs" /> 58 75 <Compile Include="Literal.cs" /> -
TabularUnified trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/IStore.cs ¶
r544 r551 36 36 [OperationContract] 37 37 IList<Statement> Select(Statement template); 38 39 [OperationContract(Name = "SelectFiltered")] 40 IList<Statement> Select(SelectFilter filter); 38 41 } 39 42 } -
TabularUnified trunk/sources/HeuristicLab.CEDMA.DB/HeuristicLab.CEDMA.DB.csproj ¶
r545 r551 4 4 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 5 5 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 6 <ProductVersion>9.0. 30729</ProductVersion>6 <ProductVersion>9.0.21022</ProductVersion> 7 7 <SchemaVersion>2.0</SchemaVersion> 8 8 <ProjectGuid>{B3D6D8D9-2B1F-47EC-9C73-77FAECF87310}</ProjectGuid> … … 35 35 <WarningLevel>4</WarningLevel> 36 36 </PropertyGroup> 37 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 38 <DebugSymbols>true</DebugSymbols> 39 <OutputPath>bin\Debug\</OutputPath> 40 <DefineConstants>DEBUG;TRACE</DefineConstants> 41 <DebugType>full</DebugType> 42 <PlatformTarget>x86</PlatformTarget> 43 <ErrorReport>prompt</ErrorReport> 44 </PropertyGroup> 45 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 46 <OutputPath>bin\x86\Release\</OutputPath> 47 <DefineConstants>TRACE</DefineConstants> 48 <Optimize>true</Optimize> 49 <DebugType>pdbonly</DebugType> 50 <PlatformTarget>x86</PlatformTarget> 51 <ErrorReport>prompt</ErrorReport> 52 </PropertyGroup> 37 53 <ItemGroup> 38 54 <Reference Include="SemWeb, Version=1.0.6.2, Culture=neutral, processorArchitecture=MSIL" /> … … 44 60 <RequiredTargetFramework>3.5</RequiredTargetFramework> 45 61 </Reference> 46 <Reference Include="System.Data.SQLite, Version=1.0. 49.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">62 <Reference Include="System.Data.SQLite, Version=1.0.56.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> 47 63 <SpecificVersion>False</SpecificVersion> 48 64 <HintPath>..\HeuristicLab.SQLite\System.Data.SQLite.DLL</HintPath> … … 86 102 <Name>HeuristicLab.PluginInfrastructure</Name> 87 103 </ProjectReference> 88 <ProjectReference Include="..\HeuristicLab.SQLite\HeuristicLab.SQLite.csproj">89 <Project>{6960CBCD-E44B-49B0-BA86-671091C42C36}</Project>90 <Name>HeuristicLab.SQLite</Name>91 </ProjectReference>92 104 </ItemGroup> 93 105 <ItemGroup> -
TabularUnified trunk/sources/HeuristicLab.CEDMA.DB/Store.cs ¶
r545 r551 59 59 } 60 60 61 public IList<Statement> Select(SelectFilter filter) { 62 SemWeb.SelectResult result = store.Select(Translate(filter)); 63 List<Statement> r = new List<Statement>(); 64 foreach(SemWeb.Statement resultStatement in result) { 65 r.Add(Translate(resultStatement)); 66 } 67 return r; 68 } 69 70 private SemWeb.SelectFilter Translate(SelectFilter filter) { 71 SemWeb.SelectFilter f = new SemWeb.SelectFilter(); 72 f.Subjects = Array.ConvertAll(filter.Subjects, s => Translate(s)); 73 f.Predicates = Array.ConvertAll(filter.Predicates, p => Translate(p)); 74 f.Objects = Array.ConvertAll(filter.Properties, prop => Translate(prop)); 75 return f; 76 } 77 78 private SemWeb.Entity Translate(Entity e) { 79 return e.Uri == null ? null : new SemWeb.Entity(e.Uri); 80 } 81 82 private SemWeb.Resource Translate(Resource prop) { 83 if(prop is Literal) { 84 return TranslateLiteral((Literal)prop); 85 } else if(prop is SerializedLiteral) { 86 return TranslateLiteral((SerializedLiteral)prop); 87 } else { 88 return Translate((Entity)prop); 89 } 90 } 91 61 92 private Statement Translate(SemWeb.Statement statement) { 62 93 if(statement.Object is SemWeb.Literal) { … … 74 105 75 106 private SemWeb.Statement Translate(Statement statement) { 76 if(statement.Property is Literal) { 77 return new SemWeb.Statement( 78 statement.Subject.Uri == null ? null : new SemWeb.Entity(statement.Subject.Uri), 79 statement.Predicate.Uri == null ? null : new SemWeb.Entity(statement.Predicate.Uri), 80 TranslateLiteral((Literal)statement.Property)); 81 } else if(statement.Property is SerializedLiteral) { 82 return new SemWeb.Statement( 83 statement.Subject.Uri == null ? null : new SemWeb.Entity(statement.Subject.Uri), 84 statement.Predicate.Uri == null ? null : new SemWeb.Entity(statement.Predicate.Uri), 85 TranslateLiteral((SerializedLiteral)statement.Property)); 86 } else { 87 return new SemWeb.Statement( 88 statement.Subject.Uri == null ? null : new SemWeb.Entity(statement.Subject.Uri), 89 statement.Predicate.Uri == null ? null : new SemWeb.Entity(statement.Predicate.Uri), 90 statement.Property.Uri == null ? null : new SemWeb.Entity(((Entity)statement.Property).Uri)); 91 } 107 return new SemWeb.Statement( 108 Translate(statement.Subject), 109 Translate(statement.Predicate), 110 Translate(statement.Property)); 92 111 } 93 112
Note: See TracChangeset
for help on using the changeset viewer.