/// <summary> /// Creates a new instance of a Graph using the given Triple Collection and an optionally empty Namespace Map. /// </summary> /// <param name="tripleCollection">Triple Collection.</param> /// <param name="emptyNamespaceMap">Whether the Namespace Map should be empty.</param> public Graph(BaseTripleCollection tripleCollection, bool emptyNamespaceMap) : base(tripleCollection) { if (emptyNamespaceMap) { _nsmapper.Clear(); } }
/// <summary> /// Creates a new Union Triple Collection which is a union of any number of collections. /// </summary> /// <param name="baseTriples">Base Triple Collection.</param> /// <param name="additionalTriples">Additional Triple Collection(s).</param> public UnionTripleCollection(BaseTripleCollection baseTriples, IEnumerable <BaseTripleCollection> additionalTriples) { if (baseTriples == null) { throw new ArgumentNullException("baseTriple"); } _collections.Add(baseTriples); _collections.AddRange(additionalTriples); _baseCollection = baseTriples; }
/// <summary> /// Creates a new decorator around the given triple collection. /// </summary> /// <param name="tripleCollection">Triple Collection.</param> public WrapperTripleCollection(BaseTripleCollection tripleCollection) { if (tripleCollection == null) { throw new ArgumentNullException("tripleCollection"); } _triples = tripleCollection; _triples.TripleAdded += HandleTripleAdded; _triples.TripleRemoved += HandleTripleRemoved; }
/// <summary> /// Creates a new Base Graph using the given Triple Collection. /// </summary> /// <param name="tripleCollection">Triple Collection to use.</param> protected BaseGraph(BaseTripleCollection tripleCollection) { _triples = tripleCollection; _bnodemapper = new BlankNodeMapper(); _nsmapper = new NamespaceMapper(); // Create Event Handlers and attach to the Triple Collection TripleAddedHandler = new TripleEventHandler(OnTripleAsserted); TripleRemovedHandler = new TripleEventHandler(OnTripleRetracted); AttachEventHandlers(_triples); }
/// <summary> /// Creates a new Union Triple Collection which is a union of two collections. /// </summary> /// <param name="baseTriples">Base Triple Collection.</param> /// <param name="additionalTriples">Additional Triple Collection.</param> public UnionTripleCollection(BaseTripleCollection baseTriples, BaseTripleCollection additionalTriples) { if (baseTriples == null) { throw new ArgumentNullException("baseTriple"); } if (additionalTriples == null) { throw new ArgumentNullException("additionalTriples"); } _collections.Add(baseTriples); _collections.Add(additionalTriples); _baseCollection = baseTriples; }
/// <summary> /// Creates a new instance of a Graph using the given Triple Collection and an optionally empty Namespace Map. /// </summary> /// <param name="tripleCollection">Triple Collection.</param> /// <param name="emptyNamespaceMap">Whether the Namespace Map should be empty.</param> public RohGraph(BaseTripleCollection tripleCollection, bool emptyNamespaceMap) : base(tripleCollection, emptyNamespaceMap) { }
/// <summary> /// Creates a new instance of a Graph using the given Triple Collection. /// </summary> /// <param name="tripleCollection">Triple Collection.</param> public RohGraph(BaseTripleCollection tripleCollection) : base(tripleCollection) { }
/// <summary> /// Creates a new thread safe triple collection which wraps the provided triple collection /// </summary> /// <param name="tripleCollection">Triple Collection</param> public ThreadSafeTripleCollection(BaseTripleCollection tripleCollection) : base(tripleCollection) { }
/// <summary> /// Helper method for detaching the necessary event Handlers from a Triple Collection. /// </summary> /// <param name="tripleCollection">Triple Collection.</param> /// <remarks> /// May be useful if you replace the Triple Collection after instantiation e.g. as done in <see cref="Query.SparqlView">SparqlView</see>'s. /// </remarks> protected void DetachEventHandlers(BaseTripleCollection tripleCollection) { tripleCollection.TripleAdded -= TripleAddedHandler; tripleCollection.TripleRemoved -= TripleRemovedHandler; }
/// <summary> /// Helper method for attaching the necessary event Handlers to a Triple Collection /// </summary> /// <param name="tripleCollection">Triple Collection</param> /// <remarks> /// May be useful if you replace the Triple Collection after instantiation e.g. as done in <see cref="Query.SparqlView">SparqlView</see>'s /// </remarks> protected void AttachEventHandlers(BaseTripleCollection tripleCollection) { tripleCollection.TripleAdded += this.TripleAddedHandler; tripleCollection.TripleRemoved += this.TripleRemovedHandler; }
/// <summary> /// Creates a new Thread Safe graph using the given Triple Collection /// </summary> /// <param name="tripleCollection">Triple Collection</param> public ThreadSafeGraph(BaseTripleCollection tripleCollection) : base(new ThreadSafeTripleCollection(tripleCollection)) { }
public Graph(BaseTripleCollection tripleCollection, BaseNodeCollection nodeCollection) : base(tripleCollection, nodeCollection) { }