Tetr RDF vocabulary

Namespace https://tetr.resonator.am/ns# · prefix tetr: · Tetr 1.2

From version 1.2, Tetr writes a .ttl file (RDF in Turtle syntax) next to every note's PNG and Markdown. It describes the note in full: every stroke with its control points, every embedded drawing with its source markup, the transcript, and the AI model the note is set to use. The PNG stays the file of record; the sidecar exists so scripts, graph tools, and language models can read a note without decoding a PNG chunk.

Every sidecar starts with the same header. Dates use Dublin Core; everything else is in this vocabulary.

@prefix tetr: <https://tetr.resonator.am/ns#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<#note> a tetr:Note ;
    dcterms:created "2026-09-17T09:12:03Z"^^xsd:dateTime ;
    dcterms:modified "2026-09-17T09:40:51Z"^^xsd:dateTime ;
    tetr:image <Groceries.png> ;
    tetr:transcriptFile <Groceries.md> ;
    tetr:transcript "milk, eggs, coffee" ;
    tetr:agentProfile "Tetr AI" ;
    tetr:canvasWidth 1024 ;
    tetr:stroke <#s-3f9a…>, <#s-b21c…> ;
    tetr:embeds <#img-7e0d…> .

<#s-3f9a…> a tetr:Stroke ;
    tetr:index 0 ;
    tetr:inkType "pen" ;
    tetr:color "#1C1B19" ;
    tetr:width 2.4 ;
    tetr:bounds "42 88 210 31"^^tetr:rect ;
    dcterms:created "2026-09-17T09:12:05Z"^^xsd:dateTime ;
    tetr:source "user" ;
    tetr:controlPoints "42 96 0 2.4 2.4 1 0.31 1.57 1.2;…"^^tetr:pointsV1 .

Classes

tetr:NoteOne note. The subject is always <#note> relative to the sidecar.
tetr:StrokeOne PencilKit stroke. Subjects are <#s-…>, where the id is a content hash of the stroke, so an unchanged stroke keeps its id across saves.
tetr:EmbeddedImageAn image frozen on the page under the ink: an AI-rendered drawing, a text box, or a photo.

Properties of a note

tetr:imageRelative IRI of the note's PNG.
tetr:transcriptFileRelative IRI of the Markdown transcript.
tetr:transcriptThe transcript text itself, when there is one.
tetr:agentProfileName of the AI model profile chosen for this note, if the note overrides the default.
tetr:canvasWidthWidth of the canvas in points. Coordinates in the file are in this space, with the origin at the top left.
tetr:strokeThe note's strokes, in drawing order.
tetr:embedsThe note's embedded images.
dcterms:created, dcterms:modifiedTimestamps of the note, as xsd:dateTime.

Properties of a stroke

tetr:indexPosition of the stroke in the drawing, from 0.
tetr:inkType"pen", "marker", "pencil", or the raw PencilKit identifier for other inks.
tetr:colorInk colour as #RRGGBB, as drawn on a light canvas.
tetr:widthNominal stroke width in points.
tetr:boundsBounding box, a tetr:rect literal.
tetr:source"user" for ink you drew, "agent" for ink written by an AI model.
tetr:transformOptional affine transform applied to the stroke, a tetr:matrix literal.
tetr:maskPathOptional eraser mask as SVG path data, in stroke coordinates.
tetr:controlPointsThe stroke's control points, a tetr:pointsV1 literal. Enough to rebuild the stroke exactly.
dcterms:createdWhen the stroke was drawn.

Properties of an embedded image

tetr:fileRelative IRI of the bitmap, inside the note's agent/ folder.
tetr:boundsFrame on the canvas, a tetr:rect literal.
tetr:captionOptional caption.
tetr:markupType"svg", "html", "text" (a text box), or "photo".
tetr:markupThe source the bitmap was rendered from: the SVG or HTML an AI model produced, or the text of a text box. Absent for photos.
tetr:source"user" for photos, "agent" for rendered answers.

Datatypes

tetr:rectFour numbers separated by spaces: x y width height, in canvas points.
tetr:matrixThe six numbers of a 2D affine transform, a b c d tx ty, separated by spaces.
tetr:pointsV1Control points separated by ;. Each point is nine numbers separated by spaces: x y time width height opacity force azimuth altitude. Time is seconds from the start of the stroke; angles are radians.

Numbers are written with at most three decimals. Relative IRIs resolve against the sidecar's own location, so a note folder can be moved or renamed as a whole. The vocabulary may grow in later versions; existing terms keep their meaning.

← Back to Tetr