AddressBookRDF

RDF representation of a Solid address book root document (vcard:AddressBook).

This class is the read/write view of the address-book index document stored on the pod. It is typed vcard:AddressBook and records the book's owner, display title, and links to the two auxiliary index documents: the people (name-email) index and the groups index.

Construct from a freshly-parsed pod response by passing the parsed quads, or create a new empty instance by supplying only the identifier.

Constructors

Link copied to clipboard
constructor(identifier: String, contentType: String? = null, quads: List<RdfQuad>? = null, headers: SolidHeaders? = null)

Functions

Link copied to clipboard
fun addQuad(subject: String, predicate: String, obj: String, maxNumber: Int = 1)

Adds a triple whose object is an IRI (or blank node).

Link copied to clipboard
fun addQuadLiteral(subject: String, predicate: String, value: String, datatype: String? = XSD.STRING, language: String? = null, maxNumber: Int = 1)

Adds a triple whose object is a literal.

Link copied to clipboard
fun clearProperties(predicate: String, subject: String = itselfSubject)

Removes every triple with the given predicate for subject.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun describeContents(): Int
Link copied to clipboard
fun ensureType(subject: String, typeIri: String)

Ensures subject carries an rdf:type triple with typeIri, preserving any other type triples already present.

Link copied to clipboard

Returns the object values of every triple with the given predicate, across all subjects.

Link copied to clipboard

Returns the object values of every triple matching the given subject and predicate.

Link copied to clipboard
fun findProperty(predicate: String): String?

Returns the object value of the first triple with the given predicate, or null if none.

Link copied to clipboard
fun findPropertyForSubject(subject: String, predicate: String): String?

Returns the object value of the first triple matching subject and predicate, or null.

Link copied to clipboard

Returns a snapshot copy of all triples held by this resource.

Link copied to clipboard
open override fun getContentType(): String

The media type of the resource representation (the value of its Content-Type).

Link copied to clipboard

The creation time in epoch milliseconds, from this resource's own dcterms:created (then stat:ctime) triple, or null when neither is present.

Link copied to clipboard
open override fun getEntity(): InputStream

Returns the resource representation as a byte stream.

Link copied to clipboard

Returns the URI of the groups index document (vcard:groupIndex), or null when the book declares none — read that as "this book has no groups".

Link copied to clipboard
open override fun getHeaders(): SolidHeaders

The HTTP headers associated with this resource (empty when constructed locally).

Link copied to clipboard
open override fun getIdentifier(): String

The URI that identifies this resource on the pod.

Link copied to clipboard

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.

Link copied to clipboard
open override fun getMetadata(): SolidMetadata
Link copied to clipboard

Returns the URI of the people (name-email) index document (vcard:nameEmailIndex), or null when the book declares none — read that as "this book lists no contacts".

Link copied to clipboard

Returns the WebID of the address-book owner (acl:owner), or null when the document does not state one — a book written by another client, or a partial read.

Link copied to clipboard
fun getSize(): Long

The size of this resource in bytes (its Content-Length), or 0 when the server did not report one.

Link copied to clipboard

Returns the display title of this address book (dc:title), or null when untitled.

Link copied to clipboard
fun setGroupsIndex(groupsIndex: String)

Sets the URI of the groups index document.

Link copied to clipboard
fun setNameEmailIndex(peopleIndex: String)

Sets the URI of the people (name-email) index document.

Link copied to clipboard
fun setOwner(owner: String)

Sets the address-book owner to owner (a WebID IRI).

Link copied to clipboard
fun setTitle(title: String)

Sets the display title of this address book.

Link copied to clipboard
open override fun writeToParcel(dest: Parcel, flags: Int)