Esempio n. 1
0
 public void ExportData(Stream stream, string graphUri)
 {
     try
     {
         var triples = ReadStore.Match(null, null, null, graph: graphUri);
         using (var sw = new StreamWriter(stream))
         {
             var nw = new BrightstarTripleSinkAdapter(new NTriplesWriter(sw));
             foreach (var triple in triples)
             {
                 nw.Triple(triple);
             }
             sw.Flush();
         }
     }
     catch (ReadWriteStoreModifiedException)
     {
         Logging.LogError(BrightstarEventId.ExportDataError, "Store was modified while export was running.");
     }
     catch (Exception ex)
     {
         Logging.LogError(BrightstarEventId.ExportDataError, "Error Exporting Data {0} {1}", ex.Message,
                          ex.StackTrace);
     }
 }