solid-ui
    Preparing search index...

    Class Store

    Indexed Formula aka Store

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new formula

      Parameters

      • Optionalfeatures: FeaturesType

        What sort of automatic processing to do? Array of string

        • sameAs

          Smush together A and B nodes whenever { A sameAs B }

      • Optionalopts: FormulaOpts
        • rdfFactory

          The data factory that should be used by the store

        • rdfArrayRemove

          Function which removes statements from the store

        • dataCallback

          Callback when a statement is added to the store, will not trigger when adding duplicates

      Returns Store

    Properties

    _existentialVariables?: BlankNode[]
    _universalVariables?: NamedNode[]
    aliases: any[]

    Reverse mapping to redirection: aliases for this

    classActions: { [k: string]: Function[] }

    Map of iri predicates to functions to call when adding { s type X }

    classOrder: number

    The class order for this node

    constraints: readonly any[]
    features: FeaturesType
    fetcher?: Fetcher

    The accompanying fetcher instance.

    Is set by the fetcher when initialized.

    HTTPRedirects: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

    Redirections we got from HTTP

    index: [
        Statement<SubjectType, PredicateType, ObjectType, GraphType>[],
        Statement<SubjectType, PredicateType, ObjectType, GraphType>[],
        Statement<SubjectType, PredicateType, ObjectType, GraphType>[],
        Statement<SubjectType, PredicateType, ObjectType, GraphType>[],
    ]
    initBindings: readonly any[]
    isVar: number
    namespaces: { [key: string]: string }

    Dictionary of namespace prefixes

    ns: (nsuri: string, factory?: RdfJsDataFactory) => (ln: string) => NamedNode

    A namespace for the specified namespace's URI

    Type declaration

      • (nsuri: string, factory?: RdfJsDataFactory): (ln: string) => NamedNode
      • Gets a namespace for the specified namespace's URI

        Parameters

        • nsuri: string

          The URI for the namespace

        • Optionalfactory: RdfJsDataFactory

          The factory for creating named nodes with

        Returns (ln: string) => NamedNode

    The URI for the namespace

    objectIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

    Array of statements with this X as object

    optional: readonly any[]
    predicateIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

    Array of statements with this X as predicate

    propertyActions: { [k: string]: Function[] }

    Map of iri predicates to functions to call when getting statement with {s X o}

    rdfFactory: any

    The factory used to generate statements and terms

    redirections: any[]

    Redirect to lexically smaller equivalent symbol

    statements: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
    subjectIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

    Array of statements with this X as subject

    termType: "Graph"

    The type of node

    updater?: UpdateManager

    An UpdateManager initialised to this store

    value: string

    The node's value

    whyIndex: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

    Array of statements with X as provenance

    fromValue: <T extends FromValueReturns>(value: ValueType) => T
    handleRDFType: Function
    toJS: (
        term: any,
    ) =>
        | string
        | boolean
        | object
        | Number
        | Date
        | (string | boolean | object | Number | Date)[]

    Accessors

    • get length(): number

      Returns the number of statements contained in this IndexedFormula. (Getter proxy to this.statements). Usage:

      var kb = rdf.graph()
      kb.length // -> 0

      Returns number

    • get defaultGraphURI(): string

      Gets the URI of the default graph

      Returns string

    Methods

    • Adds a triple (quad) to the store.

      Parameters

      • subj:
            | Quad_Subject
            | Statement<SubjectType, PredicateType, ObjectType, GraphType>
            | Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
            | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>
            | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

        The thing about which the fact a relationship is asserted. Also accepts a statement or an array of Statements.

      • Optionalpred: Quad_Predicate

        The relationship which is asserted

      • Optionalobj: string | Term

        The object of the relationship, e.g. another thing or a value. If passed a string, this will become a literal.

      • Optionalwhy: Quad_Graph

        The document in which the triple (S,P,O) was or will be stored on the web

      Returns
          | null
          | number
          | Store
          | Statement<SubjectType, PredicateType, ObjectType, GraphType>

      The statement added to the store, or the store

    • Adds all the statements to this formula

      Parameters

      • statements: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

        A collection of statements

      Returns void

    • Add a callback which will be triggered after a statement has been added to the store.

      Parameters

      • cb: (q: Quad) => void

      Returns void

    • Parameters

      • st: Quad

      Returns number

      Use {add} instead

    • Return all equivalent URIs by which this is known

      Parameters

      Returns NamedNode[]

    • Follow link from one node, using one wildcard, looking for one

      For example, any(me, knows, null, profile) - a person I know accoring to my profile . any(me, knows, null, null) - a person I know accoring to anything in store . any(null, knows, me, null) - a person who know me accoring to anything in store .

      Parameters

      • Optionals: null | Quad_Subject

        A node to search for as subject, or if null, a wildcard

      • Optionalp: null | Quad_Predicate

        A node to search for as predicate, or if null, a wildcard

      • Optionalo: null | Quad_Object

        A node to search for as object, or if null, a wildcard

      • Optionalg: null | Quad_Graph

        A node to search for as graph, or if null, a wildcard

      Returns null | Node

      A node which match the wildcard position, or null

    • Gets the first JavaScript object equivalent to a node based on the specified pattern

      Parameters

      • Optionals: null | Quad_Subject

        The subject

      • Optionalp: null | Quad_Predicate

        The predicate

      • Optionalo: null | Quad_Object

        The object

      • Optionalg: null | Quad_Graph

        The graph that contains the statement

      Returns any

    • Gets the first statement that matches the specified pattern

      Parameters

      • Optionals: null | Quad_Subject
      • Optionalp: null | Quad_Predicate
      • Optionalo: null | Quad_Object
      • Optionalg: null | Quad_Graph

      Returns undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>

    • Gets the value of a node that matches the specified pattern

      Parameters

      • Optionals: null | Quad_Subject

        The subject

      • Optionalp: null | Quad_Predicate

        The predicate

      • Optionalo: null | Quad_Object

        The object

      • Optionalg: null | Quad_Graph

        The graph that contains the statement

      Returns string | void

    • Apply a set of statements to be deleted and to be inserted

      Parameters

      • patch: {
            delete?: readonly Statement<
                SubjectType,
                PredicateType,
                ObjectType,
                GraphType,
            >[];
            patch?: readonly Statement<
                SubjectType,
                PredicateType,
                ObjectType,
                GraphType,
            >[];
            where?: any;
        }

        The set of statements to be deleted and to be inserted

      • target: NamedNode

        The name of the document to patch

      • patchCallback: (errorString?: string) => void

        Callback to be called when patching is complete

      Returns void

    • Shortcut for adding blankNodes

      Parameters

      • Optionalid: string

      Returns BlankNode

    • Finds the types in the list which have no stored subtypes These are a set of classes which provide by themselves complete information -- the other classes are redundant for those who know the class DAG.

      Parameters

      • types: any

        A map of the types

      Returns any

    • Returns the symbol with canonical URI as smushed

      Parameters

      • Optionalterm: Term

        An RDF node

      Returns Node

    • Checks this formula for consistency

      Returns void

    • Checks a list of statements for consistency

      Parameters

      • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

        The list of statements to check

      • Optionalfrom: number

        An index with the array ['subject', 'predicate', 'object', 'why']

      Returns boolean | void

    • Closes this formula (and return it)

      Returns Store

    • Compares this node with another

      Parameters

      • other: Node

        The other node

      Returns number

      to check if two nodes are equal

    • Parameters

      • u1: Term
      • u2: Term

      Returns number

    • Trace statements which connect directly, or through bnodes

      Parameters

      • subject: Quad_Subject

        The node to start looking for statments

      • doc: Quad_Graph

        The document to be searched, or null to search all documents

      • OptionalexcludePredicateURIs: readonly string[]

      Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

      an array of statements, duplicate statements are suppresssed.

    • replaces

      Parameters

      • template: Quad_Subject

        node to copy

      • target: Quad_Subject

        node to copy to

      • Optionalflags: ("two-direction" | "delete")[]

        Whether or not to do a two-directional copy and/or delete triples

      Returns void

      and add appropriate triples removes no triples by default and is a one-direction replication

    • N3 allows for declaring blank nodes, this function enables that support

      Parameters

      • x: BlankNode

        The blank node to be declared, supported in N3

      Returns BlankNode

    • Follow links from one node, using one wildcard.

      For example, each(me, knows, null, profile) - people I know accoring to my profile . each(me, knows, null, null) - people I know accoring to anything in store . each(null, knows, me, null) - people who know me accoring to anything in store .

      Parameters

      • Optionals: null | Quad_Subject

        A node to search for as subject, or if null, a wildcard

      • Optionalp: null | Quad_Predicate

        A node to search for as predicate, or if null, a wildcard

      • Optionalo: null | Quad_Object

        A node to search for as object, or if null, a wildcard

      • Optionalg: null | Quad_Graph

        A node to search for as graph, or if null, a wildcard

      Returns Node[]

      • An array of nodes which match the wildcard position
    • Test whether this formula is equals to {other}

      Parameters

      Returns boolean

    • Simplify graph in store when we realize two identifiers are equivalent We replace the bigger with the smaller.

      Parameters

      • u1in: Term

        The first node

      • u2in: Term

        The second node

      Returns boolean

    • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

      Parameters

      • thisClass: any

      Returns MembersMap

      a hash of URIs

    • For thisClass or any subclass, anything which has it is its type or is the object of something which has the type as its range, or subject of something which has the type as its domain We don't bother doing subproperty (yet?)as it doesn't seeem to be used much. Get all the Classes of which we can RDFS-infer the subject is a member

      Parameters

      • subject: Node

        A named node

      Returns UriMap

    • Get all the Classes of which we can RDFS-infer the subject is a superclass Returns a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

      Parameters

      Returns { [uri: string]: boolean }

    • Get all the Classes of which we can RDFS-infer the subject is a subclass

      Parameters

      • subject: Node

        The thing whose classes are to be found

      Returns { [uri: string]: boolean }

      a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

    • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal)

      Parameters

      • subject: any

        The thing whose classes are to be found

      Returns { [uri: string]: boolean }

      a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

    • Get all the Classes of which we can RDFS-infer the subject is a member todo: This will loop is there is a class subclass loop (Sublass loops are not illegal) Returns a hash table where key is NT of type and value is statement why we think so. Does NOT return terms, returns URI strings. We use NT representations in this version because they handle blank nodes.

      Parameters

      • subject: Quad_Subject

        A subject node

      Returns UriMap

    • Creates a new empty indexed formula Only applicable for IndexedFormula, but TypeScript won't allow a subclass to override a property

      Parameters

      • features: FeaturesType

        The list of features

      Returns Store

    • Transforms an NTriples string format into a Node. The blank node bit should not be used on program-external values; designed for internal work such as storing a blank node id in an HTML attribute. This will only parse the strings generated by the various toNT() methods.

      Parameters

      • str: any

      Returns any

    • Creates a hash for this node

      Returns string

      use {rdfFactory.id} instead if possible

    • Returns true if this formula holds the specified statement(s)

      Parameters

      • s: any
      • Optionalp: any
      • Optionalo: any
      • Optionalg: any

      Returns boolean

    • Returns true if this formula holds the specified {statement}

      Parameters

      • statement: any

      Returns boolean

    • Returns a unique index-safe identifier for the given term.

      Falls back to the rdflib hashString implementation if the given factory doesn't support id.

      Parameters

      • term: TFIDFactoryTypes

      Returns Indexable

    • Parameters

      • features: FeaturesType

      Returns void

    • Used by the n3parser to generate list elements

      Parameters

      • values: any

        The values of the collection

      • context: any

        The store

      Returns any

      • The term for the statement
    • Returns any quads matching the given arguments. Standard RDFJS spec method for Source objects, implemented as an alias to statementsMatching()

      Parameters

      • Optionalsubject: null | Quad_Subject

        The subject

      • Optionalpredicate: null | Quad_Predicate

        The predicate

      • Optionalobject: null | Quad_Object

        The object

      • Optionalgraph: null | Quad_Graph

        The graph that contains the statement

      Returns Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

    • Find out whether a given URI is used as symbol in the formula

      Parameters

      • uri: string

        The URI to look for

      Returns boolean

    • Existentials are BNodes - something exists without naming

      Parameters

      • uri: string

        An URI

      Returns Term

    • Adds a new property action

      Parameters

      • pred: Quad_Predicate

        the predicate that the function should be triggered on

      • action: (
            store: Store,
            subject: Quad_Subject,
            predicate: Quad_Predicate,
            object: Quad_Object,
        ) => boolean

        the function that should trigger

      Returns boolean

    • Creates a new universal node Universals are Variables

      Parameters

      • uri: string

        An URI

      Returns NamedNode

    • Find an unused id for a file being edited: return a symbol (Note: Slow iff a lot of them -- could be O(log(k)) )

      Parameters

      • doc: NamedNode

        A document named node

      Returns NamedNode

    • Transform a collection of NTriple URIs into their URI strings

      Parameters

      • t: any

        Some iterable collection of NTriple URI strings

      Returns {}

      A collection of the URIs as strings todo: explain why it is important to go through NT

    • Query this store asynchronously, return bindings in callback

      Parameters

      • myQuery: Query

        The query to be run

      • callback: (bindings: Bindings) => void

        Function to call when bindings

      • Optionalfetcher: null | Fetcher
      • OptionalonDone: () => void

        OBSOLETE - do not use this // @@ Why not ?? Called when query complete

      Returns void

    • Query this store synchronously and return bindings

      Parameters

      • myQuery: Query

        The query to be run

      Returns any[]

    • Removes one or multiple statement(s) from this formula

      Parameters

      • st:
            | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>
            | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

        A Statement or array of Statements to remove

      Returns Store

    • Removes all statements in a doc, along with the related metadata including request/response/status

      Parameters

      • doc: Quad_Graph

        The document / graph

      Returns Store

    • Remove all statements matching args (within limit) *

      Parameters

      • Optionalsubj: null | Quad_Subject

        The subject

      • Optionalpred: null | Quad_Predicate

        The predicate

      • Optionalobj: null | Quad_Object

        The object

      • Optionalwhy: null | Quad_Graph

        The graph that contains the statement

      • Optionallimit: number

        The number of statements to remove

      Returns void

    • Remove all matching statements

      Parameters

      • Optionalsubject: null | Quad_Subject

        The subject

      • Optionalpredicate: null | Quad_Predicate

        The predicate

      • Optionalobject: null | Quad_Object

        The object

      • Optionalgraph: null | Quad_Graph

        The graph that contains the statement

      Returns Store

    • Parameters

      • doc: Quad_Graph

      Returns Store

    • Remove a particular statement object from the store

      Parameters

      • st: Quad

        a statement which is already in the store and indexed. Make sure you only use this for these. Otherwise, you should use remove() above.

      Returns Store

    • Removes statements

      Parameters

      • sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]

        The statements to remove

      Returns Store

    • Replace big with small, obsoleted with obsoleting.

      Parameters

      • big: Quad_Subject
      • small: Quad_Subject

      Returns boolean

    • Compares whether this node is the same as the other one

      Parameters

      • other: Node

        Another node

      Returns boolean

    • Compare by canonical URI as smushed

      Parameters

      Returns boolean

    • Serializes this formula

      Parameters

      • base: any

        The base string

      • contentType: any

        The content type of the syntax to use

      • provenance: any

        The provenance URI

      • Optionaloptions: any

        options to pass to the serializer, as defined in serialize method

      Returns undefined | string

    • Parameters

      • prefix: string
      • nsuri: string

      Returns void

    • Search the Store

      ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!

      Parameters

      • Optionalsubj: null | Quad_Subject

        A node to search for as subject, or if null, a wildcard

      • Optionalpred: null | Quad_Predicate

        A node to search for as predicate, or if null, a wildcard

      • Optionalobj: null | Quad_Object

        A node to search for as object, or if null, a wildcard

      • Optionalwhy: null | Quad_Graph

        A node to search for as graph, or if null, a wildcard

      • OptionaljustOne: boolean

        flag - stop when found one rather than get all of them?

      Returns Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

      An array of nodes which match the wildcard position

    • Gets this graph with the bindings substituted

      Type Parameters

      Parameters

      • bindings: Bindings

        The bindings

      Returns T

    • Parameters

      • uri: string
      • Optionalname: any

      Returns NamedNode

    • Gets the node matching the specified pattern. Throws when no match could be made.

      Parameters

      • Optionals: null | Quad_Subject

        The subject

      • Optionalp: null | Quad_Predicate

        The predicate

      • Optionalo: null | Quad_Object

        The object

      • Optionalg: null | Quad_Graph

        The graph that contains the statement

      Returns undefined | null | Node

    • Creates a canonical string representation of this node

      Returns string

    • Creates a n-quads string representation of this node

      Returns string

    • Creates a n-triples string representation of this node

      Returns string

    • Finds the types in the list which have no stored supertypes We exclude the universal class, owl:Things and rdf:Resource, as it is information-free.

      Parameters

      • types: { [id: string]: string | NamedNode }

        The types

      Returns { [id: string]: string | NamedNode }

    • Serializes this formula to a string

      Returns string

    • RDFS Inference These are hand-written implementations of a backward-chaining reasoner over the RDFS axioms.

      Parameters

      • seeds: BooleanMap

        A hash of NTs of classes to start with

      • predicate: Quad_Predicate

        The property to trace though

      • Optionalinverse: boolean

        Trace inverse direction

      Returns { [uri: string]: boolean }

    • A list of all the URIs by which this thing is known

      Parameters

      • term: Quad_Subject

      Returns string[]

    • Gets a new variable

      Parameters

      • name: string

        The variable's name

      Returns Variable

    • Gets the number of statements in this formula that matches the specified pattern

      Parameters

      • Optionals: null | Quad_Subject

        The subject

      • Optionalp: null | Quad_Predicate

        The predicate

      • Optionalo: null | Quad_Object

        The object

      • Optionalg: null | Quad_Graph

        The graph that contains the statement

      Returns number