Show / Hide Table of Contents

Interface IInMemoryQueryableStore

Interface for Triple Stores which can be queried in memory using method calls or the SPARQL implementation contained in this library.
Inherited Members
ITripleStore.IsEmpty
ITripleStore.Graphs
ITripleStore.Triples
ITripleStore.Add(IGraph)
ITripleStore.Add(IGraph, Boolean)
ITripleStore.AddFromUri(Uri)
ITripleStore.AddFromUri(Uri, Boolean)
ITripleStore.Remove(Uri)
ITripleStore.HasGraph(Uri)
ITripleStore.Item[Uri]
ITripleStore.GraphAdded
ITripleStore.GraphRemoved
ITripleStore.GraphChanged
ITripleStore.GraphCleared
ITripleStore.GraphMerged
System.IDisposable.Dispose()
Namespace: VDS.RDF
Assembly: dotNetRDF.dll
Syntax
public interface IInMemoryQueryableStore : ITripleStore, IDisposable
Remarks

An in memory Triple Store will typically load most of the Graphs and consequently Triples contained within it into Memory as the in memory SPARQL implementation only operates over the part of the Triple Store loaded in memory. This being said there is no reason why an in memory store can't provide a Snapshot view of an underlying store to allow only the relevant parts of Store to be loaded and queried.

All the Selection Methods which do not specify a subset of Graphs on such a Triple Store should operate over the entire store.

Methods

| Improve this Doc View Source

Contains(Triple)

Returns whether a given Triple is contained anywhere in the Query Triples.
Declaration
bool Contains(Triple t)
Parameters
Type Name Description
Triple t Triple to check for existence of.
Returns
Type Description
System.Boolean
| 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")]
object ExecuteQuery(string query)
Parameters
Type Name Description
System.String query SPARQL Query as an unparsed string.
Returns
Type Description
System.Object
Remarks

This method of making queries often leads to no results because of misconceptions about what data is being queries. dotNetRDF's SPARQL engine only queries the default unnamed graph of the triple store (the graph added with a null URI) by default unless your query uses FROM clauses to change the default graph or you use GRAPH clauses to access named graphs in the store. Therefore a common mistake is to add a single graph to the store and then query the store which typically results in no results because usually the added graph is named and so is not queried.

We recommend using a ISparqlQueryProcessor instead for making queries over in-memory data since using our standard implementation (LeviathanQueryProcessor) affords you much more explicit control over which graphs are queried.

| 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")]
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 an unparsed string.
Remarks

This method of making queries often leads to no results because of misconceptions about what data is being queries. dotNetRDF's SPARQL engine only queries the default unnamed graph of the triple store (the graph added with a null URI) by default unless your query uses FROM clauses to change the default graph or you use GRAPH clauses to access named graphs in the store. Therefore a common mistake is to add a single graph to the store and then query the store which typically results in no results because usually the added graph is named and so is not queried.

We recommend using a ISparqlQueryProcessor instead for making queries over in-memory data since using our standard implementation (LeviathanQueryProcessor) affords you much more explicit control over which graphs are queried.

| 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")]
void ExecuteQuery(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, SparqlQuery query)
Parameters
Type Name Description
IRdfHandler rdfHandler RDF Handler.
ISparqlResultsHandler resultsHandler Results Handler.
SparqlQuery query Parsed SPARQL Query.
Remarks

This method of making queries often leads to no results because of misconceptions about what data is being queries. dotNetRDF's SPARQL engine only queries the default unnamed graph of the triple store (the graph added with a null URI) by default unless your query uses FROM clauses to change the default graph or you use GRAPH clauses to access named graphs in the store. Therefore a common mistake is to add a single graph to the store and then query the store which typically results in no results because usually the added graph is named and so is not queried.

We recommend using a ISparqlQueryProcessor instead for making queries over in-memory data since using our standard implementation (LeviathanQueryProcessor) affords you much more explicit control over which graphs are queried.

| 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")]
object ExecuteQuery(SparqlQuery query)
Parameters
Type Name Description
SparqlQuery query SPARQL Query as a SparqlQuery instance.
Returns
Type Description
System.Object
Remarks

This method of making queries often leads to no results because of misconceptions about what data is being queries. dotNetRDF's SPARQL engine only queries the default unnamed graph of the triple store (the graph added with a null URI) by default unless your query uses FROM clauses to change the default graph or you use GRAPH clauses to access named graphs in the store. Therefore a common mistake is to add a single graph to the store and then query the store which typically results in no results because usually the added graph is named and so is not queried.

We recommend using a ISparqlQueryProcessor instead for making queries over in-memory data since using our standard implementation (LeviathanQueryProcessor) affords you much more explicit control over which graphs are queried.

| 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
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
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
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 the Query Triples.
Declaration
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
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
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 the Query Triples.
Declaration
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 the Query Triples.
Declaration
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
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
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 the Query Triples.
Declaration
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 the Query Triples.
Declaration
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
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
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
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 the Query Triples.
Declaration
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 the Query Triples.
Declaration
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
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
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>

Extension Methods

Extensions.AsEnumerable<T>(T)
TripleStoreExtensions.LoadFromFile(ITripleStore, String, IStoreReader)
TripleStoreExtensions.LoadFromFile(ITripleStore, String)
TripleStoreExtensions.LoadFromUri(ITripleStore, Uri, IStoreReader)
TripleStoreExtensions.LoadFromUri(ITripleStore, Uri)
TripleStoreExtensions.LoadFromString(ITripleStore, String, IStoreReader)
TripleStoreExtensions.LoadFromString(ITripleStore, String)
TripleStoreExtensions.LoadFromEmbeddedResource(ITripleStore, String, IStoreReader)
TripleStoreExtensions.LoadFromEmbeddedResource(ITripleStore, String)
TripleStoreExtensions.SaveToFile(ITripleStore, String, IStoreWriter)
TripleStoreExtensions.SaveToFile(ITripleStore, String)
  • Improve this Doc
  • View Source
In This Article
  • Methods
    • Contains(Triple)
    • ExecuteQuery(String)
    • ExecuteQuery(IRdfHandler, ISparqlResultsHandler, String)
    • ExecuteQuery(IRdfHandler, ISparqlResultsHandler, SparqlQuery)
    • ExecuteQuery(SparqlQuery)
    • GetTriples(List<Uri>, Uri)
    • GetTriples(List<Uri>, INode)
    • GetTriples(Uri)
    • GetTriples(INode)
    • GetTriplesWithObject(List<Uri>, Uri)
    • GetTriplesWithObject(List<Uri>, INode)
    • GetTriplesWithObject(Uri)
    • GetTriplesWithObject(INode)
    • GetTriplesWithPredicate(List<Uri>, Uri)
    • GetTriplesWithPredicate(List<Uri>, INode)
    • GetTriplesWithPredicate(Uri)
    • GetTriplesWithPredicate(INode)
    • GetTriplesWithPredicateObject(INode, INode)
    • GetTriplesWithSubject(List<Uri>, Uri)
    • GetTriplesWithSubject(List<Uri>, INode)
    • GetTriplesWithSubject(Uri)
    • GetTriplesWithSubject(INode)
    • GetTriplesWithSubjectObject(INode, INode)
    • GetTriplesWithSubjectPredicate(INode, INode)
  • Extension Methods
Back to top Generated by DocFX