Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public void RevertToCommitPoint(CommitPointViewModel targetCommitPoint)
 {
     Source.RevertToCommitPoint(this, targetCommitPoint);
 }
Exemple #4
0
 public XDocument ExecuteSparql(string sparqlQueryString, CommitPointViewModel targetCommitPoint)
 {
     return Source.ExecuteQuery(this, sparqlQueryString, targetCommitPoint);
 }
Exemple #5
0
 public void RevertToCommitPoint(CommitPointViewModel targetCommitPoint)
 {
     Source.RevertToCommitPoint(this, targetCommitPoint);
 }
Exemple #6
0
 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);
     }
 }