Beispiel #1
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();
        }
Beispiel #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();
        }