Class TripleStore
Class for representing Triple Stores which are collections of RDF Graphs.
Inheritance
Implements
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public class TripleStore : BaseTripleStore, IInMemoryQueryableStore, ISparqlUpdateTripleStore, IUpdateableTripleStore, ITripleStore, IDisposable
Constructors
| Edit this page View SourceTripleStore()
Creates a new Triple Store using a new empty Graph collection.
Declaration
public TripleStore()
TripleStore(BaseGraphCollection)
Creates a new Triple Store using the given Graph collection which may be non-empty.
Declaration
public TripleStore(BaseGraphCollection graphCollection)
Parameters
Type | Name | Description |
---|---|---|
BaseGraphCollection | graphCollection | Graph Collection. |
TripleStore(BaseGraphCollection, IUriFactory)
Creates a mew triple store using the given graph collection which may be non-empty.
Declaration
public TripleStore(BaseGraphCollection graphCollection, IUriFactory uriFactory)
Parameters
Type | Name | Description |
---|---|---|
BaseGraphCollection | graphCollection | The graph collection. |
IUriFactory | uriFactory | The preferred URI factory to use when creating URIs in this triple store. |
Fields
| Edit this page View Source_inferenceGraphUri
Graph Uri for the special Graph used to store inferred information.
Declaration
protected readonly UriNode _inferenceGraphUri
Field Value
Type | Description |
---|---|
UriNode |
_storeInferencesExternally
Controls whether inferred information is stored in a special Graph or in the original Graph.
Declaration
protected bool _storeInferencesExternally
Field Value
Type | Description |
---|---|
bool |
Properties
| Edit this page View SourceUriFactory
Get the preferred URI factory to use when creating URIs in this store.
Declaration
public override IUriFactory UriFactory { get; }
Property Value
Type | Description |
---|---|
IUriFactory |
Overrides
Methods
| Edit this page View SourceContains(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 |
---|---|
bool |
Dispose()
Disposes of a Triple Store.
Declaration
public override void Dispose()
Overrides
| Edit this page View SourceExecuteUpdate(string)
Executes an Update against the Triple Store.
Declaration
public void ExecuteUpdate(string update)
Parameters
Type | Name | Description |
---|---|---|
string | update | SPARQL Update Command(s). |
Remarks
As per the SPARQL 1.1 Update specification the command string may be a sequence of commands.
ExecuteUpdate(SparqlUpdateCommand)
Executes a single Update Command against the Triple Store.
Declaration
public void ExecuteUpdate(SparqlUpdateCommand update)
Parameters
Type | Name | Description |
---|---|---|
SparqlUpdateCommand | update | SPARQL Update Command. |
ExecuteUpdate(SparqlUpdateCommandSet)
Executes a set of Update Commands against the Triple Store.
Declaration
public void ExecuteUpdate(SparqlUpdateCommandSet updates)
Parameters
Type | Name | Description |
---|---|---|
SparqlUpdateCommandSet | updates | SPARQL Update Command Set. |
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
[Obsolete("Replaced by GetTriples(List<IRefNode>, Uri)")]
public IEnumerable<Triple> GetTriples(List<Uri> graphUris, Uri uri)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
Uri | uri | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriples(List<Uri>, INode)
Selects all Triples which contain the given Node from a Subset of Graphs in the Triple Store.
Declaration
[Obsolete("Replaced by GetTriples(List<IRefNode>, INode)")]
public IEnumerable<Triple> GetTriples(List<Uri> graphUris, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriples(List<IRefNode>, 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<IRefNode> graphNames, Uri uri)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
Uri | uri | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriples(List<IRefNode>, INode)
Selects all Triples which contain the given Node from a Subset of Graphs in the Triple Store.
Declaration
public IEnumerable<Triple> GetTriples(List<IRefNode> graphNames, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|---|
Uri | uri | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|
IEnumerable<Triple> |
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
[Obsolete("Replaced by GetTriplesWithObject(List<IRefNode>, Uri)")]
public IEnumerable<Triple> GetTriplesWithObject(List<Uri> graphUris, Uri u)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithObject(List<Uri>, INode)
Selects all Triples where the Object is a given Node from a Subset of Graphs in the Triple Store.
Declaration
[Obsolete("Replaced by GetTriplesWithObject(List<IRefNode>, INode)")]
public IEnumerable<Triple> GetTriplesWithObject(List<Uri> graphUris, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithObject(List<IRefNode>, 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<IRefNode> graphNames, Uri u)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithObject(List<IRefNode>, 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<IRefNode> graphNames, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|---|
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|
IEnumerable<Triple> |
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
[Obsolete("Replaced by GetTriplesWithPredicate(List<IRefNode>, Uri)")]
public IEnumerable<Triple> GetTriplesWithPredicate(List<Uri> graphUris, Uri u)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithPredicate(List<Uri>, INode)
Selects all Triples where the Predicate is a given Node from a Subset of Graphs in the Triple Store.
Declaration
[Obsolete("Replaced by GetTriplesWithPredicate(List<IRefNode>, INode)")]
public IEnumerable<Triple> GetTriplesWithPredicate(List<Uri> graphUris, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithPredicate(List<IRefNode>, 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<IRefNode> graphNames, Uri u)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithPredicate(List<IRefNode>, 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<IRefNode> graphNames, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|---|
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|
IEnumerable<Triple> |
GetTriplesWithPredicateObject(INode, INode)
Selects all the Triples with the given Predicate-Object pair from all the Query Triples.
Declaration
public IEnumerable<Triple> GetTriplesWithPredicateObject(INode predicate, INode obj)
Parameters
Type | Name | Description |
---|---|---|
INode | predicate | Predicate. |
INode | obj | Object. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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
[Obsolete("Replaced by GetTriplesWithSubject(List<IRefNode>, Uri)")]
public IEnumerable<Triple> GetTriplesWithSubject(List<Uri> graphUris, Uri u)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithSubject(List<Uri>, INode)
Selects all Triples where the Subject is a given Node from a Subset of Graphs in the Triple Store.
Declaration
[Obsolete("Replaced by GetTriplesWithSubject(List<IRefNode>, INode)")]
public IEnumerable<Triple> GetTriplesWithSubject(List<Uri> graphUris, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<Uri> | graphUris | List of the Graph URIs of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithSubject(List<IRefNode>, 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<IRefNode> graphNames, Uri u)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
GetTriplesWithSubject(List<IRefNode>, 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<IRefNode> graphNames, INode n)
Parameters
Type | Name | Description |
---|---|---|
List<IRefNode> | graphNames | List of the names of Graphs you want to select over. |
INode | n | Node. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|---|
Uri | u | Uri. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |
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 |
---|---|
IEnumerable<Triple> |
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 |
---|---|
IEnumerable<Triple> |
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 predicate)
Parameters
Type | Name | Description |
---|---|---|
INode | subj | Subject. |
INode | predicate | Predicate. |
Returns
Type | Description |
---|---|
IEnumerable<Triple> |