コード例 #1
0
        public static void GetSparqlExpression(Expression expression, SparqlQueryBuilder queryBuilder)
        {
            var visitor          = new SparqlGeneratorSelectExpressionTreeVisitor(queryBuilder);
            var resultExpression = visitor.VisitExpression(expression);

            if (resultExpression is SelectVariableNameExpression)
            {
                queryBuilder.AddSelectVariable((resultExpression as SelectVariableNameExpression).Name);
            }
        }
        public static void GetSparqlExpression(Expression expression, SparqlQueryBuilder queryBuilder)
        {
            var visitor          = new SparqlGeneratorSelectExpressionTreeVisitor(queryBuilder);
            var resultExpression = visitor.VisitExpression(expression);

            if (resultExpression is SelectIdentifierVariableNameExpression)
            {
                var selectId  = resultExpression as SelectIdentifierVariableNameExpression;
                var selectVar = queryBuilder.NextVariable();
                queryBuilder.AddBindExpression("STRAFTER(STR(?" + selectId.Name + "), " + SparqlQueryBuilder.QuoteLiteralString(selectId.IdentifierPrefix) + ")", selectVar);
                queryBuilder.AddSelectVariable(selectVar);
            }
            else if (resultExpression is SelectVariableNameExpression)
            {
                queryBuilder.AddSelectVariable((resultExpression as SelectVariableNameExpression).Name);
            }
        }
コード例 #3
0
 public override void VisitSelectClause(Remotion.Linq.Clauses.SelectClause selectClause, QueryModel queryModel)
 {
     // referenceClaused -> fromCluase1
     SparqlGeneratorSelectExpressionTreeVisitor.GetSparqlExpression(selectClause.Selector, _queryBuilder);
     base.VisitSelectClause(selectClause, queryModel);
 }