示例#1
0
 public BrightstarSparqlResultsType ExecuteSparqlQuery(SparqlQuery query, ISerializationFormat targetFormat, Stream resultsStream,
     IEnumerable<string> defaultGraphUris )
 {
     var queryHandler = new SparqlQueryHandler(targetFormat, defaultGraphUris);
     // NOTE: streamWriter is not wrapped in a using because we don't want to close resultStream at this point
     
     var streamWriter = new StreamWriter(resultsStream, targetFormat.Encoding);
     var resultsType = queryHandler.ExecuteSparql(query, this, streamWriter);
     return resultsType;
 }
示例#2
0
        public void ExecuteSparqlQuery(string exp, SparqlResultsFormat resultsFormat, Stream resultStream, out BrightstarSparqlResultsType resultsType)
        {
            var queryHandler = new SparqlQueryHandler();
            BrightstarSparqlResultSet result = queryHandler.ExecuteSparql(exp, this);

            // NOTE: streamWriter is not wrapped in a using because we don't want to close resultStream at this point
            var streamWriter = new StreamWriter(resultStream, resultsFormat.Encoding);
            resultsType = result.ResultType;
            streamWriter.Write(result.GetString(resultsFormat));
            streamWriter.Flush();
        }
示例#3
0
 public string ExecuteSparqlQuery(string exp, SparqlResultsFormat resultsFormat, out long rowCount)
 {
     var queryHandler = new SparqlQueryHandler();
     BrightstarSparqlResultSet result = queryHandler.ExecuteSparql(exp, this);
     rowCount = result.Count;
     return result.GetString(resultsFormat);
 }
示例#4
0
 public string ExecuteSparqlQuery(string exp, SparqlResultsFormat resultsFormat, IEnumerable<string> defaultGraphUris = null)
 {
     var queryHandler = new SparqlQueryHandler(defaultGraphUris);
     BrightstarSparqlResultSet result = queryHandler.ExecuteSparql(exp, this);
     return result.GetString(resultsFormat);
 }
 public void Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string sparqlQuery)
 {
     var sh = new SparqlQueryHandler();
     sh.ExecuteSparql(rdfHandler, resultsHandler, sparqlQuery, _store);
 }
 public object Query(string sparqlQuery)
 {
     var sh = new SparqlQueryHandler();
     return sh.ExecuteSparql(sparqlQuery, _store).RawResultSet;
 }