FDO SDK API Reference
    Preparing search index...

    Interface LocalFDORecord

    Represents a single FDO record that has a LocalID and is optionally associated with a registered PID. Useful for creating mappings from data to metadata where records can be associated consistently through their LocalID.

    A record consists of attributes, each with one or more values. Each attribute is uniquely identified by its PID.

    interface LocalFDORecord {
        localID: `LOCAL/${string}`;
        PID: string | undefined;
        addAttribute(attribute: string, value: AttributeAnyType): void;
        addAttribute<Attr extends DefaultAttributeDef>(
            attribute: Attr,
            value: AttrTypeWithCardinality<Attr>,
        ): void;
        addData<Attr extends DefaultAttributeDef>(
            attribute: string | Attr,
            value?: Attr extends DefaultAttributeDef
                ? AttrTypeWithCardinality<Attr>
                : AttributeAnyType | AttributeAnyType[],
        ): void;
        addProfile<UsedProfile extends ProfileDef<readonly DefaultAttributeDef[]>>(
            profile: UsedProfile,
            attributes: UsedProfile extends ProfileDef<Attrs>
                ? { [K in string]: WithMarkers<AttrsToObj<Attrs>>[K] }
                : never,
        ): void;
        addRecord(record: FDORecord): void;
        addReference(
            fromAttribute:
                | string
                | AttributeDef<
                    string,
                    string
                    | ReferenceMarker,
                    `${number}..${number}` | `${number}..*`,
                >,
            toRecord: string | IdentifiableFDORecord,
        ): void;
        addReferenceBidi(
            fromAttribute:
                | string
                | AttributeDef<
                    string,
                    string
                    | ReferenceMarker,
                    `${number}..${number}` | `${number}..*`,
                >,
            inverseAttribute:
                | string
                | AttributeDef<
                    string,
                    string
                    | ReferenceMarker,
                    `${number}..${number}` | `${number}..*`,
                >,
            toRecord: string | IdentifiableFDORecord,
        ): void;
        addType<Attr extends DefaultAttributeDef>(
            attribute: Attr,
            value?: AttrTypeWithCardinality<Attr>,
        ): void;
        get(attribute: string): AttributeAnyType | undefined;
        get<A extends DefaultAttributeDef>(
            attribute: A,
        ): AttrTypeWithCardinality<A> | undefined;
        getAll(): Map<string, AttributeAnyType | AttributeAnyType[]>;
        getData(): string | string[] | undefined;
        getProfile(): | string
        | ReferenceMarker
        | (string | ReferenceMarker)[]
        | undefined;
        getReferences(): ReferenceDeclaration[];
        getType(): string | string[] | undefined;
        has(attribute: string | DefaultAttributeDef): boolean;
        remove(attribute: string | DefaultAttributeDef): void;
        set(attribute: string, value: AttributeAnyType | AttributeAnyType[]): void;
        set<A extends DefaultAttributeDef>(
            attribute: A,
            value: AttrTypeWithCardinality<A>,
        ): void;
        toJSON(): Record<string, AttrTypeWithCardinality<DefaultAttributeDef>>;
        toString(): string;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    localID: `LOCAL/${string}`

    The locally unique identifier of this record

    PID: string | undefined

    The globally unique and registered identifier of this record. Undefined only if this record has not been published yet.

    • Add a unidirectional reference from this record to another record. The target record must either be known locally or be resolvable via its PID

      Parameters

      • fromAttribute:
            | string
            | AttributeDef<
                string,
                string
                | ReferenceMarker,
                `${number}..${number}` | `${number}..*`,
            >

        The attribute of this record where the reference will be placed

      • toRecord: string | IdentifiableFDORecord

        the record that should be referenced, or a local ID (LocalID) or PID of the referenced record. Must either be known locally or be resolvable via its PID

      Returns void

      FDORecord.addReferenceBidi for bidirectional references

    • Add a bidirectional reference from this record to another record and back. The target record must be in the current local or remote graph in order to create the back-reference

      Parameters

      • fromAttribute:
            | string
            | AttributeDef<
                string,
                string
                | ReferenceMarker,
                `${number}..${number}` | `${number}..*`,
            >

        The attribute of this record where the reference will be placed

      • inverseAttribute:
            | string
            | AttributeDef<
                string,
                string
                | ReferenceMarker,
                `${number}..${number}` | `${number}..*`,
            >

        The attribute of the target record where the back-reference will be placed

      • toRecord: string | IdentifiableFDORecord

        the record that should be referenced, or a local ID (LocalID) or PID of the referenced record. Must either be known locally or be resolvable via its PID

      Returns void

      FDORecord.addReference for unidirectional references

    • This attribute is the entry point to find the data associated with an FDO. If the identified resource is physical or conceptual, the string "self" is used. If the resource it digital, this attribute points to the Attribute that references the digital resource.

      Returns string | string[] | undefined

    • The FDO type gives a hint to a machine how the identified resource may be processed. It points to the attribute that further specifies the FDO type.

      Returns string | string[] | undefined