ContactRDF
RDF representation of a single Solid contact (vcard:Individual).
Wraps the quads of one contact document on a pod and exposes typed accessors and mutators. Construct from a pod response by passing the parsed quads, or create a new empty instance by supplying only the identifier.
All mutator methods update the in-memory quad list; call the contacts data module to persist the change to the pod.
Constructors
Functions
Adds a postal address on a counter-labelled blank node (_:addr{n}), always typed vcard:Address plus vcard:Home/vcard:Work when classified. Does nothing and returns false when entry has no non-blank part.
Adds a typed vcard:hasInstantMessage entry on a counter-labelled blank node (_:im{n}). ImType.OTHER entries are written without a type triple. The handle is stored verbatim as an xsd:string value — instant-messaging identifiers span many schemes and bare forms, so it is kept exactly as provided. Does nothing and returns false when handle is blank or already present.
Adds a typed vcard:hasTelephone entry on a counter-labelled blank node (_:phone{n}). PhoneType.OTHER entries are written without a type triple, byte-compatible with legacy writers. Does nothing and returns false when number is blank or already present.
Returns the object values of every triple with the given predicate, across all subjects.
Returns the object value of the first triple with the given predicate, or null if none.
Returns all postal addresses (vcard:hasAddress). Nodes missing the vcard:Address class type still parse; entries with no address part are skipped.
Returns a snapshot copy of all triples held by this resource.
Returns the contact's anniversary (vcard:anniversary) raw lexical value, or null.
Returns the contact's birthday (vcard:bday) as its raw lexical value, or null if absent.
The contact's category tags (vcard:hasCategory literals).
The media type of the resource representation (the value of its Content-Type).
The creation time in epoch milliseconds, from this resource's own dcterms:created (then stat:ctime) triple, or null when neither is present.
Returns all email addresses with their vCard classification. Untyped legacy nodes read as EmailType.OTHER; a leading mailto: scheme is stripped from the value.
Returns the resource representation as a byte stream.
Returns the contact's formatted display name (vcard:fn).
The HTTP headers associated with this resource (empty when constructed locally).
The URI that identifies this resource on the pod.
Returns all instant-messaging handles (vcard:hasInstantMessage) with their vCard classification. Untyped legacy nodes read as ImType.OTHER.
Returns the contact's job title (vcard:title), or null if absent.
The contact's languages (vcard:hasLanguage entry nodes' vcard:language tags), in stored order.
The last-modified time in epoch milliseconds. Prefers this resource's own dcterms:modified (then stat:mtime) triple and falls back to the Last-Modified header. null when none is present.
Returns the contact's nickname (vcard:nickname), or null if absent.
Returns the contact's organization name (vcard:organization-name), or null if absent.
Returns the contact's organizational unit (vcard:organization-unit), or null.
Returns all phone numbers with their vCard classification. Untyped legacy nodes and nodes carrying unrecognized types read as PhoneType.OTHER; a leading tel: scheme is stripped from the value.
Returns the URL of the contact's photo (vcard:hasPhoto), or null if absent.
Removes the vcard:hasEmail entry for emailAddress from this contact's quad list.
Removes the vcard:hasTelephone entry for phoneNumber from this contact's quad list.
Removes the contact's photo link (vcard:hasPhoto).
Sets (or clears, when null) the contact's anniversary (vcard:anniversary), typed xsd:dateTime when the value contains a time component and xsd:date otherwise.
Sets (or clears, when null) the contact's birthday (vcard:bday).
Replaces the contact's category tags with categories (trimmed, de-duplicated, blanks dropped).
Rewrites this contact's writable state from data with replace semantics: every multi-valued entry (phones, emails, instant messages, addresses, URLs) and every optional literal is replaced by the snapshot's content; properties absent from data are removed. The photo link (vcard:hasPhoto) is left untouched.
Sets the contact's formatted display name.
Replaces the contact's geographic positions with geos (trimmed, de-duplicated, blanks dropped). Each entry is stored as a direct IRI object per the W3C vCard ontology (vcard:hasGeo <geo:…>); a bare lat,lng pair is prefixed with the geo: scheme so the stored object is always a valid IRI.
Sets (or clears, when null) the contact's job title (vcard:title).
Replaces the contact's languages with languages (BCP-47 tags; trimmed, de-duplicated case-insensitively, blanks dropped). Each tag lives on a counter-labelled blank node (_:lang{n}) carrying vcard:language, the W3C vCard ontology mapping of the vCard 4.0 LANG property.
Sets (or clears, when null) the contact's nickname (vcard:nickname).
Sets (or clears, when null) the contact's organization name (vcard:organization-name).
Sets (or clears, when null) the contact's organizational unit.
Sets (or clears, when null) the contact's persistent identifier (vcard:hasUID, IRI). A value that is already an absolute IRI (urn:uuid:…, https://…) is stored verbatim; anything else (e.g. a bare UID from a .vcf import) is wrapped as urn:uid:{percent-encoded value} so the stored object is always a valid IRI.
Reads this contact's complete writable state into a ContactData snapshot.