Example #1
0
 // TODO change the name into something sensible
 internal void EnableUpdateControl()
 {
     if (!IsChanged)
     {
         IUriNode sourceDataset = RDFUtil.CreateUriNode(_sourceUri);
         BaseUri = RDFRuntime.NewTempDatasetUri();
         this.Retract(sourceDataset, RDF.PropertyType, SD.ClassDataset);
         this.Assert(RDFUtil.CreateUriNode(BaseUri), RDFRuntime.PropertyUpdatesDataset, sourceDataset);
     }
 }
Example #2
0
        internal Uri GetUpdateControlUri(Uri graphUri, bool create = true)
        {
            Uri uri = GetTriplesWithPredicateObject(RDFRuntime.PropertyReplacesGraph, RDFUtil.CreateUriNode(graphUri))
                      .Union(GetTriplesWithPredicateObject(RDFRuntime.PropertyUpdatesGraph, RDFUtil.CreateUriNode(graphUri)))
                      .Select(t => ((IUriNode)t.Subject).Uri)
                      .FirstOrDefault();

            if (uri == null && create)
            {
                uri = RDFRuntime.NewUpdateControlGraphUri();
            }
            return(uri);
        }
Example #3
0
        internal Uri GetTripleAdditionsMonitorUri(Uri graphUri)
        {
            if (_additionGraphs.ContainsKey(graphUri))
            {
                return(_additionGraphs[graphUri]);
            }
            IUriNode monitoredGraph = RDFUtil.CreateUriNode(GetUpdateControlUri(GetModifiableGraph(graphUri).BaseUri));
            Uri      uri            = RDFRuntime.NewTempGraphUri();

            _additionGraphs[graphUri]           = uri;
            _additionGraphs[monitoredGraph.Uri] = uri;
            this.Assert(RDFUtil.CreateUriNode(uri), RDFRuntime.PropertyAddTriplesTo, monitoredGraph);
            return(uri);
        }
Example #4
0
        internal Uri GetTripleRemovalsMonitorUri(Uri graphUri)
        {
            EnableUpdateControl();
            if (_removalGraphs.ContainsKey(graphUri))
            {
                return(_removalGraphs[graphUri]);
            }
            IUriNode monitoredGraph = RDFUtil.CreateUriNode(GetUpdateControlUri(GetModifiableGraph(graphUri).BaseUri));
            Uri      uri            = RDFRuntime.NewTempGraphUri();

            _removalGraphs[graphUri]           = uri;
            _removalGraphs[monitoredGraph.Uri] = uri;
            this.Assert(RDFUtil.CreateUriNode(uri), RDFRuntime.PropertyDeleteTriplesFrom, monitoredGraph);
            return(uri);
        }