Interface Subject

A subject is roughly the same thing as a "resource" in RDF, except the term resource is no longer appropriate given the ontological bent that RDF has taken.

This is the basic user-facing type.

All the named entities returned by methods in this type are fully resolved.

All the named entities passed as arguments to methods in this type can be shortened and are resolved against ... TODO how is the resolution service set

Hierarchy

Properties

The identifier of the subject - the IRI/URI. Not sure if we need a separate abstraction for that or a string will suffice. We have to have a string version of it either way.

ready: boolean

Whether this dataspec is ready to use

Methods

  • Add a callback to be called when the subject changes

    Parameters

    • callback: ((key: string) => void)
        • (key: string): void
        • Parameters

          • key: string

          Returns void

    Returns any

  • Add a callback which will be called when the referents pointing to this subject change

    Parameters

    • callback: ((referent: Subject, key: string) => void)
        • (referent: Subject, key: string): void
        • Parameters

          Returns void

    Returns any

  • Commit changes performed to this DataSpec object to its source of truth

    Returns Promise<void>

  • Return a Subject instance which represents a particular property value set on this subject. This allows the manipulation of meta data on specific property statements (or triples) at any (meta) level.

    Parameters

    • propertyName: string

      The property name.

    • value: Subject | LiteralValue

      The property value - a literal or another subject.

    • Optional lang: string

      The language of the value to identify. If not specified, the environment's default language will be used. If set, the language is non optional regardless of wheather it is set as optional. I.e. this method will always return a subject which represents the

    Returns Subject

  • The names of all set properties in this subject

    Returns string[]

  • Remove a PropertyChangedCallback

    Parameters

    • callback: ((key: string) => void)
        • (key: string): void
        • Parameters

          • key: string

          Returns void

    Returns any

  • Remove a ReferentsChangedCallback

    Parameters

    • callback: ((referent: Subject, key: string) => void)

      the callback to remove

        • (referent: Subject, key: string): void
        • Parameters

          Returns void

    Returns any

  • Set the value of a property; If the previous value of the property was annotated, this will remove the annotation

    Parameters

    • prop: string
    • Optional lang: string
    • Rest ...object: Subject[] | LiteralValue[]

      the new property value TODO the object could be actually be a working copy of a subject; is this a valid operation?

    Returns Subject

  • Add more values of a property; The annotations of the old values are preserved

    Parameters

    • prop: string
    • Optional lang: string
    • Rest ...object: Subject[] | LiteralValue[]

      the new property value TODO the object could be actually be a working copy of a subject; is this a valid operation?

    Returns Subject

  • Construct a working copy of this dataspec.

    Changes to a working copy will not be automatically applied to its backing object. In order to propagate the changes, the user needs to explicitly call WorkingCopy.commit()

    When changes are applied to this object, they are automatically propagated to its working copies

    Parameters

    • Optional reactivityDecoratorFunction: (<T>(T: any) => T)

      optional function which will apply reactivity to the working copy. The function is expected to take the working copy, wrap it in a reactive proxy and return the wrapper. If specified, it will be invoked with the created working copy and the resulting object will be stored as a working copy. Alternatively the graph itself could allow for setting of a reactivity decorator with the same function

        • <T>(T: any): T
        • Type Parameters

          Parameters

          • T: any

          Returns T

    Returns Subject

Generated using TypeDoc