Class TripleStore
Class for representing Triple Stores which are collections of RDF Graphs.
Inheritance
System.Object
TripleStore
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: dotNetRDF.dll
Syntax
public class TripleStore : BaseTripleStore, IInMemoryQueryableStore, IInferencingTripleStore, IUpdateableTripleStore, ITripleStore, IDisposable
Constructors
|
Improve this Doc
View Source
TripleStore()
Creates a new Triple Store using a new empty Graph collection.
Declaration
|
Improve this Doc
View Source
TripleStore(BaseGraphCollection)
Creates a new Triple Store using the given Graph collection which may be non-empty.
Declaration
public TripleStore(BaseGraphCollection graphCollection)
Parameters
Fields
|
Improve this Doc
View Source
_inferenceGraphUri
Graph Uri for the special Graph used to store inferred information.
Declaration
protected Uri _inferenceGraphUri
Field Value
Type |
Description |
System.Uri |
|
|
Improve this Doc
View Source
_reasoners
List of Reasoners that are applied to Graphs as they are added to the Triple Store.
Declaration
protected List<IInferenceEngine> _reasoners
Field Value
|
Improve this Doc
View Source
_storeInferencesExternally
Controls whether inferred information is stored in a special Graph or in the original Graph.
Declaration
protected bool _storeInferencesExternally
Field Value
Type |
Description |
System.Boolean |
|
Methods
|
Improve this Doc
View Source
AddInferenceEngine(IInferenceEngine)
Adds an Inference Engine to the Triple Store.
Declaration
public void AddInferenceEngine(IInferenceEngine reasoner)
Parameters
|
Improve this Doc
View Source
ApplyInference(IGraph)
Applies Inference to the given Graph.
Declaration
public void ApplyInference(IGraph g)
Parameters
Type |
Name |
Description |
IGraph |
g |
Graph to apply inference to. |
|
Improve this Doc
View Source
ClearInferenceEngines()
Clears all Inference Engines from the Triple Store.
Declaration
public void ClearInferenceEngines()
|
Improve this Doc
View Source
Contains(Triple)
Returns whether the Store contains the given Triple within the Query Triples.
Declaration
public bool Contains(Triple t)
Parameters
Type |
Name |
Description |
Triple |
t |
Triple to search for. |
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Dispose()
Disposes of a Triple Store.
Declaration
public override void Dispose()
Overrides
|
Improve this Doc
View Source
ExecuteQuery(String)
Executes a SPARQL Query on the Triple Store.
Declaration
[Obsolete("This method of making queries is often error prone due to misconceptions about what data is being queries and we recommend using an ISparqlQueryProcessor instead, see remarks for more discussion")]
public virtual object ExecuteQuery(string query)
Parameters
Type |
Name |
Description |
System.String |
query |
SPARQL Query as unparsed String. |
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
ExecuteQuery(IRdfHandler, ISparqlResultsHandler, String)
Executes a SPARQL Query on the Triple Store processing the results with an appropriate handler from those provided.
Declaration
[Obsolete("This method of making queries is often error prone due to misconceptions about what data is being queries and we recommend using an ISparqlQueryProcessor instead, see remarks for more discussion")]
public virtual void ExecuteQuery(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, string query)
Parameters
Type |
Name |
Description |
IRdfHandler |
rdfHandler |
RDF Handler. |
ISparqlResultsHandler |
resultsHandler |
Results Handler. |
System.String |
query |
SPARQL Query as unparsed String. |
Remarks
|
Improve this Doc
View Source
ExecuteQuery(IRdfHandler, ISparqlResultsHandler, SparqlQuery)
Executes a SPARQL Query on the Triple Store processing the results with an appropriate handler from those provided.
Declaration
[Obsolete("This method of making queries is often error prone due to misconceptions about what data is being queries and we recommend using an ISparqlQueryProcessor instead, see remarks for more discussion")]
public virtual void ExecuteQuery(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, SparqlQuery query)
Parameters
Remarks
|
Improve this Doc
View Source
ExecuteQuery(SparqlQuery)
Executes a SPARQL Query on the Triple Store.
Declaration
[Obsolete("This method of making queries is often error prone due to misconceptions about what data is being queries and we recommend using an ISparqlQueryProcessor instead, see remarks for more discussion")]
public virtual object ExecuteQuery(SparqlQuery query)
Parameters
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
ExecuteUpdate(String)
Executes an Update against the Triple Store.
Declaration
public void ExecuteUpdate(string update)
Parameters
Type |
Name |
Description |
System.String |
update |
SPARQL Update Command(s). |
|
Improve this Doc
View Source
ExecuteUpdate(SparqlUpdateCommand)
Executes a single Update Command against the Triple Store.
Declaration
public void ExecuteUpdate(SparqlUpdateCommand update)
Parameters
|
Improve this Doc
View Source
ExecuteUpdate(SparqlUpdateCommandSet)
Executes a set of Update Commands against the Triple Store.
Declaration
public void ExecuteUpdate(SparqlUpdateCommandSet updates)
Parameters
|
Improve this Doc
View Source
GetTriples(List<Uri>, Uri)
Selects all Triples which have a Uri Node with the given Uri from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriples(List<Uri> graphUris, Uri uri)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
System.Uri |
uri |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriples(List<Uri>, INode)
Selects all Triples which contain the given Node from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriples(List<Uri> graphUris, INode n)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriples(Uri)
Selects all Triples which have a Uri Node with the given Uri from all the Query Triples.
Declaration
public IEnumerable<Triple> GetTriples(Uri uri)
Parameters
Type |
Name |
Description |
System.Uri |
uri |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriples(INode)
Selects all Triples which contain the given Node from all Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriples(INode n)
Parameters
Type |
Name |
Description |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithObject(List<Uri>, Uri)
Selects all Triples where the Object is a Uri Node with the given Uri from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithObject(List<Uri> graphUris, Uri u)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
System.Uri |
u |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithObject(List<Uri>, INode)
Selects all Triples where the Object is a given Node from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithObject(List<Uri> graphUris, INode n)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithObject(Uri)
Selects all Triples where the Object is a Uri Node with the given Uri from all Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithObject(Uri u)
Parameters
Type |
Name |
Description |
System.Uri |
u |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithObject(INode)
Selects all Triples where the Object is a given Node from all Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithObject(INode n)
Parameters
Type |
Name |
Description |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithPredicate(List<Uri>, Uri)
Selects all Triples where the Predicate is a Uri Node with the given Uri from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicate(List<Uri> graphUris, Uri u)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
System.Uri |
u |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithPredicate(List<Uri>, INode)
Selects all Triples where the Predicate is a given Node from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicate(List<Uri> graphUris, INode n)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithPredicate(Uri)
Selects all Triples where the Predicate is a Uri Node with the given Uri from all Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicate(Uri u)
Parameters
Type |
Name |
Description |
System.Uri |
u |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithPredicate(INode)
Selects all Triples where the Predicate is a given Node from all Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicate(INode n)
Parameters
Type |
Name |
Description |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithPredicateObject(INode, INode)
Selects all the Triples with the given Predicate-Object pair from all the Query Triples.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicateObject(INode pred, INode obj)
Parameters
Type |
Name |
Description |
INode |
pred |
Predicate. |
INode |
obj |
Object. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithSubject(List<Uri>, Uri)
Selects all Triples where the Subject is a Uri Node with the given Uri from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithSubject(List<Uri> graphUris, Uri u)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
System.Uri |
u |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithSubject(List<Uri>, INode)
Selects all Triples where the Subject is a given Node from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithSubject(List<Uri> graphUris, INode n)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<System.Uri> |
graphUris |
List of the Graph URIs of Graphs you want to select over. |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithSubject(Uri)
Selects all Triples where the Subject is a Uri Node with the given Uri from all Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithSubject(Uri u)
Parameters
Type |
Name |
Description |
System.Uri |
u |
Uri. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithSubject(INode)
Selects all Triples where the Subject is a given Node from all Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriplesWithSubject(INode n)
Parameters
Type |
Name |
Description |
INode |
n |
Node. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithSubjectObject(INode, INode)
Selects all the Triples with the given Subject-Object pair from all the Query Triples.
Declaration
public IEnumerable<Triple> GetTriplesWithSubjectObject(INode subj, INode obj)
Parameters
Type |
Name |
Description |
INode |
subj |
Subject. |
INode |
obj |
Object. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
GetTriplesWithSubjectPredicate(INode, INode)
Selects all the Triples with the given Subject-Predicate pair from all the Query Triples.
Declaration
public IEnumerable<Triple> GetTriplesWithSubjectPredicate(INode subj, INode pred)
Parameters
Type |
Name |
Description |
INode |
subj |
Subject. |
INode |
pred |
Predicate. |
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Triple> |
|
|
Improve this Doc
View Source
OnGraphAdded(Object, GraphEventArgs)
Event Handler for the
GraphAdded event of the underlying Graph Collection which calls the normal event processing of the parent class
BaseTripleStore and then applies Inference to the newly added Graph.
Declaration
protected override void OnGraphAdded(object sender, GraphEventArgs args)
Parameters
Type |
Name |
Description |
System.Object |
sender |
Sender. |
GraphEventArgs |
args |
Graph Event Arguments. |
Overrides
|
Improve this Doc
View Source
RemoveInferenceEngine(IInferenceEngine)
Removes an Inference Engine from the Triple Store.
Declaration
public void RemoveInferenceEngine(IInferenceEngine reasoner)
Parameters
Implements
System.IDisposable
Extension Methods