public XDocument ExecuteQuery(Store store, string sparqlQueryString, CommitPointViewModel targetCommitPoint) { var client = BrightstarService.GetClient(_connectionString); try { if (targetCommitPoint == null) { using (var resultsStream = client.ExecuteQuery(store.Location, sparqlQueryString)) { XDocument result = XDocument.Load(resultsStream); return(result); } } var commitPoint = client.GetCommitPoint(store.Location, targetCommitPoint.CommitTime); if (commitPoint == null) { throw new Exception("Could not retrieve specified commit point from store."); } using (var resultsStream = client.ExecuteQuery(commitPoint, sparqlQueryString)) { XDocument result = XDocument.Load(resultsStream); return(result); } } catch (BrightstarClientException brightstarClientException) { ExtractSyntaxError(brightstarClientException.InnerException); throw new SparqlQueryException(brightstarClientException); } catch (Exception ex) { throw new SparqlQueryException(ex); } }
public void RevertToCommitPoint(Store store, CommitPointViewModel targetCommitPoint) { if (targetCommitPoint == null) { return; } var client = BrightstarService.GetClient(ConnectionString); var commitPoint = client.GetCommitPoint(store.Location, targetCommitPoint.CommitTime); if (commitPoint == null) { throw new ApplicationException(String.Format("Could not find commit point for {0} (ID: {1})", targetCommitPoint.CommitTime, targetCommitPoint.Id)); } client.RevertToCommitPoint(store.Location, commitPoint); }
public void RevertToCommitPoint(CommitPointViewModel targetCommitPoint) { Source.RevertToCommitPoint(this, targetCommitPoint); }
public XDocument ExecuteSparql(string sparqlQueryString, CommitPointViewModel targetCommitPoint) { return Source.ExecuteQuery(this, sparqlQueryString, targetCommitPoint); }
public void RevertToCommitPoint(CommitPointViewModel targetCommitPoint) { Source.RevertToCommitPoint(this, targetCommitPoint); }
public XDocument ExecuteSparql(string sparqlQueryString, CommitPointViewModel targetCommitPoint) { return(Source.ExecuteQuery(this, sparqlQueryString, targetCommitPoint)); }
public void RevertToCommitPoint(Store store, CommitPointViewModel targetCommitPoint) { if (targetCommitPoint == null) return; var client = BrightstarService.GetClient(ConnectionString); var commitPoint = client.GetCommitPoint(store.Location, targetCommitPoint.CommitTime); if (commitPoint == null) { throw new ApplicationException(String.Format("Could not find commit point for {0} (ID: {1})", targetCommitPoint.CommitTime, targetCommitPoint.Id)); } client.RevertToCommitPoint(store.Location, commitPoint); }
public XDocument ExecuteQuery(Store store, string sparqlQueryString, CommitPointViewModel targetCommitPoint) { var client = BrightstarService.GetClient(_connectionString); try { if (targetCommitPoint == null) { using (var resultsStream = client.ExecuteQuery(store.Location, sparqlQueryString)) { XDocument result = XDocument.Load(resultsStream); return result; } } else { var commitPoint = client.GetCommitPoint(store.Location, targetCommitPoint.CommitTime); if (commitPoint == null) { throw new Exception("Could not retrieve specified commit point from store."); } using(var resultsStream = client.ExecuteQuery(commitPoint, sparqlQueryString)) { XDocument result = XDocument.Load(resultsStream); return result; } } } catch (BrightstarClientException brightstarClientException) { ExtractSyntaxError(brightstarClientException.InnerException); throw new SparqlQueryException(brightstarClientException); } catch (Exception ex) { throw new SparqlQueryException(ex); } }