Ejemplo n.º 1
0
        public string ExecuteSparqlQuery(string exp, SparqlResultsFormat resultsFormat)
        {
            var queryHandler = new SparqlQueryHandler();
            BrightstarSparqlResultSet result = queryHandler.ExecuteSparql(exp, this);

            return(result.GetString(resultsFormat));
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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();
        }
        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(ParseSparql(sparqlQuery), _store).RawResultSet);
        }