Get the RDF.js DataFactory used by the store.
Get the number of triples in all graphs of the store.
Get a monotonic counter that is incremented on every mutation of the store. Can be used to cheaply detect whether the store has changed.
Add a quad to the store. Existing quads with the same subject, predicate, object, and graph will be ignored.
The quad to be added.
The store instance.
Indicate if there are triples matching the given pattern in the store.
Optional graph URI or array of graph URIs to query.
A subject URI or null to match any subject.
A predicate URI or null to match any predicate.
An object URI or null to match any object.
OptionalincludeInferred: booleantrue if there are triples matching the pattern, false otherwise.
Get an RDF/JS Source interface for the store that streams matching quads.
Primarily intended for query engines such as Comunica that operate on quad streams.
A source that returns a stream of quads for a given pattern.
Removes every quad from the store and releases the memory of the underlying store, including its term dictionary, which never shrinks when quads are deleted. The version counters keep increasing so that cached views and validators notice the change.
Returns the exact cardinality of the quads matching the pattern.
Optionalsubject: Term | null
The optional subject.
Optionalpredicate: Term | null
The optional predicate.
Optionalobject: Term | null
The optional object.
Optionalgraph: Term | null
The optional graph.
Delete a quad from the store.
The quad to be deleted.
The store instance.
Delete named graphs from the store.
URIs of the graphs to be deleted; an empty string denotes the default graph.
Whether to also delete the inference graph of each graph, as named by the reasoner's target URI generator. Ignored when the store has no reasoner.
Apply inference to the given graph and store the triples in the associated inference graph.
A graph URI.
Get the first triple matching the given pattern in the store.
Optional graph URI or array of graph URIs to query.
A subject URI or null to match any subject.
A predicate URI or null to match any predicate.
An object URI or null to match any object.
OptionalincludeInferred: booleanThe first triple that matches the pattern.
Get a read-only DatasetCore view of all quads in the specified graphs.
The view is lazy and live: it reflects the current contents of the store without
copying any quads. If you need an immutable snapshot, copy the view into a new
dataset, e.g. RdfStore.createDefault().asDataset().
OptionalgraphUris: string | string[]
Optional graph URI or array of graph URIs. If undefined, all graphs are included.
OptionalincludeInferred: boolean
Whether to include inferred triples. If undefined, inferred triples
are included when a reasoner is available. If false, the inference graphs of the given
graphs are left out, or, without graphs, every inference graph of the store. If true
without a reasoner, an error is thrown.
A read-only dataset view of the matching quads.
Get the URIs of the graphs in the triple store.
An array of graph URIs in no particular order.
Get a monotonic counter for a single graph, incremented on every mutation of the graph. Can be used to cheaply detect whether the contents of a graph have changed.
A graph URI.
The current version of the graph; 0 if the graph was never modified.
Get the URIs of ordered list members in the store.
Optional graph URI or array of graph URIs to query.
URI of the list to get the items from.
An array of URIs of the items in the list.
Indicates if the store contains a specific quad.
The quad to be checked.
true if the quad is found in the store, false otherwise.
Indicates if the store contains triples in a given graph.
A graph URI.
true if the store contains triples in the graph URI, false otherwise.
Indicates whether a graph holds the triples the reasoner inferred from another graph.
A graph term or URI.
true if the graph is an inference graph of the reasoner of this store, false otherwise or without a reasoner.
Indicates whether a quad was inferred by the reasoner, i.e. whether it is stored in an inference graph. A triple that is asserted and inferred exists as two quads; only the quad in the inference graph is inferred.
A quad.
true if the quad is stored in an inference graph, false otherwise.
Loads a set of W3C Standard ontologies into the store (RDF, RDFA, RDFS, OWL, SKOS, SHACL, XSD) and the SPARQL Syntax Vocabulary.
The ontology sources embedded in this package will be removed in the next major
release. Import the published Turtle files instead (e.g. @faubulous/mentor-rdf/ontologies/rdfs.ttl)
and load them with loadTurtle.
Create an RDF store from RDF/XML data.
Input data or stream format to be parsed.
URI of the graph to in which the triples will be created.
Indicates if inference should be executed after loading the triples.
Indicates if the graph should be cleared before loading.
OptionalonQuad: (quad: Quad) => void
Callback function that will be called for each parsed triple.
A promise that resolves to an RDF store.
Create an RDF store from N-Quads data.
Input string in N-Quads format.
URI of the default graph to use when quads have no graph component.
Indicates if inference should be executed after loading the triples.
Indicates if the graph should be cleared before loading.
OptionalonQuad: (quad: Quad) => void
Callback function that will be called for each parsed triple.
The store instance.
Create an RDF store from Turtle, N3 or N-Triples data.
Input string in Turtle, N3 or N-Triples format.
URI of the graph to in which the triples will be created.
Indicates if inference should be executed after loading the triples.
Indicates if the graph should be cleared before loading.
OptionalonQuad: (quad: Quad) => void
Callback function that will be called for each parsed triple.
A promise that resolves to an RDF store.
Returns a lazy, read-only dataset view of the quads matching the given pattern.
Implements the RDF/JS DatasetCore.match semantics: a graph names exactly that
graph and no graph means every graph of the store, inference graphs included.
The result reflects the current contents of the store and does not copy any
quads. Because the view iterates the live indexes, do not add or delete quads
while iterating it; take a snapshot with Array.from(...) first.
Optionalsubject: Term | null
The optional subject.
Optionalpredicate: Term | null
The optional predicate.
Optionalobject: Term | null
The optional object.
Optionalgraph: Term | null
The optional graph.
A read-only dataset view of the matching quads.
Query the store for triples matching the given pattern supporting multiple graphs.
The iterator is live: do not add or delete quads while iterating; take a snapshot
with Array.from(...) first.
Optional graph URI or array of graph URIs to query.
A subject URI or null to match any subject.
A predicate URI or null to match any predicate.
An object URI or null to match any object.
OptionalincludeInferred: boolean
Whether to read the inference graphs. With graphs given, undefined and
true add the inference graph of each graph when a reasoner is available and false reads only
the given graphs. Without graphs, undefined and true read every graph of the store and false
reads every graph except the inference graphs. true without a reasoner throws.
Synchronously iterate the quads matching a single pattern. The iterator is live:
do not add or delete quads while iterating; take a snapshot with Array.from(...) first.
Optionalsubject: Term | null
The optional subject.
Optionalpredicate: Term | null
The optional predicate.
Optionalobject: Term | null
The optional object.
Optionalgraph: Term | null
The optional graph.
Write the triples in the store into a string in Turtle format.
A graph URI.
Optional mime type of the serialization format (e.g., 'text/turtle').
OptionaltargetGraphUri: string
Optional target graph URI. If not provided, the source graph URI will be used for serialization formats that support quads.
Optionalprefixes: Record<string, string>
Optional prefixes to be used in the serialization.
A string serialization of the triples in the graph in the specified format.
Create a new RDF triple store.