예제 #1
0
 public static string ExecuteSparqlQuery(this IStore store, string sparqlExpression,
                                         SparqlResultsFormat resultsFormat)
 {
     var query = ParseSparql(sparqlExpression);
     var resultsStream = new MemoryStream();
     store.ExecuteSparqlQuery(query, resultsFormat.WithEncoding(new UTF8Encoding(false)), resultsStream);
     var ret = Encoding.UTF8.GetString(resultsStream.ToArray());
     return ret;
 }
예제 #2
0
 public static string Query(this StoreWorker storeWorker, string sparqlExpression,
                            SparqlResultsFormat resultsFormat, string[] defaultGraphUris)
 {
     var query = ParseSparql(sparqlExpression);
     using (var resultsStream = new MemoryStream())
     {
         storeWorker.Query(query, resultsFormat.WithEncoding(new UTF8Encoding(false)), resultsStream, defaultGraphUris);
         return Encoding.UTF8.GetString(resultsStream.ToArray());
     }
 }
예제 #3
0
        public static string Query(this StoreWorker storeWorker, string sparqlExpression,
                                   SparqlResultsFormat resultsFormat, string[] defaultGraphUris)
        {
            var query = ParseSparql(sparqlExpression);

            using (var resultsStream = new MemoryStream())
            {
                storeWorker.Query(query, resultsFormat.WithEncoding(new UTF8Encoding(false)), resultsStream, defaultGraphUris);
                return(Encoding.UTF8.GetString(resultsStream.ToArray()));
            }
        }
예제 #4
0
        public static string ExecuteSparqlQuery(this IStore store, string sparqlExpression,
                                                SparqlResultsFormat resultsFormat)
        {
            var query         = ParseSparql(sparqlExpression);
            var resultsStream = new MemoryStream();

            store.ExecuteSparqlQuery(query, resultsFormat.WithEncoding(new UTF8Encoding(false)), resultsStream);
            var ret = Encoding.UTF8.GetString(resultsStream.ToArray());

            return(ret);
        }