@faubulous/mentor-rdf
    Preparing search index...

    Class Store

    Implements

    • Source<rdfjs.Quad>
    Index

    Constructors

    Properties

    reasoner?: Reasoner

    The reasoner to be used for inference.

    Accessors

    • get dataFactory(): DataFactory

      Get the RDF.js DataFactory used by the store.

      Returns DataFactory

    • get size(): number

      Get the number of triples in all graphs of the store.

      Returns number

    Methods

    • Returns Iterator<Quad, any, any>

    • Add a quad to the store. Existing quads with the same subject, predicate, object, and graph will be ignored.

      Parameters

      • quad: Quad

        The quad to be added.

      Returns this

      The store instance.

    • Indicate if there are triples matching the given pattern in the store.

      Parameters

      • graphUris: string | string[] | undefined

        Optional graph URI or array of graph URIs to query.

      • subject: Quad_Subject | null

        A subject URI or null to match any subject.

      • predicate: Quad_Predicate | null

        A predicate URI or null to match any predicate.

      • object: Quad_Object | null

        An object URI or null to match any object.

      • OptionalincludeInferred: boolean

      Returns boolean

      true if there are triples matching the pattern, false otherwise.

    • Returns the exact cardinality of the quads matching the pattern.

      Parameters

      • Optionalsubject: Term | null

        The optional subject.

      • Optionalpredicate: Term | null

        The optional predicate.

      • Optionalobject: Term | null

        The optional object.

      • Optionalgraph: Term | null

        The optional graph.

      Returns number

    • Delete a quad from the store.

      Parameters

      • quad: Quad

        The quad to be deleted.

      Returns this

      The store instance.

    • Delete named graphs from the store.

      Parameters

      • graphUris: string[]

        URIs of the graphs to be deleted.

      Returns void

    • Apply inference to the given graph and store the triples in the associated inference graph.

      Parameters

      • graphUri: string | Quad_Graph

        A graph URI.

      Returns void

    • Get the first triple matching the given pattern in the store.

      Parameters

      • graphUris: string | string[] | undefined

        Optional graph URI or array of graph URIs to query.

      • subject: Quad_Subject | null

        A subject URI or null to match any subject.

      • predicate: Quad_Predicate | null

        A predicate URI or null to match any predicate.

      • object: Quad_Object | null

        An object URI or null to match any object.

      • OptionalincludeInferred: boolean

      Returns Quad

      The first triple that matches the pattern.

      If no triple is found matching the pattern.

    • Get the URIs of the graphs in the triple store.

      Returns string[]

      An array of graph URIs in no particular order.

    • Get the URIs of ordered list members in the store.

      Parameters

      • graphUris: string | string[] | undefined

        Optional graph URI or array of graph URIs to query.

      • listUri: string

        URI of the list to get the items from.

      Returns string[]

      An array of URIs of the items in the list.

    • Indicates if the store contains a specific quad.

      Parameters

      • quad: Quad

        The quad to be checked.

      Returns boolean

      true if the quad is found in the store, false otherwise.

    • Indicates if the store contains triples in a given graph.

      Parameters

      • graphUri: string | Quad_Graph

        A graph URI.

      Returns boolean

      true if the store contains triples in the graph URI, false otherwise.

    • Loads a set of W3C Standard ontologies into the store (RDF, RDFA, RDFS, OWL, SKOS, SHACL, XSD).

      Parameters

      • executeInference: boolean = true

      Returns Promise<void>

    • Create an RDF store from N3, Turtle or N-Triples data.

      Parameters

      • input: string | EventEmitter<any>

        Input data or stream in to be parsed.

      • graphUri: string

        URI of the graph to in which the triples will be created.

      • executeInference: boolean = true

        Indicates if inference should be executed after loading the triples.

      • clearGraph: boolean = true

        Indicates if the graph should be cleared before loading.

      • OptionalonQuad: (quad: Quad) => void

        Callback function that will be called for each parsed triple.

      Returns Promise<Store>

      A promise that resolves to an RDF store.

    • Create an RDF store from RDF/XML data.

      Parameters

      • input: string | EventEmitter<any>

        Input data or stream format to be parsed.

      • graphUri: string

        URI of the graph to in which the triples will be created.

      • executeInference: boolean = true

        Indicates if inference should be executed after loading the triples.

      • clearGraph: boolean = true

        Indicates if the graph should be cleared before loading.

      • OptionalonQuad: (quad: Quad) => void

        Callback function that will be called for each parsed triple.

      Returns Promise<Store>

      A promise that resolves to an RDF store.

    • Returns a stream of quads matching the given pattern.

      Parameters

      • Optionalsubject: Term | null

        The optional subject.

      • Optionalpredicate: Term | null

        The optional predicate.

      • Optionalobject: Term | null

        The optional object.

      • Optionalgraph: Term | null

        The optional graph.

      Returns Stream<Quad>

      A stream of matching quads.

    • Query the store for triples matching the given pattern supporting multiple graphs.

      Parameters

      • graphUris: string | string[] | undefined

        Optional graph URI or array of graph URIs to query.

      • subject: Quad_Subject | null

        A subject URI or null to match any subject.

      • predicate: Quad_Predicate | null

        A predicate URI or null to match any predicate.

      • object: Quad_Object | null

        An object URI or null to match any object.

      • OptionalincludeInferred: boolean

      Returns Generator<Quad, void, any>

    • Write the triples in the store into a string in Turtle format.

      Parameters

      • sourceGraphUri: string

        A graph URI.

      • targetFormat: string = 'text/turtle'

        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.

      Returns Promise<string>

      A string serialization of the triples in the graph in the specified format.