Beispiel #1
0
 /// <summary>
 /// Clears the quadruples of the store
 /// </summary>
 public override void ClearQuadruples()
 {
     //Clear quadruples
     this.Quadruples.Clear();
     //Clear index
     this.StoreIndex.ClearIndex();
     //Raise event
     RDFStoreEvents.RaiseOnStoreCleared(String.Format("Store '{0}' has been cleared.", this));
 }
 /// <summary>
 /// Removes the store from the federation
 /// </summary>
 public RDFFederation RemoveStore(RDFStore store)
 {
     if (store != null)
     {
         if (this.Stores.ContainsKey(store.StoreID))
         {
             this.Stores.Remove(store.StoreID);
             RDFStoreEvents.RaiseOnStoreRemoved(String.Format("Store '{0}' has been removed from the Federation '{1}'.", store, this));
         }
     }
     return(this);
 }
 /// <summary>
 /// Adds the store to the federation, avoiding duplicate insertions
 /// </summary>
 public RDFFederation AddStore(RDFStore store)
 {
     if (store != null)
     {
         if (!this.Stores.ContainsKey(store.StoreID))
         {
             this.Stores.Add(store.StoreID, store);
             RDFStoreEvents.RaiseOnStoreAdded(String.Format("Store '{0}' has been added to the Federation '{1}'.", store, this));
         }
     }
     return(this);
 }
Beispiel #4
0
 /// <summary>
 /// Removes the given quadruple from the store
 /// </summary>
 public override RDFStore RemoveQuadruple(RDFQuadruple quadruple)
 {
     if (this.ContainsQuadruple(quadruple))
     {
         //Remove quadruple
         this.Quadruples.Remove(quadruple.QuadrupleID);
         //Remove index
         this.StoreIndex.RemoveIndex(quadruple);
         //Raise event
         RDFStoreEvents.RaiseOnQuadrupleRemoved(String.Format("Quadruple '{0}' has been removed from the Store '{1}'.", quadruple, this));
     }
     return(this);
 }
Beispiel #5
0
 /// <summary>
 /// Removes the quadruples with the given literal as object
 /// </summary>
 public override RDFStore RemoveQuadruplesByLiteral(RDFLiteral literalObject)
 {
     if (literalObject != null)
     {
         foreach (var quad in this.SelectQuadruplesByLiteral(literalObject))
         {
             //Remove quadruple
             this.Quadruples.Remove(quad.QuadrupleID);
             //Remove index
             this.StoreIndex.RemoveIndex(quad);
             //Raise event
             RDFStoreEvents.RaiseOnQuadrupleRemoved(String.Format("Quadruple '{0}' has been removed from the Store '{1}'.", quad, this));
         }
     }
     return(this);
 }
Beispiel #6
0
 /// <summary>
 /// Removes the quadruples with the given predicate
 /// </summary>
 public override RDFStore RemoveQuadruplesByPredicate(RDFResource predicateResource)
 {
     if (predicateResource != null)
     {
         foreach (var quad in this.SelectQuadruplesByPredicate(predicateResource))
         {
             //Remove quadruple
             this.Quadruples.Remove(quad.QuadrupleID);
             //Remove index
             this.StoreIndex.RemoveIndex(quad);
             //Raise event
             RDFStoreEvents.RaiseOnQuadrupleRemoved(String.Format("Quadruple '{0}' has been removed from the Store '{1}'.", quad, this));
         }
     }
     return(this);
 }
Beispiel #7
0
 /// <summary>
 /// Adds the given quadruple to the store, avoiding duplicate insertions
 /// </summary>
 public override RDFStore AddQuadruple(RDFQuadruple quadruple)
 {
     if (quadruple != null)
     {
         if (!this.Quadruples.ContainsKey(quadruple.QuadrupleID))
         {
             //Add quadruple
             this.Quadruples.Add(quadruple.QuadrupleID, quadruple);
             //Add index
             this.StoreIndex.AddIndex(quadruple);
             //Raise event
             RDFStoreEvents.RaiseOnQuadrupleAdded(String.Format("Quadruple '{0}' has been added to the Store '{1}'.", quadruple, this));
         }
     }
     return(this);
 }
Beispiel #8
0
 /// <summary>
 /// Removes the quadruples with the given subject and literal
 /// </summary>
 public override RDFStore RemoveQuadruplesBySubjectLiteral(RDFResource subjectResource, RDFLiteral objectLiteral)
 {
     if (subjectResource != null && objectLiteral != null)
     {
         foreach (var quad in this.SelectQuadruplesBySubject(subjectResource)
                  .SelectQuadruplesByLiteral(objectLiteral))
         {
             //Remove quadruple
             this.Quadruples.Remove(quad.QuadrupleID);
             //Remove index
             this.StoreIndex.RemoveIndex(quad);
             //Raise event
             RDFStoreEvents.RaiseOnQuadrupleRemoved(String.Format("Quadruple '{0}' has been removed from the Store '{1}'.", quad, this));
         }
     }
     return(this);
 }
 /// <summary>
 /// Clears the stores of the federation.
 /// </summary>
 public void ClearStores()
 {
     this.Stores.Clear();
     RDFStoreEvents.RaiseOnFederationCleared(String.Format("Federation '{0}' has been cleared.", this));
 }