Changeset 551 for trunk/sources/HeuristicLab.CEDMA.DB
- Timestamp:
- 09/11/08 21:06:23 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.CEDMA.DB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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> -
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.