Appearance
Compact Spec
FreshConcise specification reference. All rules in minimum space.
Context
[prefix] <IRI> declare namespace
[p2] <p1:sub/> prefix foldingBuilt-in: rdf, rdfs, xsd, sh, provlabel = rdfs:label, comment = rdfs:comment
Annotation Block
{token token token}Tokens are whitespace-separated. Order is unordered.
Tokens
| Token | Syntax | Effect |
|---|---|---|
| Subject | =IRI | Set current subject |
| Fragment | =#frag | Set subject to base#frag |
| Clear | = | Clear subject |
| Object | +IRI | Declare object IRI |
| Object frag | +#frag | Declare fragment object |
| Type | .IRI | Emit rdf:type triple |
| Literal pred | IRI | Emit S → literal |
| Object pred | ?IRI | Emit S → object |
| Reverse pred | !IRI | Emit object → S |
| Datatype | ^^IRI | Qualify literal |
| Language | @lang | Tag literal |
| Remove | - prefix | Negate 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
- Deterministic — same input always produces same output
- Round-trip safe — parse → generate → parse produces equivalent quads
- Single-pass — no backtracking or look-ahead beyond current line
- No inference — only explicitly annotated triples appear in output
- No blank nodes — all resources must be named IRIs