Class SubjectImpl

The main subject implementation of the Subject interface which works with the LocalGraph

This class is only exported so that it's accessible to the graph.ts module.

Hierarchy

  • SubjectBase
    • SubjectImpl

Implements

Constructors

Properties

changes: PropertyChange[] = []
graph: LocalGraph
onPropertyChanged: Subscription = ...
onReferentsChanged: Subscription = ...
properties: null | object = null
workingCopies: SubjectLightCopy[] = []

Accessors

  • get query(): {
        id: undefined;
        propertyValueIdentifier: {
            object: Literal | Subject | {
                id: SubjectId;
            };
            ontologyId: string;
            predicate: string;
            subject: {
                id: SubjectId;
            };
        };
        type: string;
    } | {
        id: string;
        propertyValueIdentifier: undefined;
        type: string;
    }
  • Returns {
        id: undefined;
        propertyValueIdentifier: {
            object: Literal | Subject | {
                id: SubjectId;
            };
            ontologyId: string;
            predicate: string;
            subject: {
                id: SubjectId;
            };
        };
        type: string;
    } | {
        id: string;
        propertyValueIdentifier: undefined;
        type: string;
    }

Methods

  • Parameters

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

          • key: string

          Returns void

    Returns void

  • Parameters

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

          Returns void

    Returns void

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

    Returns Promise<void>

  • Enqueue a change to the buffer which will be sent to upstream sources of truth for synchronization

    Parameters

    Returns void

  • Returns

    the (first) value of the given property with the given language (if set) or if no language is set or the language is optional and no values with the given language are present, the first value present

    Parameters

    • prop: string
    • Optional lang: string

      the language of the requested values. If set, only values with the given language will be returned. If no values of the given language are present and the language is optional (lang ends with '?'), all the values will be returned. If not set, all the values will be returned

    Returns null | Subject | LiteralValue

  • Returns

    an array consisting of all the values of the given property. If the values are string literals only values with the specified language are returned. Non string literals are transformed into js objects according to their set datatype. If threre are no values with the given language and teh

    Parameters

    • prop: string
    • Optional lang: string

      the language of the requested values. If set, only values with the given language will be returned. If no values of the given language are present and the language is optional (lang ends with '?'), all the values will be returned. If not set, all the values will be returned

    Returns Subject[] | LiteralValue[]

  • Ingest the quads from a dataset which are relevant to this Subject into this Subject's properties

    Parameters

    • dataset: Dataset<Quad, Quad>

    Returns void

  • Notify the graph that some properties have changed

    Parameters

    • changedProperties: string[]

      the changed properties

    Returns void

  • Parameters

    • referent: any
    • key: any

    Returns void

  • Parameters

    • values: Literal[]
    • lang: string

    Returns Literal[]

  • Parse the language string or if not set, parse the environment's default language setting

    Returns

    Parameters

    • Optional lang: string

    Returns {
        language?: string;
        languageIsOptional: boolean;
    }

    • Optional language?: string
    • languageIsOptional: boolean
  • Returns string[]

  • Parameters

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

          • key: string

          Returns void

    Returns void

  • Parameters

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

          Returns void

    Returns void

  • Parameters

    • name: string

    Returns string

  • 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 reactivityDecorator: (<T>(original: T) => 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>(original: T): T
        • Type Parameters

          Parameters

          • original: T

          Returns T

    Returns Subject

Generated using TypeDoc