Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Store

Indexed Formula aka Store

Hierarchy

Index

Constructors

constructor

  • new Store(features?: FeaturesType, opts?: FormulaOpts): Store
  • Creates a new formula

    Parameters

    • Optional features: FeaturesType

      What sort of automatic processing to do? Array of string

    • opts: FormulaOpts = {}

    Returns Store

Properties

HTTPRedirects

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

Redirections we got from HTTP

Optional _existentialVariables

_existentialVariables?: BlankNode[]

Optional _universalVariables

_universalVariables?: NamedNode[]

aliases

aliases: any[]

Reverse mapping to redirection: aliases for this

classActions

classActions: {}

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

Type declaration

  • [k: string]: Function[]

classOrder

classOrder: number = ClassOrder.Graph

The class order for this node

constraints

constraints: readonly any[] = []

features

features: FeaturesType

Optional fetcher

fetcher?: Fetcher

The accompanying fetcher instance.

Is set by the fetcher when initialized.

index

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

initBindings

initBindings: readonly any[] = []

isVar

isVar: number = 0

namespaces

namespaces: {}

Dictionary of namespace prefixes

Type declaration

  • [key: string]: string

ns

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

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

      • Optional factory: RdfJsDataFactory

      Returns (ln: string) => NamedNode

        • (ln: string): NamedNode
        • Gets a namespace for the specified namespace's URI

          Parameters

          • ln: string

          Returns NamedNode

objectIndex

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

Array of statements with this X as object

optional

optional: readonly any[] = []

predicateIndex

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

Array of statements with this X as predicate

propertyActions

propertyActions: {}

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

Type declaration

  • [k: string]: Function[]

rdfFactory

rdfFactory: any

The factory used to generate statements and terms

redirections

redirections: any[]

Redirect to lexically smaller equivalent symbol

statements

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

subjectIndex

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

Array of statements with this X as subject

termType

termType: "Graph" = GraphTermType

The type of node

Optional updater

updater?: UpdateManager

An UpdateManager initialised to this store

value

value: string

The node's value

whyIndex

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

Array of statements with X as provenance

Static fromValue

fromValue: <T>(value: ValueType) => T

Type declaration

    • <T>(value: ValueType): T
    • Type parameters

      • T: FromValueReturns<any>

      Parameters

      • value: ValueType

      Returns T

Static handleRDFType

handleRDFType: Function

Static toJS

toJS: (term: any) => string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Type declaration

    • (term: any): string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]
    • Parameters

      • term: any

      Returns string | boolean | object | Number | Date | (string | boolean | object | Number | Date)[]

Accessors

length

  • 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

Static defaultGraphURI

  • get defaultGraphURI(): string

Methods

NTtoURI

  • NTtoURI(t: any): {}
  • 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

    add

    • add(subj: Statement<SubjectType, PredicateType, ObjectType, GraphType> | Quad_Subject | Statement<SubjectType, PredicateType, ObjectType, GraphType>[] | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[], pred?: Quad_Predicate, obj?: string | Term, why?: Quad_Graph): null | number | Statement<SubjectType, PredicateType, ObjectType, GraphType> | Store
    • Adds a triple (quad) to the store.

      Parameters

      • subj: Statement<SubjectType, PredicateType, ObjectType, GraphType> | Quad_Subject | 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.

      • Optional pred: Quad_Predicate

        The relationship which is asserted

      • Optional obj: string | Term

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

      • Optional why: Quad_Graph

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

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

      The statement added to the store, or the store

    addAll

    • addAll(statements: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]): void
    • Adds all the statements to this formula

      Parameters

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

        A collection of statements

      Returns void

    addDataCallback

    • addDataCallback(cb: (q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>) => void): void
    • Add a callback which will be triggered after a statement has been added to the store.

      Parameters

      • cb: (q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>) => void
          • (q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>): void
          • Parameters

            • q: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

            Returns void

      Returns void

    addStatement

    • addStatement(st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>): number

    allAliases

    any

    • any(s?: null | Quad_Subject, p?: null | Quad_Predicate, o?: null | Quad_Object, g?: null | Quad_Graph): null | Node
    • 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

      • Optional s: null | Quad_Subject

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

      • Optional p: null | Quad_Predicate

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

      • Optional o: null | Quad_Object

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

      • Optional g: 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

    anyJS

    • anyJS(s?: null | Quad_Subject, p?: null | Quad_Predicate, o?: null | Quad_Object, g?: null | Quad_Graph): any
    • Gets the first JavaScript object equivalent to a node based on the specified pattern

      Parameters

      • Optional s: null | Quad_Subject

        The subject

      • Optional p: null | Quad_Predicate

        The predicate

      • Optional o: null | Quad_Object

        The object

      • Optional g: null | Quad_Graph

        The graph that contains the statement

      Returns any

    anyStatementMatching

    • anyStatementMatching(s?: null | Quad_Subject, p?: null | Quad_Predicate, o?: null | Quad_Object, g?: null | Quad_Graph): undefined | Statement<SubjectType, PredicateType, ObjectType, GraphType>
    • Gets the first statement that matches the specified pattern

      Parameters

      • Optional s: null | Quad_Subject
      • Optional p: null | Quad_Predicate
      • Optional o: null | Quad_Object
      • Optional g: null | Quad_Graph

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

    anyValue

    • anyValue(s?: null | Quad_Subject, p?: null | Quad_Predicate, o?: null | Quad_Object, g?: null | Quad_Graph): string | void
    • Gets the value of a node that matches the specified pattern

      Parameters

      • Optional s: null | Quad_Subject

        The subject

      • Optional p: null | Quad_Predicate

        The predicate

      • Optional o: null | Quad_Object

        The object

      • Optional g: null | Quad_Graph

        The graph that contains the statement

      Returns string | void

    applyPatch

    • applyPatch(patch: { delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]; patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]; where?: any }, target: NamedNode, patchCallback: (errorString?: string) => void): 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

        • Optional delete?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
        • Optional patch?: readonly Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
        • Optional where?: any
      • target: NamedNode

        The name of the document to patch

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

        Callback to be called when patching is complete

          • (errorString?: string): void
          • Parameters

            • Optional errorString: string

            Returns void

      Returns void

    bnode

    bottomTypeURIs

    • bottomTypeURIs(types: any): any
    • 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

    canon

    • canon(term?: Term): Node
    • Returns the symbol with canonical URI as smushed

      Parameters

      • Optional term: Term

        An RDF node

      Returns Node

    check

    • check(): void

    checkStatementList

    • checkStatementList(sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[], from?: number): boolean | 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

      • Optional from: number

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

      Returns boolean | void

    close

    collection

    compareTerm

    • compareTerm(other: Node): number

    compareTerms

    • compareTerms(u1: Term, u2: Term): number

    connectedStatements

    • connectedStatements(subject: Quad_Subject, doc: Quad_Graph, excludePredicateURIs?: readonly string[]): Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
    • 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

      • Optional excludePredicateURIs: readonly string[]

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

      an array of statements, duplicate statements are suppresssed.

    copyTo

    • copyTo(template: Quad_Subject, target: Quad_Subject, flags?: ("two-direction" | "delete")[]): void
    • replaces @template with @target and add appropriate triples removes no triples by default and is a one-direction replication

      Parameters

      • template: Quad_Subject

        node to copy

      • target: Quad_Subject

        node to copy to

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

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

      Returns void

    declareExistential

    • 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

    each

    • each(s?: null | Quad_Subject, p?: null | Quad_Predicate, o?: null | Quad_Object, g?: null | Quad_Graph): Node[]
    • 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

      • Optional s: null | Quad_Subject

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

      • Optional p: null | Quad_Predicate

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

      • Optional o: null | Quad_Object

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

      • Optional g: 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

    equals

    equate

    • equate(u1in: Term, u2in: Term): 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

    findMemberURIs

    • findMemberURIs(subject: Node): UriMap
    • 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

    findMembersNT

    • findMembersNT(thisClass: any): MembersMap
    • 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

    findSubClassesNT

    • findSubClassesNT(subject: Node): {}
    • 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

    findSuperClassesNT

    • findSuperClassesNT(subject: Node): {}
    • 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 {}

      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.

      • [uri: string]: boolean

    findTypeURIs

    • findTypeURIs(subject: Quad_Subject): UriMap
    • 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

    findTypesNT

    • findTypesNT(subject: any): {}
    • 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 {}

      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.

      • [uri: string]: boolean

    formula

    • formula(features: FeaturesType): Store
    • 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

    fromNT

    • fromNT(str: any): any
    • 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

    hashString

    • hashString(): string

    holds

    • holds(s: any, p?: any, o?: any, g?: any): boolean
    • Returns true if this formula holds the specified statement(s)

      Parameters

      • s: any
      • Optional p: any
      • Optional o: any
      • Optional g: any

      Returns boolean

    holdsStatement

    • holdsStatement(statement: any): boolean

    id

    • id(term: TFIDFactoryTypes): Indexable
    • 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

    initPropertyActions

    • initPropertyActions(features: FeaturesType): void

    list

    • list(values: any, context: any): any
    • 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

    match

    • match(subject?: null | Quad_Subject, predicate?: null | Quad_Predicate, object?: null | Quad_Object, graph?: null | Quad_Graph): Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]
    • Returns any quads matching the given arguments. Standard RDFJS spec method for Source objects, implemented as an alias to statementsMatching()

      Parameters

      • Optional subject: null | Quad_Subject

        The subject

      • Optional predicate: null | Quad_Predicate

        The predicate

      • Optional object: null | Quad_Object

        The object

      • Optional graph: null | Quad_Graph

        The graph that contains the statement

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

    mentionsURI

    • mentionsURI(uri: string): boolean
    • Find out whether a given URI is used as symbol in the formula

      Parameters

      • uri: string

        The URI to look for

      Returns boolean

    newExistential

    • newExistential(uri: string): Term
    • Existentials are BNodes - something exists without naming

      Parameters

      • uri: string

        An URI

      Returns Term

    newPropertyAction

    • newPropertyAction(pred: Quad_Predicate, action: (store: Store, subject: Quad_Subject, predicate: Quad_Predicate, object: Quad_Object) => boolean): boolean
    • 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

          • (store: Store, subject: Quad_Subject, predicate: Quad_Predicate, object: Quad_Object): boolean
          • Parameters

            • store: Store
            • subject: Quad_Subject
            • predicate: Quad_Predicate
            • object: Quad_Object

            Returns boolean

      Returns boolean

    newUniversal

    • newUniversal(uri: string): NamedNode
    • Creates a new universal node Universals are Variables

      Parameters

      • uri: string

        An URI

      Returns NamedNode

    nextSymbol

    • nextSymbol(doc: NamedNode): 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

    query

    • query(myQuery: Query, callback: (bindings: Bindings) => void, fetcher?: null | Fetcher, onDone?: () => void): void
    • 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

          • (bindings: Bindings): void
          • Parameters

            • bindings: Bindings

            Returns void

      • Optional fetcher: null | Fetcher
      • Optional onDone: () => void

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

          • (): void
          • Returns void

      Returns void

    querySync

    • querySync(myQuery: Query): any[]
    • Query this store synchronously and return bindings

      Parameters

      • myQuery: Query

        The query to be run

      Returns any[]

    remove

    • remove(st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph> | Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]): Store
    • 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

    removeDocument

    • removeDocument(doc: Quad_Graph): Store
    • Removes all statements in a doc

      Parameters

      • doc: Quad_Graph

        The document / graph

      Returns Store

    removeMany

    • removeMany(subj?: null | Quad_Subject, pred?: null | Quad_Predicate, obj?: null | Quad_Object, why?: null | Quad_Graph, limit?: number): void
    • Remove all statements matching args (within limit) *

      Parameters

      • Optional subj: null | Quad_Subject

        The subject

      • Optional pred: null | Quad_Predicate

        The predicate

      • Optional obj: null | Quad_Object

        The object

      • Optional why: null | Quad_Graph

        The graph that contains the statement

      • Optional limit: number

        The number of statements to remove

      Returns void

    removeMatches

    • removeMatches(subject?: null | Quad_Subject, predicate?: null | Quad_Predicate, object?: null | Quad_Object, graph?: null | Quad_Graph): Store
    • Remove all matching statements

      Parameters

      • Optional subject: null | Quad_Subject

        The subject

      • Optional predicate: null | Quad_Predicate

        The predicate

      • Optional object: null | Quad_Object

        The object

      • Optional graph: null | Quad_Graph

        The graph that contains the statement

      Returns Store

    removeStatement

    • removeStatement(st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>): Store
    • Remove a particular statement object from the store

      Parameters

      • st: Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>

        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

    removeStatements

    • removeStatements(sts: readonly Quad<Quad_Subject, Quad_Predicate, Quad_Object, Quad_Graph>[]): Store
    • Removes statements

      Parameters

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

        The statements to remove

      Returns Store

    replaceWith

    • replaceWith(big: Quad_Subject, small: Quad_Subject): boolean
    • Replace big with small, obsoleted with obsoleting.

      Parameters

      • big: Quad_Subject
      • small: Quad_Subject

      Returns boolean

    sameTerm

    • sameTerm(other: Node): boolean

    sameThings

    serialize

    • serialize(base: any, contentType: any, provenance: any): any
    • Serializes this formula

      Parameters

      • base: any

        The base string

      • contentType: any

        The content type of the syntax to use

      • provenance: any

        The provenance URI

      Returns any

    setPrefixForURI

    • setPrefixForURI(prefix: string, nsuri: string): void

    statementsMatching

    • statementsMatching(subj?: null | Quad_Subject, pred?: null | Quad_Predicate, obj?: null | Quad_Object, why?: null | Quad_Graph, justOne?: boolean): Statement<SubjectType, PredicateType, ObjectType, GraphType>[]
    • Search the Store

      ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!

      Parameters

      • Optional subj: null | Quad_Subject

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

      • Optional pred: null | Quad_Predicate

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

      • Optional obj: null | Quad_Object

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

      • Optional why: null | Quad_Graph

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

      • Optional justOne: 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

    substitute

    • substitute<T>(bindings: Bindings): T

    sym

    the

    • the(s?: null | Quad_Subject, p?: null | Quad_Predicate, o?: null | Quad_Object, g?: null | Quad_Graph): undefined | null | Node
    • Gets the node matching the specified pattern. Throws when no match could be made.

      Parameters

      • Optional s: null | Quad_Subject

        The subject

      • Optional p: null | Quad_Predicate

        The predicate

      • Optional o: null | Quad_Object

        The object

      • Optional g: null | Quad_Graph

        The graph that contains the statement

      Returns undefined | null | Node

    toCanonical

    • toCanonical(): string

    toNQ

    • toNQ(): string

    toNT

    • toNT(): string

    toString

    • toString(): string

    topTypeURIs

    • topTypeURIs(types: {}): {}
    • 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: {}

        The types

      Returns {}

    transitiveClosure

    • transitiveClosure(seeds: BooleanMap, predicate: Quad_Predicate, inverse?: boolean): {}
    • 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

      • Optional inverse: boolean

        Trace inverse direction

      Returns {}

      • [uri: string]: boolean

    uris

    • uris(term: Quad_Subject): string[]
    • A list of all the URIs by which this thing is known

      Parameters

      • term: Quad_Subject

      Returns string[]

    variable

    whether

    • whether(s?: null | Quad_Subject, p?: null | Quad_Predicate, o?: null | Quad_Object, g?: null | Quad_Graph): number
    • Gets the number of statements in this formula that matches the specified pattern

      Parameters

      • Optional s: null | Quad_Subject

        The subject

      • Optional p: null | Quad_Predicate

        The predicate

      • Optional o: null | Quad_Object

        The object

      • Optional g: null | Quad_Graph

        The graph that contains the statement

      Returns number

    Generated using TypeDoc