Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface UpdateManagerFormula

Hierarchy

Index

Constructors

constructor

Properties

HTTPRedirects

HTTPRedirects: Statement[]

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

constraints

constraints: ReadonlyArray<any>

initial array of constraints

features

features: FeaturesType

fetcher

fetcher: Fetcher

index

initBindings

initBindings: ReadonlyArray<any>

initial bindings used in Query

isVar

isVar: number = 0

namespaces

namespaces: {}

Dictionary of namespace prefixes

Type declaration

  • [key: string]: string

ns

ns: Namespace = Namespace

A namespace for the specified namespace's URI

param

The URI for the namespace

objectIndex

objectIndex: Statement[]

Array of statements with this X as object

optional

optional: ReadonlyArray<any>

optional

predicateIndex

predicateIndex: Statement[]

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: Array<Statement>

Initial array of statements

subjectIndex

subjectIndex: Statement[]

Array of statements with this X as subject

termType

termType: typeof GraphTermType = GraphTermType

Optional updater

updater: UpdateManager

An UpdateManager initialised to this store

value

value: string

The node's value

whyIndex

whyIndex: Statement[]

Array of statements with X as provenance

Static fromValue

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

Type declaration

Static handleRDFType

handleRDFType: Function

Static toJS

toJS: (term: any) => Date | Number | string | boolean | object | Array<Date | Number | string | boolean | object>

Type declaration

    • (term: any): Date | Number | string | boolean | object | Array<Date | Number | string | boolean | object>
    • Parameters

      • term: any

      Returns Date | Number | string | boolean | object | Array<Date | Number | string | boolean | object>

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

  • Adds a triple (quad) to the store.

    Parameters

    • subj: Quad_Subject | Quad | Quad[] | Statement | Statement[]

      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: Term | string

      The object of the relationship, e.g. another thing or avalue. 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 Statement | null | this | number

    The statement added to the store, or the store

addAll

  • addAll(statements: Quad[]): void

addDataCallback

  • addDataCallback(cb: (q: Quad) => void): void

addStatement

  • addStatement(st: Quad): number

allAliases

  • allAliases(x: NamedNode): NamedNode[]

any

  • 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: Quad_Subject | null

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

    • Optional p: Quad_Predicate | null

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

    • Optional o: Quad_Object | null

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

    • Optional g: Quad_Graph | null

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

    Returns Node | null

    A node which match the wildcard position, or null

anyJS

anyStatementMatching

anyValue

applyPatch

  • applyPatch(patch: { delete?: ReadonlyArray<Statement>; patch?: ReadonlyArray<Statement>; where?: any }, target: TFNamedNode, patchCallback: (errorString?: undefined | string) => void): void
  • Apply a set of statements to be deleted and to be inserted

    Parameters

    • patch: { delete?: ReadonlyArray<Statement>; patch?: ReadonlyArray<Statement>; where?: any }

      The set of statements to be deleted and to be inserted

      • Optional delete?: ReadonlyArray<Statement>
      • Optional patch?: ReadonlyArray<Statement>
      • Optional where?: any
    • target: TFNamedNode

      The name of the document to patch

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

      Callback to be called when patching is complete

        • (errorString?: undefined | string): void
        • Parameters

          • Optional errorString: undefined | string

          Returns void

    Returns void

bnode

  • bnode(id?: undefined | string): BlankNode
  • Shortcut for adding blankNodes

    Parameters

    • Optional id: undefined | string

    Returns BlankNode

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

check

  • check(): void

checkStatementList

  • checkStatementList(sts: ReadonlyArray<Quad>, from?: undefined | number): boolean | void
  • Checks a list of statements for consistency

    Parameters

    • sts: ReadonlyArray<Quad>

      The list of statements to check

    • Optional from: undefined | 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

  • 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: ReadonlyArray<string>

    Returns Statement[]

    an array of statements, duplicate statements are suppresssed.

copyTo

  • 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: Array<"two-direction" | "delete">

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

    Returns void

declareExistential

  • declareExistential(x: BlankNode): BlankNode

each

  • 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: Quad_Subject | null

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

    • Optional p: Quad_Predicate | null

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

    • Optional o: Quad_Object | null

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

    • Optional g: Quad_Graph | null

      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

  • 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

  • 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

  • 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

    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

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 | any[], p?: any, o?: any, g?: any): boolean
  • Returns true if this formula holds the specified statement(s)

    Parameters

    • s: any | any[]
    • Optional p: any
    • Optional o: any
    • Optional g: any

    Returns boolean

holdsStatement

  • holdsStatement(statement: any): boolean

id

  • 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

    Returns Indexable

initPropertyActions

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

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

    Parameters

    Returns Quad[]

mentionsURI

  • mentionsURI(uri: string): boolean

newExistential

  • newExistential(uri: string): Term

newPropertyAction

newUniversal

  • newUniversal(uri: string): TFNamedNode

nextSymbol

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

      A document named node

    Returns TFNamedNode

query

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

    • Optional dummy: Fetcher | null

      OBSOLETE - do not use this

    • Optional onDone: undefined | (() => void)

      OBSOLETE - do not use this

    Returns void

querySync

  • querySync(myQuery: Query): any[]

remove

removeDocument

removeMany

removeMatches

removeStatement

removeStatements

replaceWith

sameTerm

  • sameTerm(other: Node): boolean

sameThings

  • sameThings(x: NamedNode, y: NamedNode): boolean

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

  • Search the Store

    ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!

    Parameters

    • Optional subj: Quad_Subject | null

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

    • Optional pred: Quad_Predicate | null

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

    • Optional obj: Quad_Object | null

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

    • Optional why: Quad_Graph | null

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

    • Optional justOne: undefined | false | true

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

    Returns Statement[]

    An array of nodes which match the wildcard position

substitute

sym

  • sym(uri: string, name?: any): NamedNode

the

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

      • [id: string]: string | RDFlibNamedNode

    Returns {}

    • [id: string]: string | RDFlibNamedNode

transitiveClosure

  • 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: undefined | false | true

      Trace inverse direction

    Returns {}

    • [uri: string]: boolean

uris

variable

  • variable(name: string): Variable

whether