Skip to content

Ambiguous node mapping pattern #2

Description

@langsamu

I don't think that this is a good pattern.

get photoUrl(): string | null {
return (
this.singularNullable(VCARD.hasPhoto, ValueMapping.iriToString) ??
this.singularNullable(VCARD.hasPhoto, ValueMapping.literalToString) ??
null
);
}

My interpretation of the intent in this code is 'give me a string which is either the IRI of a named node or the lexical value of a literal node'.

Please let me know. I think there might be a feature request here for the Wrapper library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions