Soranoha

TEI拡張語彙 / Soranoha TEI extension vocabulary

Namespace IRI: https://w3id.org/soranoha/ns/tei Conventional prefix: snh: Current vocabulary version: 3

Soranoha publishes TEI P5. Where the Aozora Bunko source carries information TEI cannot represent exactly, that information goes in this namespace. Every published TEI root binds the namespace and declares the vocabulary version:

<TEI xmlns="http://www.tei-c.org/ns/1.0"
     xmlns:snh="https://w3id.org/soranoha/ns/tei"
     snh:vocab-version="3">

The extensions record what the parser found in the source. They do not replace the source records they come from, and a consumer that ignores them still has the whole transcription.

Versioning

The namespace IRI never changes. snh:vocab-version carries the major version, which the IRI does not. A breaking change increments it; an additive attribute may keep it when compatibility is documented.

The profile hashes in a work's tei-validation.json (odd_hash, rng_hash, schematron_hash) change on any profile edit, additive ones included. They identify which profile validated a document; they do not tell an snh:* reader whether it is still correct. The vocabulary version does.

Version 1 has attributes only and no custom elements. Version 2 adds snh:gaiji-reference inside tei:char: one element per reference clause, in source order, with its exact spelling in original. Version 3 adds snh:formatting-instruction inside tei:note, which keeps the ordered operations, selectors and effects; its operand source references point at the annotation bytes, not at the resolved body targets. Permitted semantic fields are defined in the ODD.

Attributes

All are optional and may appear on any element, subject to the constraints below. Only the first three are produced by the current pipeline; the remainder are declared for projections that are specified but not yet produced.

AttributeValueMeaning
snh:vocab-version1, 2, 3Vocabulary major version. Required on the root of any document carrying snh:* elements or attributes; snh:gaiji-reference requires 2 or 3; snh:formatting-instruction requires 3.
snh:layout-kindtoken, or space-separated tokens when scopes co-applyLayout fact projected verbatim from the parser IR. Paragraph layouts are burasage, chitsuki, jisage, jizume, line-jisage; inline scopes are baseline-position, chitsuki, emphasis, exponent, font-size, fraction, keigakomi, line-jisage, small-script, tcy, yokogumi.
snh:layout-paramskey=value pairs joined by ;Parameters of the layout fact, for example indent=2 or align=right;offset-from-end=1.
snh:preservation-recordr followed by six digitsRecord id in the publication-preservation sidecar.
snh:ir-pointerJSON PointerLocation in the parser IR of the projected fact.
snh:source-pointerpointer stringLocation in the source or AAT of the projected fact.
snh:source-markerstringOriginal Aozora Bunko marker, kept when a TEI-native rendering normalizes it away.
snh:accent-codestringAozora Bunko accent notation code.
snh:style-sourcestringAozora Bunko style source marker.
snh:figure-classstringAozora Bunko figure class.

Permitted values of snh:vocab-version are declared in the ODD and enforced through the generated Relax NG schema.

Source spans

In a published body, most elements carry @source, referencing a note of type source-span in the back matter. Together these notes form the offset table, identifying the span of source text corresponding to each element.

The note is empty; the extent is in its attributes:

<note type="source-span" xml:id="source-694-733" n="20"/>

The unit is declared in a refsDecl pointing to this document.

Notes whose xml:id starts with parser-source are parser diagnostics, not body elements; their byte extent is JSON in the element content.

Character declarations

Each gaiji in the text is represented by a g element referencing a char declaration in encodingDesc/charDecl. Available details for the character are recorded in the declaration:

ChildMeaning
mapping[@type='unicode']The single code point resolved from the marker's JIS X 0213 coordinate, U+ code, or description.
localProp[@name='mappingSource']Where the code point or variation sequence derives from the cjkvi-data table of Aozora notations rather than a JIS reference, the 外字注記辞書, or a composition rule: the URL of that table at the pinned commit.
localProp[@name='variationSource']Present when the selector of an IVS mapping derives from the cjkvi-data tables: the URL of that table at the pinned commit. When mappingSource is absent, the base character derives from the official dictionary.
mapping[@type='composed']A sequence of code points: a JIS X 0213 character represented in Unicode as a base and combining mark, a Roman numeral above twelve, or a 濁点付き… description composed as a base followed by U+3099 or U+309A.
mapping[@type='IVS']An Ideographic Variation Sequence (base character followed by a variation selector registered in the Unicode Ideographic Variation Database) from the cjkvi-data tables. An accompanying unicode mapping provides the base character.
mapping[@type='IDS']The Ideographic Description Sequence of a character unencoded in Unicode, derived from the GlyphWiki group for Aozora Bunko gaiji.
localProp[@name='glyphwiki']The GlyphWiki glyph name for that character, with the corresponding glyph image URL on glyphwiki.org provided in figure/graphic/@url.
localProp[@name='rawMarker'], localProp[@name='sourceReference'], localProp[@name='unresolvedReason']The marker's description, its reference clause and, when nothing above applies, the reason.
snh:gaiji-referenceOne element per reference clause, in source order, with its exact spelling in original.

For a character without an associated mapping, only its description and source span are retained. In plaintext and Markdown output, composed sequences appear where provided in TEI character declarations; otherwise, the original marker text appears.

Emendations

Where transcription defects in the source are emended prior to parsing, each correction is declared in the header:

<editorialDecl>
  <correction method="markup">
    <p xml:id="emendation-pariyori-403-ruby-bar-after-base" source="#source-START-END">
      <choice><sic>一番向|《むか》うにある</sic><corr>一番|向《むか》うにある</corr></choice>
    </p>
  </correction>
</editorialDecl>

Schematron rule identifiers

Each work's tei-validation.json lists violations as findings[].rule_id. The identifiers are stable names. All of those below are Schematron rules; a Relax NG failure has the constant rule_id relax-ng.

Rule IDSeverityRequires
snh-tei-header-titleerrorA main title in teiHeader/fileDesc/titleStmt (a title that is not one of the subordinate forms sub, sub-reading, reading, or original).
snh-tei-header-source-work-iderrorAn Aozora Bunko work ID or source work identifier in the header.
snh-header-language-declarederrorAt least one profileDesc/langUsage/language with a non-empty @ident.
snh-publication-licenceerrorA rights grant in publicationStmt/availability/licence with a non-empty @target.
snh-ruby-completeerrorRuby structures contain both base and reading components.
snh-ruby-base-non-emptyerrorA ruby base contains text or a declared character.
snh-ruby-reading-non-emptyerrorA ruby reading is not empty.
snh-gaiji-referenceerrorGaiji retains its original marker and either a resolved replacement or unresolved status.
snh-gaiji-chardecl-resolutionerrorA gaiji @ref fragment resolves to a charDecl/char in the same document.
snh-char-resolution-formerrorA charDecl/char declares at least one of mapping, unicodeProp, localProp, desc.
snh-figure-accessibilitywarningFigures must include a non-empty description or caption providing alternative text for the referenced image. Because most Aozora Bunko illustration markers specify only a filename and pixel dimensions without descriptive text, this warning reflects the source transcription as recorded.
snh-source-span-referenceerrorElements claiming source spans point to valid span identifiers.
snh-source-span-target-existserrorEach fragment id in @source resolves to an @xml:id in the same document.
snh-catref-target-existserrorEach fragment id in catRef/@target resolves to a category/@xml:id in the same document.
snh-transcription-vs-annotationwarningElements from the TEI analysis module may not appear within tei:text unless declared in the header. Stand-off anchors and sibling standOff elements generated by downstream enrichment are exempt from this restriction.
snh-vocab-version-declarederrorA root carrying snh:* elements or attributes declares snh:vocab-version; snh:gaiji-reference requires 2 or 3; snh:formatting-instruction requires 3.
snh-preservation-record-shapeerrorsnh:preservation-record values have the form r000000.
snh-layout-params-shapeerrorsnh:layout-params uses the key=value grammar above.

Rights in the header

Rights terms for each published work are recorded in fileDesc/publicationStmt/availability: one licence element for the underlying work (designated as public domain or released under a Creative Commons Attribution licence), and one for Soranoha's CC0 dedication of the markup, including a ptr to the full terms. The encoding grant derives from the publication policy hashed in the release manifest, while the rights standing of the work matches works[].rights in the manifest, ensuring consistency between detached TEI files and signed release records. Validation fails under snh-publication-licence when these declarations are absent. See rights and licensing.

Passing schema validation does not establish source fidelity or determine publication rights. Details on the two validation layers appear in TEI validation; source fidelity is addressed in source accountability.

Provenance of this document

The vocabulary is defined in soranoha/schemas/tei-profile.odd; the Relax NG and Schematron are generated from it. Where this page and the ODD disagree, the ODD is authoritative.