TicketRDF

RDF codec for a single wallet ticket (schema:Ticket).

The document's primary subject #this is always a schema:Ticket. Everything the ticket admits to hangs off a reservation envelope, and the rest of the pass lives on sibling fragment nodes of the same document — see documents/TICKET_VOCAB.md for the full shape and the justification for every minted solidshare: term.

#this        schema:Ticket
├─ #reservation schema:*Reservation →(reservationFor) #event | #trip
│ #trip schema:Flight | TrainTrip | BusTrip | BoatTrip →(dep/arr) #from / #to
│ #event schema:Event | subtype →(location) #venue
├─ #seat{n}, #barcode{n}, #detail{n}, #rel{n}, #wifi{n}
└─ #issuer, #holder, #membership, #style, #carrier

Reads follow the RDF links rather than fixed node names, so the reservation, trip and event are discovered through solidshare:reservation / schema:reservationFor regardless of how the nodes were named.

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

The pod URI of the original imported artifact (solidshare:artifact), or null.

Link copied to clipboard

Whether the artifact's issuer signature verified (solidshare:artifactVerified), or null.

Link copied to clipboard

The pass category, tolerating unknown stored values as TicketCategory.GENERIC.

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 timestamp (dcterms:created, ISO-8601), or null.

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
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 pod URIs of the stored pass images (solidshare:logoImage …), or null when none.

Link copied to clipboard

The date a wallet list should sort by: the event start, or a journey's departure.

Link copied to clipboard

The issuing organisation's display name, from the issuer node or organizationName.

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

The last-modification timestamp (dcterms:modified, ISO-8601), or null.

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

The pass's presentation (colours, logo), or null when none was stored.

Link copied to clipboard

The display title (schema:name); "" when absent, so a throwaway shell never crashes.

Link copied to clipboard

The validity end (schema:validThrough, ISO-8601), or null.

Link copied to clipboard
fun setArtifactUri(artifactUri: String?)

Sets (or clears, when null) the artifact link.

Link copied to clipboard

Sets (or clears, when null) the artifact-verified flag.

Link copied to clipboard
fun setCreated(isoDateTime: String)

Sets the creation timestamp (ISO-8601).

Link copied to clipboard
fun setImages(images: TicketImages?)

Sets (or clears, when null/blank) the stored pass image links.

Link copied to clipboard
fun setModified(isoDateTime: String)

Sets the last-modification timestamp (ISO-8601).

Link copied to clipboard

Rewrites this ticket's writable state from data with replace semantics: every fragment node and every optional property is replaced by the snapshot's content. Only the type triple, dcterms:created, solidshare:artifact, solidshare:artifactVerified and the stored image links survive — those belong to the resource lifecycle, not the ticket's editable content.

Link copied to clipboard
fun setTitle(title: String)

Sets the display title.

Link copied to clipboard

Reads this ticket's complete writable state into a NewTicket snapshot.

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