Skip to content

Compact Spec

Fresh

Concise specification reference. All rules in minimum space.

Context

[prefix] <IRI>           declare namespace
[p2] <p1:sub/>           prefix folding

Built-in: rdf, rdfs, xsd, sh, prov
label = rdfs:label, comment = rdfs:comment

Annotation Block

{token token token}

Tokens are whitespace-separated. Order is unordered.

Tokens

TokenSyntaxEffect
Subject=IRISet current subject
Fragment=#fragSet subject to base#frag
Clear=Clear subject
Object+IRIDeclare object IRI
Object frag+#fragDeclare fragment object
Type.IRIEmit rdf:type triple
Literal predIRIEmit S → literal
Object pred?IRIEmit S → object
Reverse pred!IRIEmit object → S
Datatype^^IRIQualify literal
Language@langTag literal
Remove- prefixNegate any token

Quad Emission

S predicate literal    ← [value] {predicate}
S predicate O          ← [text] {+O ?predicate}
O predicate S          ← [text] {+O !predicate}
S rdf:type C           ← {.C}

Polarity Rules

  • Positive + assertion in same document and negative - cancel: both disappear from output
  • Negative with no matching positive becomes external retraction (stored in remove)
  • Hard invariant: quads ∩ remove = ∅

Carriers

Inline: [text], **text**, *text*, `text`, <url>, [text](url)
Block: # heading, - list item, > blockquote, ```fence```

Scope Rules

  • Subject persists from {=IRI} until next declaration or {=} clear
  • Prefixes persist for entire document
  • Fragment {=#frag} appends to current base IRI, stripping prior fragment
  • List items: no semantic scope inheritance; each item needs explicit annotations

Normative Properties

  1. Deterministic — same input always produces same output
  2. Round-trip safe — parse → generate → parse produces equivalent quads
  3. Single-pass — no backtracking or look-ahead beyond current line
  4. No inference — only explicitly annotated triples appear in output
  5. No blank nodes — all resources must be named IRIs