Пример #1
0
        private string ParseQuery(IQuery sparqlQuery, out SparqlQueryVariables variables, ref bool isQueryOptimized)
        {
            var queryVisitor = new SparqlQueryVisitor(isQueryOptimized);

            queryVisitor.MetaGraphUri = MetaGraphUri;
            queryVisitor.VisitQuery(sparqlQuery);
            variables        = queryVisitor.Variables;
            isQueryOptimized = queryVisitor.IsQueryOptimized;
            return(queryVisitor.CommandText);
        }
 private SparqlQuery GetSparqlQuery(Query sparqlQuery, out SparqlQueryVariables variables)
 {
     GenericSparqlQueryVisitor queryVisitor = new SparqlQueryVisitor();
     queryVisitor.MetaGraphUri = MetaGraphUri;
     queryVisitor.VisitQuery(sparqlQuery);
     variables = queryVisitor.Variables;
     LogTo.Info("RomanticWeb.dotNetRDF.TripleStoreAdapter parsed query: {0}", queryVisitor.CommandText);
     SparqlQueryParser parser = new SparqlQueryParser();
     return parser.ParseFromString(queryVisitor.CommandText);
 }