solid-ui
    Preparing search index...

    Class Formula

    A formula, or store of RDF statements

    Hierarchy (View Summary)

    Index

    Constructors

    • Initializes this formula

      Parameters

      • Optionalstatements: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]

        Initial array of statements

      • Optionalconstraints: readonly any[]

        initial array of constraints

      • OptionalinitBindings: readonly any[]

        initial bindings used in Query

      • Optionaloptional: readonly any[]

        optional

      • Optionalopts: FormulaOpts
        • rdfFactory

          The rdf factory that should be used by the store

      Returns Formula

    Properties

    classOrder: number

    The class order for this node

    constraints: readonly any[]
    fetcher?: Fetcher

    The accompanying fetcher instance.

    Is set by the fetcher when initialized.

    initBindings: readonly any[]
    isVar: number
    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

    optional: readonly any[]
    rdfFactory: any

    The factory used to generate statements and terms

    statements: Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
    termType: "Graph"

    The type of node

    value: string

    The node's value

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

    Methods

    • Add a statement from its parts

      Parameters

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

        the first part of the statement

      • Optionalpredicate: Quad_Predicate

        the second part of the statement

      • Optionalobject: string | Term

        the third part of the statement

      • Optionalgraph: Quad_Graph

        the last part of the statement

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

    • 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 statment object

      Parameters

      • statement: Quad

        An existing constructed statement to add

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

    • 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

    • 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

    • Creates a new collection

      Returns Collection

    • Compares this node with another

      Parameters

      • other: Node

        The other node

      Returns number

      to check if two nodes are equal

    • 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.

    • 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

    • 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 formula

      Parameters

      • Optional_features: readonly string[]

        Not applicable, but necessary for typing to pass

      Returns Formula

    • 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

    • 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
    • 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

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

      Parameters

      • other: Node

        Another node

      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

    • Search the Store This is really a teaching method as to do this properly you would use IndexedFormula

      Type Parameters

      • JustOne extends boolean = false

      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

      • 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
    • Creates a new formula with the substituting bindings applied

      Type Parameters

      Parameters

      • bindings: Bindings

        The bindings to substitute

      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 }

    • 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