コード例 #1
0
        protected internal LinqToSparqlQuery <S> CloneQueryForNewType <S>()
        {
            var newQuery = new LinqToSparqlQuery <S>(DataContext);

            newQuery.TripleStore          = tripleStore;
            newQuery.OriginalType         = OriginalType;
            newQuery.ProjectionFunction   = ProjectionFunction;
            newQuery.QueryGraphParameters = QueryGraphParameters;
            newQuery.FilterClause         = FilterClause;
            newQuery.Log                  = externalLogger;
            newQuery.QueryFactory         = new QueryFactory <S>(QueryFactory.QueryType, DataContext);
            newQuery.Parser               = QueryFactory.CreateExpressionTranslator();
            newQuery.Parser.StringBuilder = new StringBuilder(parser.StringBuilder.ToString());
            newQuery.Expressions          = expressions;
            return(newQuery);
        }
コード例 #2
0
 public void CreateExpressionTranslatorTest()
 {
     TripleStore ts = CreateOnlineSparqlTripleStore();
     IRdfContext context = new RdfDataContext(ts);
     QueryFactory<Track> factory = new QueryFactory<Track>(ts.QueryType, context);
     Assert.AreEqual(factory.QueryType, ts.QueryType);
     IQueryFormatTranslator translator = factory.CreateExpressionTranslator();
     Assert.IsNotNull(translator);
     Assert.IsTrue(translator is LinqToSparqlExpTranslator<Track>);
 }