Free cookie consent management tool by TermsFeed Policy Generator

Changeset 551


Ignore:
Timestamp:
09/11/08 21:06:23 (16 years ago)
Author:
gkronber
Message:

added a method to select based on a set of templates. #200 (Simple indexer for results and matching search-frontend for solution-quality)

Location:
trunk/sources
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/HeuristicLab.CEDMA.DB.Interfaces.csproj

    r544 r551  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.30729</ProductVersion>
     6    <ProductVersion>9.0.21022</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{4F9BB789-D561-436B-B226-2BF44B7D0804}</ProjectGuid>
     
    3333    <WarningLevel>4</WarningLevel>
    3434  </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>
    3551  <ItemGroup>
    3652    <Reference Include="System" />
     
    5571  <ItemGroup>
    5672    <Compile Include="AgentEntry.cs" />
     73    <Compile Include="SelectFilter.cs" />
    5774    <Compile Include="SerializedLiteral.cs" />
    5875    <Compile Include="Literal.cs" />
  • trunk/sources/HeuristicLab.CEDMA.DB.Interfaces/IStore.cs

    r544 r551  
    3636    [OperationContract]
    3737    IList<Statement> Select(Statement template);
     38
     39    [OperationContract(Name = "SelectFiltered")]
     40    IList<Statement> Select(SelectFilter filter);
    3841  }
    3942}
  • trunk/sources/HeuristicLab.CEDMA.DB/HeuristicLab.CEDMA.DB.csproj

    r545 r551  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.30729</ProductVersion>
     6    <ProductVersion>9.0.21022</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{B3D6D8D9-2B1F-47EC-9C73-77FAECF87310}</ProjectGuid>
     
    3535    <WarningLevel>4</WarningLevel>
    3636  </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>
    3753  <ItemGroup>
    3854    <Reference Include="SemWeb, Version=1.0.6.2, Culture=neutral, processorArchitecture=MSIL" />
     
    4460      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    4561    </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">
    4763      <SpecificVersion>False</SpecificVersion>
    4864      <HintPath>..\HeuristicLab.SQLite\System.Data.SQLite.DLL</HintPath>
     
    86102      <Name>HeuristicLab.PluginInfrastructure</Name>
    87103    </ProjectReference>
    88     <ProjectReference Include="..\HeuristicLab.SQLite\HeuristicLab.SQLite.csproj">
    89       <Project>{6960CBCD-E44B-49B0-BA86-671091C42C36}</Project>
    90       <Name>HeuristicLab.SQLite</Name>
    91     </ProjectReference>
    92104  </ItemGroup>
    93105  <ItemGroup>
  • trunk/sources/HeuristicLab.CEDMA.DB/Store.cs

    r545 r551  
    5959    }
    6060
     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
    6192    private Statement Translate(SemWeb.Statement statement) {
    6293      if(statement.Object is SemWeb.Literal) {
     
    74105
    75106    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));
    92111    }
    93112
Note: See TracChangeset for help on using the changeset viewer.