前言
本书定义从 AsciiDoc 源文档到 RDF 1.2 标题投影图的规则。
标题投影图以等号标题为节点,以标题层级和交叉引用为边。标题节点保存标题自身切片 raw、标题头部 literal fields、heading complex properties 和回源坐标。交叉引用边证据保存 xref raw、target selector、关系谓词、edge literal fields、edge complex properties 和回源坐标。
本书的核心断言是:标题是唯一节点来源,标题切片是阅读和回源单位,交叉引用是非层级边来源,复杂属性是 heading node 或 xref edge evidence 上值为 raw value object 的字段。段落、listing、table、label、surface attribute 和 source value block 不作为结构节点进入标题投影图。
raw value object 的内部 raw 由下游消费者按 field predicate 和 format 解释。标题投影图保存源文档表面事实、字段关系和回源坐标;schema validation 与 raw 内部字段解释属于下游消费者。
AsciiDoc 的本地可寻址 target 可以位于标题内部的 listing、table、paragraph、inline anchor 或其它 block 上。标题投影图不把这些 target 提升为节点;这些 target 的 ID 在投影中归属为所属标题节点的 address label。消费者通过该 label 仍然查询标题节点、标题切片和标题之间的关系边。
标题投影图的消费者通过 headline、address label、标题层级边、交叉引用边和字段谓词查询源文档结构。查询结果必须能回到源文件行范围,使阅读、判断和修改循环成立。
本书使用中文叙事。RDF、IRI、literal、triple term、reifier、selector、headline、field predicate、raw value object、source value block、provenance 等术语在正文中保留英文形式或中英并列形式,以保持与 W3C 文档和工程实现之间的术语连续性。
第一部:投影对象
这一部定义标题投影图的对象边界、消费者动作和输入事实。
1. 投影对象
标题投影图是从单个 AsciiDoc 源文档导出的 RDF 1.2 图。该图描述 heading node、heading node 之间的 structure edge、标题切片中的 xref edge evidence,以及归属于 heading node 或 xref edge evidence 的字段。
标题投影图的输入事实来自 source document 以及解析器恢复出的标题、标题层级、标题 metadata、本地 target catalog、xref occurrence、listing/source block 表面和 source location。投影器只在 source value block 满足 heading complex property 或 xref edge complex property 规则时创建 raw value object。投影器不解释 raw 内部结构,不执行业务 lint,不把普通段落或 block 提升为结构节点。
1.1. RDF 坐标
标题投影图使用 RDF 1.2 abstract data model。Turtle 是本书示例的可读序列化表面。Turtle 排版、前缀顺序和 triple 顺序不构成图语义。
本书使用以下命名空间:
@prefix aat: <https://micheng.dev/ns/asciidoc-abundant-tree#> .
@prefix rel: <https://micheng.dev/ns/asciidoc-relation#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
aat: 承载标题投影词表。rel: 承载由 xref rel 字段映射出的关系谓词。rdf: 承载 rdf:type 和 rdf:reifies。prov: 承载来源关系。xsd: 承载 typed literal。
1.2. 构成性对象
标题投影图承诺两类结构查询资源:
| 标题节点 |
由源文档中的等号标题创建。标题节点是文档结构、阅读、回源和递归查询的单位。 |
| 交叉引用边证据 |
由标题切片中的 xref 创建。边证据保存关系边的 raw、位置、字段、官方解析事实和 RDF 1.2 reifier 关系。 |
标题投影图的其它事实归属于这两类资源。标题字段归属于 heading node。xref edge 字段归属于 xref edge evidence。来源坐标归属于可回源的 heading node、xref edge evidence 和 raw value object。
source document、projection 和 projection activity 是 provenance 资源。它们描述图从哪份源文件派生、由哪次投影活动生成。它们不属于标题节点集合,也不参与标题层级边。
raw value object 是 complex property 的值。heading complex property 通过 field predicate 归属于 heading node;xref edge complex property 通过 field predicate 归属于 xref edge evidence。raw value object 保存 raw、format、binding evidence 和回源坐标。raw value object 不作为标题层级、标题顺序、relation triple 或 xref target binding 的结构资源。
raw value object 的 RDF identity 由投影器生成。source value block 的手动 ID 只在 xref edge complex property 通过 named attribute value 指向该 block 时成为 aat:sourceValueId。source value id 是绑定事实,不是 raw value object 的 RDF identity,也不是字段名。
标题投影图把 raw value object 的 raw 作为 opaque literal 保存。field predicate 和 format 为下游解释 raw 提供源表面线索;schema validation 与 raw 内部字段解释属于下游消费者。
本地非标题 target 的 ID 是标题节点的地址事实。该 ID 归属为覆盖 target source span 的标题节点的 aat:addressLabel,不创建结构节点,不参与标题层级边,也不作为 relation triple 的端点。
1.3. 消费者动作
标题投影图服务以下动作:
-
按 address label 查找标题节点。address label 来自标题自身手动 ID,或来自归属到该标题的本地非标题 target ID。
-
按 headline 查找标题节点。
-
读取标题节点自身的 raw 切片。
-
沿标题层级边递归读取子标题,并按
aat:childOrder排序同父 direct children。 -
按
aat:documentOrder读取全局 preorder 标题序列。 -
查看标题节点发出的交叉引用边。
-
读取 heading node 上的 literal fields 和 complex properties。
-
读取 xref edge evidence 上的 literal fields、complex properties 和 xref raw。
-
通过 field predicate 与 format 选择下游 raw 解析路径。
-
从查询结果回到源文件行范围。
公共图单位必须服务这些动作。不能服务这些动作的结构不进入标题投影图的核心对象。
1.4. 完整性
标题节点提供阅读单位。标题层级边提供递归阅读路径。aat:childOrder 提供同父 direct children 的局部顺序。aat:documentOrder 提供全局 preorder。交叉引用边提供作者显式写出的非层级关系。字段提供标题和边证据上的查询面。raw value object 提供复杂字段值的 raw 承载面。回源坐标提供读取和修改闭环。
这些对象共同构成标题投影图。标题投影图以标题为结构单位,并以标题切片、标题层级、交叉引用、字段、raw value object 和回源坐标满足阅读、遍历、关系查询、复杂值消费和源文件修改动作。
1.5. 排除边界
段落、listing、table、inline anchor、label、surface attribute 和 source value block 不创建结构节点。它们可以作为标题 raw、字段来源、raw value source、binding evidence、address label 来源或回源事实出现。
本地非标题 target 的 ID 投影为所属标题节点的 aat:addressLabel。该投影不表示源文档标题表面声明了该 ID,只表示该 ID 在标题投影图中寻址到该标题节点。
raw value object 内部 JSON、YAML、TOML、XML 或其它格式作为 raw literal 保留。raw 的内部解释属于读取该字段的下游消费者。
raw value object 的 format 来自 source block language。该字段表达 raw 的源文本语法。
heading complex property 由带 for 或 forSelector marker 的 source value block 产生。字段名来自该 block 的 property role。xref edge complex property 由 xref named attribute 产生。字段名来自 attribute key;attribute value 唯一匹配 source value id 时,字段值是 raw value object;未匹配或多义匹配时,字段值是 string literal。
1.6. 来源与回源
标题投影图必须包含 source document entity、projection entity 和 projection activity。来源关系使用 PROV-O。
:source-doc a prov:Entity, aat:AsciiDocSourceDocument ;
aat:relativePath "samples/structural-payload.adoc" .
:projection a prov:Entity, aat:HeadingProjection ;
prov:wasDerivedFrom :source-doc ;
prov:hadPrimarySource :source-doc ;
prov:wasGeneratedBy :projection-activity .
:projection-activity a prov:Activity, aat:ProjectionActivity ;
prov:used :source-doc .
aat:relativePath 使用 / 作为路径分隔符。该路径相对于调用方给定的 document root。每个可回源的 heading、xref edge evidence 和 raw value object 都必须保存自身的 aat:relativePath 以及自己的 line span。
包含 source file reconstruction surface 的 RDF12 输出通过 aat:sourceFile 连接 source document 与 aat:SourceFile。aat:SourceFile 使用 aat:relativePath 标识 source file,并使用 aat:raw 保存该 source file 的完整原始文本。
2. 标题节点
标题节点由 AsciiDoc 等号标题创建。一个标题节点对应源文档中的一个标题表面。
2.1. 标题表面
以下表面都创建标题节点:
= root
== 配送策略
=== 我是3级标题
一个等号标题、两个等号标题、三个等号标题直到六个等号标题均为标题。投影不因 Asciidoctor 将一个等号标题归入 document title 而取消该标题节点。
2.2. Headline
headline 是标题文本,不包含标题等号标记。
== 配送策略
该标题节点的 aat:headline 是 配送策略。
2.3. Level
aat:headingLevel 使用解析器恢复出的标题层级坐标。该坐标是 0-based section level 时,源文本中的 = 对应 0,== 对应 1,=== 对应 2。
在 structural-payload.adoc 中,== 配送策略 和 == 运力规则 的解析层级是 1,=== 我是3级标题 的解析层级是 2。该数值正确表达标题嵌套层级。
2.4. 身份
标题节点的 IRI 由投影器生成。address label、generated address label 和 headline 不构成节点 IRI。
节点 IRI 的输入是 baseIri、documentKey 和 heading local id。documentKey 是 relative path 的 sha256 十六进制摘要。heading local id 使用 heading-l<startLine>-o<ordinal>。同一 relative path、同一 startLine 下出现多个 heading 时,ordinal 按源文档顺序从 0 递增;无冲突时使用 0。
规范形式:
documentKey = sha256(relativePath)
localId = heading-l<startLine>-o<ordinal>
resourceIRI = <baseIri><documentKey>#<localId>
源文档中的作者字符串只作为查询 label 或 selector 使用。
示例:
:heading-l5-o0 a aat:Heading ;
aat:headline "配送策略" ;
aat:addressLabel "delivery" .
delivery 是 address label。配送策略 是 headline。二者都不构成 :heading-l5-o0 的身份。
2.5. Label 空间
标题节点 label 空间由 aat:addressLabel、aat:generatedAddressLabel 和 aat:headline 构成。selector 绑定标题节点时只查询这三类 label,不查询标题节点 IRI、role、普通字段谓词、xref display label 或 raw 文本。
aat:addressLabel 表示标题投影图中可寻址到标题节点的作者声明 label。该 label 来自标题自身手动 ID,或来自归属到该标题切片的本地非标题 target ID。aat:addressLabel 不表示该 label 一定写在标题表面。
同一 selector 可以命中多个标题节点。多义命中是源文档事实,投影器必须保留多义结果,不得任意选择一个标题节点作为唯一目标。
2.6. 本地 Target 的标题归属
AsciiDoc 的本地 target catalog 可以包含 section、listing、table、block、inline anchor 和未知类型 target。标题投影图只把等号标题创建为标题节点;非标题 target 不创建 RDF 结构节点。
本地非标题 target 的 ID 归属为覆盖该 target source span 起始行的最内层标题节点的 aat:addressLabel。归属依据是 target 的源位置,不是引用该 target 的 xref 出现位置。source span 缺失的本地非标题 target 不形成 address label。
== 核心引擎设计
[#engine-code]
[source,python]
----
print("warp")
----
== 最终结论
参见 <<engine-code, 代码清单>>。
engine-code 是 listing block 的本地 target ID。该 ID 在标题投影图中归属为 核心引擎设计 标题节点的 address label。
:core a aat:Heading ;
aat:headline "核心引擎设计" ;
aat:addressLabel "engine-code" .
:conclusion aat:references :core .
该投影不创建 listing block 结构节点:
# 不输出:
# :engine-code a aat:ListingBlock .
同一 address label 可以归属多个标题节点。该 selector 绑定时产生多义候选,不生成单一 target heading,也不生成主 relation triple。同一 address label 在同一标题节点下出现多次时,selector owner 是同一个标题节点,不因此制造多义。
跨文档 target 不读取外部文件,不归属到当前标题投影图。
2.7. 标题头部属性
标题头部 attrlist 的 ID、role 和 named attributes 均投影到标题节点。
[#delivery.policy, status=active, owner=ops]
== 配送策略
投影为:
:heading-l5-o0 a aat:Heading ;
aat:headline "配送策略" ;
aat:addressLabel "delivery" ;
aat:role "policy" ;
aat:status "active" ;
aat:owner "ops" .
named attributes 直接使用 aat: 命名空间下同名谓词。字段值作为 literal 保存。投影器不解释 status 和 owner 的业务语义。标题 role 是源文档表面的作者角色,不参与 selector binding,不决定 heading node 的 RDF type。heading node 的结构身份只来自等号标题。
字段名映射必须确定。字段名是合法 IRI local name 时,谓词 IRI 为 aat:<fieldName>。字段名包含不能直接进入 prefixed name 的字符时,投影器必须使用稳定的 IRI-safe 编码;同一字段名在同一投影配置下必须得到同一谓词 IRI。字段值统一按源文档表面值保存为 string literal。
#id 不投影为 aat:id。它投影为 aat:addressLabel。点号 role token 不投影为字段名谓词。它投影为 aat:role。named attribute 才进入 aat:<fieldName> 谓词。
标题 complex property 也使用同一套字段名映射。标题 complex property 的字段名来自 source value block 的 property role,字段值是 raw value object。标题 metadata role 仍只表达标题角色,不表达 complex property 字段名。
2.8. 重复 label
重复 headline 合法。重复 address label 按源文档事实保留。按重复 label 查询时,结果可以包含多个标题节点。投影器不为重复 label 虚构唯一绑定。
第二部:标题结构
这一部定义标题切片、直接父子关系、同父局部顺序、全局 preorder 和回源坐标。
3. 标题切片
标题切片是标题节点对应的连续源文本区域。每个标题节点有一个标题切片。
3.1. 起点
标题切片的起点是该标题头部 metadata 的第一行。没有 metadata 时,起点是标题行。
[#capacity.rule, status=active]
== 运力规则
该标题切片从 attrlist 行开始。
标题头部 metadata 是紧邻标题行、并归属于该标题的连续 metadata 表面。空行会结束 metadata 归属。属于前一个 block 的 metadata 不进入下一个标题切片起点。
3.2. 终点
标题切片的终点是下一个标题切片起点的前一行。没有下一个标题时,终点是源文件末尾。
标题切片不因标题层级嵌套而包含子标题切片。父子关系由结构边表达,标题节点自身 raw 只保存自身切片。
3.3. Raw
标题节点必须保存 aat:raw。aat:raw 是标题切片的原文。
示例:
:heading-l39-o0 aat:raw """[#capacity.rule, status=active]
== 运力规则
运力规则描述系统在不同运力条件下如何判断配送策略是否需要降级。
""" .
该 raw 不包含子标题:
=== 我是3级标题
123
读取子标题内容使用标题层级边递归完成。
3.4. 自身 Raw 与子树 Raw
aat:raw 只表示标题节点自身切片。它不表示该标题统摄的完整子树文本。
子树文本是查询结果,不是节点字段。消费者需要完整子树时,先取得当前标题节点的 aat:raw,再沿 aat:containsDirectly 递归取得后代标题节点的 aat:raw,并按文档顺序组合。
3.5. 行级坐标
标题节点必须保存:
aat:relativePath
|
源文档相对路径。 |
aat:startLine
|
标题切片起始行。 |
aat:endLine
|
标题切片结束行。 |
aat:headingLine
|
标题行。 |
aat:raw
|
标题切片原文。 |
标题节点具有 metadata 或正文内容时,必须保存对应的专用行范围:
aat:metadataStartLine
|
标题头部 metadata 起始行。 |
aat:metadataEndLine
|
标题头部 metadata 结束行。 |
aat:contentStartLine
|
标题行之后内容的起始行。 |
aat:contentEndLine
|
标题切片内容的结束行。 |
标题没有 metadata 时,不输出 aat:metadataStartLine 和 aat:metadataEndLine。标题行之后没有正文内容时,不输出 aat:contentStartLine 和 aat:contentEndLine。
所有 line number 使用 1-based line number。line span 是闭区间。
4. 标题结构边
标题结构边表达标题节点之间的直接结构关系。结构边只连接标题节点。
4.1. 直接包含
aat:containsDirectly 表达父标题到直接子标题的关系。该关系来自 AbundantDocument 的 logical heading tree,不来自 source line、relative path、IRI 或 Turtle 文本顺序。
示例:
:heading-l1-o0 aat:containsDirectly :heading-l5-o0 .
:heading-l1-o0 aat:containsDirectly :heading-l39-o0 .
:heading-l39-o0 aat:containsDirectly :heading-l44-o0 .
直接包含不表达传递闭包。若 root 直接包含 运力规则,且 运力规则 直接包含 我是3级标题,则 root 不直接包含 我是3级标题。
直接包含只连接标题节点。标题节点不通过 aat:containsDirectly 指向段落、listing、table、source value block、raw value object、label 或普通属性。
顶层标题没有父标题。若源文档存在一个等号 document title,该标题可以作为其它顶层 section 的父标题。若源文档没有可作为父级的等号标题,多个顶层标题之间不生成虚构 document heading;它们通过 aat:documentOrder 保持全局阅读顺序。
4.2. 递归读取
消费者通过 aat:containsDirectly 的递归查询取得标题子树。读取当前标题自身时只使用该标题节点的 aat:raw。读取标题统摄的完整子树时,递归读取子标题节点的 aat:raw。
4.3. 局部顺序
aat:childOrder 表达标题在其父标题 direct children 中的 1-based 局部顺序。只有存在父标题的 heading 输出 aat:childOrder。
示例:
:heading-l5-o0 aat:childOrder 1 .
:heading-l39-o0 aat:childOrder 2 .
:heading-l44-o0 aat:childOrder 1 .
同一父标题下的 direct children 必须拥有唯一、连续、从 1 开始的 aat:childOrder。消费者通过 aat:containsDirectly 取得 direct children 后,按 numeric aat:childOrder 排序。
aat:childOrder 不跨父标题。不同 parent 下的两个 heading 可以拥有相同 aat:childOrder,因为该值只在 parent 的 direct children 集合内解释。
4.4. 全局顺序
aat:documentOrder 表达标题在 logical heading tree preorder traversal 中的 1-based 全局顺序。所有 heading resources 必须输出 aat:documentOrder。
示例:
:heading-l1-o0 aat:documentOrder 1 .
:heading-l5-o0 aat:documentOrder 2 .
:heading-l39-o0 aat:documentOrder 3 .
:heading-l44-o0 aat:documentOrder 4 .
aat:documentOrder 在同一 projection 内唯一、连续、从 1 开始。存在 document title heading 时,该 heading 的 aat:documentOrder 为 1。无 document title heading 时,顶层 sections 按 AbundantDocument.children 顺序进入 traversal。
消费者需要整篇文档的线性标题序列时,按 numeric aat:documentOrder 排序。该字段不替代 aat:containsDirectly,因为全局 preorder 不能单独表达父子结构。
4.5. 回源坐标与排序边界
aat:relativePath、aat:startLine、aat:endLine、aat:headingLine 和 aat:raw 表达 heading 在 origin source file 中的位置与原文切片。
source coordinate fields 不表达 heading tree order。book-entry 输入中,不同 included files 的 heading 可以拥有相同 origin line number;消费者不得通过 source line、relative path、IRI lexical order 或 Turtle textual order 推断文档顺序。
aat:previousSibling 不属于核心 heading projection。核心 heading projection 使用 aat:childOrder 表达同父局部顺序,使用 aat:documentOrder 表达全局 preorder。
第三部:引用、字段与复杂属性
这一部定义交叉引用边、literal field、heading complex property 和 xref edge complex property。
5. 交叉引用边
交叉引用边由标题切片中的 xref 创建。行内解析只需要识别交叉引用,因为交叉引用是非层级边的来源。
5.1. Source Heading
xref 所在的标题切片决定边的 source heading。
配送策略依赖 xref:capacity[运力规则, rel=depends-on, weight=0.8, relation-evidence=rel-delivery-capacity]。
该 xref 位于 配送策略 标题切片中,因此 source heading 是 配送策略。
5.2. Target Heading
xref target 是 selector。selector 在标题投影 label 空间中绑定。标题投影 label 空间由 aat:addressLabel、aat:generatedAddressLabel 和 aat:headline 构成;xref target 不绑定到 role、字段谓词、xref display label、raw 文本或标题节点 IRI。
aat:addressLabel 来自标题自身手动 ID,或来自归属到标题的本地非标题 target ID。selector 指向 listing、table、block、inline anchor 或 source value block 的本地 target ID 时,target heading 是该 target ID 所属的标题节点。
capacity 绑定到 address label 为 capacity 的标题节点。因此上例的 target heading 是 运力规则。
engine-code 是 核心引擎设计 标题切片内 listing block 的本地 target ID 时,xref target selector engine-code 绑定到 核心引擎设计 标题节点。relation triple 的 object 是标题节点,不是 listing block。
selector 未绑定时,边证据保留 aat:targetSelector 和回源坐标,不生成虚构 target heading,不生成主 relation triple。
selector 多义绑定时,边证据保留候选目标,不任意选择一个 target heading,不生成主 relation triple。
xref edge evidence 保留原始 selector 和官方解析事实。aat:targetSelector 保存作者写出的 selector;aat:officialResolvedId、aat:officialResolvedType 和 aat:officialHref 保存 Asciidoctor 解析出的 target id、target type 和 href。官方解析事实不改变 relation triple 的 heading endpoint。
:xref-edge-l12-c4-o0 a aat:XrefEdge ;
aat:sourceHeading :heading-l5-o0 ;
aat:targetSelector "重复标题" ;
aat:candidateHeading :heading-l20-o0 ;
aat:candidateHeading :heading-l44-o0 ;
aat:relativePath "samples/ambiguous.adoc" ;
aat:startLine 12 ;
aat:endLine 12 .
5.3. Predicate
predicate 由 xref attribute rel 决定。没有 rel 时,predicate 是 aat:references。有 rel 时,predicate 使用该字段映射出的关系 IRI。
示例:
xref:capacity[运力规则]
投影为:
:source-heading aat:references :target-heading .
示例:
xref:capacity[运力规则, rel=depends-on]
投影为:
:source-heading rel:depends-on :target-heading .
rel 只选择谓词。投影器不解释该谓词的业务语义。
rel 字段是绝对 IRI 时,predicate 使用该 IRI。rel 字段是已知 CURIE 时,predicate 使用展开后的 IRI。rel 字段是普通 token 时,predicate 使用 rel: 命名空间下的稳定 IRI-safe 映射。rel 不能映射为合法 IRI 时,边证据保留 aat:rel,不生成主 relation triple。
5.4. 边证据
交叉引用边证据保存该边在源文档中的出现点、字段和 official resolved facts。边证据不是标题节点。
边证据 IRI 使用 xref-edge-l<startLine>-c<startColumn>-o<ordinal> local id。startLine 和 startColumn 来自 xref occurrence 的起点。相同行列出现多个 xref 时,ordinal 按源文档顺序从 0 递增;无冲突时使用 0。
边证据的 aat:startColumn 与 aat:endColumn 使用 source span column 语义。列号是 1-based Unicode code point column;aat:startColumn 是 xref occurrence 的起始列,aat:endColumn 是 xref occurrence 结束后的列位置。
示例:
:heading-l5-o0 rel:depends-on :heading-l39-o0 .
:xref-edge-l8-c8-o0 a aat:XrefEdge ;
rdf:reifies <<( :heading-l5-o0 rel:depends-on :heading-l39-o0 )>> ;
aat:sourceHeading :heading-l5-o0 ;
aat:targetHeading :heading-l39-o0 ;
aat:targetSelector "capacity" ;
aat:displayLabel "运力规则" ;
aat:rel "depends-on" ;
aat:weight "0.8" ;
aat:relation-evidence :value-l25-o0 ;
aat:raw "xref:capacity[运力规则, rel=depends-on, weight=0.8, relation-evidence=rel-delivery-capacity]" ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 8 ;
aat:endLine 8 ;
aat:startColumn 8 ;
aat:endColumn 96 .
普通 xref named attributes 使用 aat: 命名空间下同名 field predicate。示例中的 weight=0.8 投影为 aat:weight "0.8"。字段值按源文档表面值保存为 string literal。
xref edge complex property 也使用 field predicate。示例中的 relation-evidence=rel-delivery-capacity 匹配 source value block id 时,边证据输出 aat:relation-evidence :value-l25-o0。raw value object 保存该 source value block 的 raw、format、source coordinates 和 aat:sourceValueId。
同一个 xref edge evidence 可以拥有多个 complex properties。每个 xref named attribute 的 key 是字段名;value 唯一匹配 source value block id 时,该字段值是 raw value object。未匹配或多义匹配时,该字段值是 string literal。
6. 字段与复杂属性
字段是 heading node 或 xref edge evidence 上的谓词。字段值可以是 string literal,也可以是 raw value object。
literal field 保存源表面的 scalar value。complex property 保存源表面的 raw value object。二者使用同一套 field predicate 规则。
6.1. Literal Field
标题 attrlist named attributes 直接投影为标题节点 literal fields。
[#delivery.policy, status=active, owner=ops]
== 配送策略
投影为:
:heading-l5-o0
aat:role "policy" ;
aat:status "active" ;
aat:owner "ops" .
xref named attributes 在未绑定 source value block id 时投影为 xref edge evidence literal fields。
xref:capacity[运力规则, rel=depends-on, weight=0.8]
投影为:
:xref-edge-l8-c8-o0
aat:rel "depends-on" ;
aat:weight "0.8" .
literal field 不触发业务解释。aat:role、aat:status、aat:owner、aat:weight 只是源文档表面字段的 RDF 表达。下游消费者可以解释这些字段,也可以忽略这些字段。
字段名映射必须确定。字段名是合法 IRI local name 时,谓词 IRI 为 aat:<fieldName>。字段名包含不能直接进入 prefixed name 的字符时,投影器使用稳定的 IRI-safe 编码;同一字段名在同一投影配置下得到同一谓词 IRI。
rel 是 xref relation control field。它决定主 relation triple 的谓词,并可作为 aat:rel 保留。rel 不参与 source value id matching。
6.2. Raw Value Object
raw value object 是 complex property 的值。raw value object 保存 source value block 的 raw、format、source coordinate 和 binding evidence。
raw value object 保存以下事实:
aat:format
|
source value block 的 source block language。 |
aat:raw
|
source value block body 原文。 |
aat:relativePath、aat:startLine、aat:endLine
|
source value block 的完整源文件行范围。 |
aat:contentStartLine、aat:contentEndLine
|
source value block body 的源文件行范围。 |
aat:forSelector
|
heading complex property 使用非空 selector binding 时保存的 heading selector。 |
aat:sourceValueId
|
xref edge complex property 使用 source value id binding 时保存的 source value id。 |
raw value object 不保存字段名、结构分类标记或下游模型名。字段名由 heading node 或 xref edge evidence 指向 raw value object 的 field predicate 表达。raw value object 的 raw 作为 opaque literal 保存。schema validation 与 raw 内部字段解释属于下游消费者。
6.3. Heading Complex Property
带 for 或 forSelector marker 的 source value block 表达 heading complex property。该 block 的 property role 是字段名。source block language 是 format。block body 是 raw。
带值 marker 查询 标题节点 定义的 heading projection label space。绑定目标来自标题节点的 aat:addressLabel、aat:generatedAddressLabel 或 aat:headline。绑定失败或多义绑定时,不输出 heading complex property。
无值 marker 表达 source ownership binding。投影器使用 source value block 的源位置,找到覆盖该 block 起始行的最内层 heading node,并把 complex property 写到该 heading node。源位置无法确定 owning heading 时,不输出 heading complex property。
property role 必须稳定给出一个字段名。没有 property role 或有多个 property roles 的 source value block 不输出 heading complex property。
[.policy-risk-profile, for=delivery]
[source,json]
----
{
"owner": {
"team": "ops",
"fallback": "manual-review"
},
"risk": {
"level": "high",
"signals": ["weather", "capacity"]
}
}
----
投影为:
:heading-l5-o0 aat:policy-risk-profile :value-l10-o0 .
:value-l10-o0 aat:forSelector "delivery" ;
aat:format "json" ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 10 ;
aat:endLine 23 ;
aat:contentStartLine 13 ;
aat:contentEndLine 22 ;
aat:raw """{
"owner": {
"team": "ops",
"fallback": "manual-review"
},
"risk": {
"level": "high",
"signals": ["weather", "capacity"]
}
}""" .
无值 for 使用源位置归属 owning heading:
[.review-playbook, for]
[source,yaml]
----
review_team: quality-ops
steps:
- check latest exception report
----
该 source value block 已经由 for 字段声明为 heading complex property candidate。投影器按源位置确定 owning heading,并通过 aat:review-playbook 连接 raw value object。无值 marker 不输出 aat:forSelector。
6.4. Xref Edge Complex Property
xref edge complex property 由 xref named attribute 和 source value block 共同表达。attribute key 是字段名。attribute value 唯一匹配 source value block id 时,字段值是 raw value object。
xref:capacity[运力规则, rel=depends-on, relation-evidence=rel-delivery-capacity]
[#rel-delivery-capacity]
[source,yaml]
----
reason:
type: risk-control
signals:
- weather
- capacity
description: 配送策略需要读取运力规则来决定是否降级。
edge:
direction: outbound
required: true
----
投影为:
:xref-edge-l8-c8-o0 aat:relation-evidence :value-l25-o0 .
:value-l25-o0 aat:sourceValueId "rel-delivery-capacity" ;
aat:format "yaml" ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 25 ;
aat:endLine 37 ;
aat:contentStartLine 28 ;
aat:contentEndLine 36 ;
aat:raw """reason:
type: risk-control
signals:
- weather
- capacity
description: 配送策略需要读取运力规则来决定是否降级。
edge:
direction: outbound
required: true""" .
edge complex property 归属于 xref edge evidence。它不归属于 source heading,也不归属于 target heading。
一个 xref edge evidence 可以拥有多个 complex properties。每个匹配的 attribute 产生一个 field predicate。attribute value 未匹配 source value block id 或多义匹配 source value block id 时,该 attribute 按 literal field 输出。
6.5. Opaque Raw
raw value object 的 raw 作为 opaque literal 保存。JSON、YAML、TOML、XML 或其它格式内部字段由下游消费者解释。
raw value object 必须保存 raw、relative path、完整 line span 和 content line span。format 来自 source block language。heading selector binding 使用 aat:forSelector 保存 selector。xref edge source value binding 使用 aat:sourceValueId 保存 source value id。
raw value object 是 complex property 的值。公共查询通过所属 heading node 或 xref edge evidence 上的 field predicate 取得 raw value object。标题结构遍历由 heading node、aat:containsDirectly、aat:childOrder 和 aat:documentOrder 承担;relation triple 的端点由 source heading 与 target heading 承担。
source value block 的本地 target ID 可以成为所属标题节点的 address label。该 address label 只用于寻址标题节点,不改变 raw value object 的 complex property 身份。
6.6. Format
format 表达 raw 的源文本语法。该事实来自 source block language:[source,json] 的 format 是 json,[source,yaml] 的 format 是 yaml。source block 没有 language 时,raw value object 不输出 aat:format;投影器不通过 raw 内容猜测格式。
field predicate 与 format 是正交事实。aat:policy-risk-profile 或 aat:relation-evidence 表达下游模型入口;json 或 yaml 表达 raw 的文本语法。下游消费者按 field predicate 选择模型,按 format 解析 raw。
第四部:查询与验收
这一部定义公共查询面、完整样例和验收事实。
7. 查询契约
查询契约定义标题投影图的公共查询面。查询结果应返回可继续回源的 resource、relative path 和 line span。
7.1. 按 Address Label 查找标题
SELECT ?heading ?headline ?path ?start ?end WHERE {
?heading a aat:Heading ;
aat:addressLabel "delivery" ;
aat:headline ?headline ;
aat:relativePath ?path ;
aat:startLine ?start ;
aat:endLine ?end .
}
aat:addressLabel 来自标题自身手动 ID,或来自归属到标题的本地非标题 target ID。engine-code 是 核心引擎设计 标题切片内 listing block 的本地 target ID 时,以下查询返回 核心引擎设计 标题节点:
SELECT ?heading ?headline ?path ?start ?end WHERE {
?heading a aat:Heading ;
aat:addressLabel "engine-code" ;
aat:headline ?headline ;
aat:relativePath ?path ;
aat:startLine ?start ;
aat:endLine ?end .
}
7.2. 按 headline 查找标题
SELECT ?heading ?path ?start ?end WHERE {
?heading a aat:Heading ;
aat:headline "运力规则" ;
aat:relativePath ?path ;
aat:startLine ?start ;
aat:endLine ?end .
}
headline 可以重复。该查询可以返回多个标题节点。
7.3. 读取标题自身 Raw
SELECT ?raw WHERE {
?heading aat:addressLabel "capacity" ;
aat:raw ?raw .
}
该查询返回 capacity 标题节点自身切片 raw。子标题 raw 通过递归结构查询取得。
7.4. 读取直接子标题
SELECT ?child ?headline ?childOrder ?start ?end WHERE {
?parent aat:addressLabel "capacity" .
?parent aat:containsDirectly ?child .
?child aat:headline ?headline ;
aat:childOrder ?childOrder ;
aat:startLine ?start ;
aat:endLine ?end .
}
ORDER BY ?childOrder
7.5. 读取标题子树
SELECT ?descendant ?headline ?raw WHERE {
?root aat:addressLabel "capacity" .
?root aat:containsDirectly+ ?descendant .
?descendant aat:headline ?headline ;
aat:raw ?raw .
}
aat:containsDirectly+ 是查询层递归。投影图不物化传递闭包。
7.6. 读取全局标题顺序
SELECT ?heading ?headline ?documentOrder WHERE {
?heading a aat:Heading ;
aat:headline ?headline ;
aat:documentOrder ?documentOrder .
}
ORDER BY ?documentOrder
aat:documentOrder 是 logical heading tree preorder traversal 的全局顺序。它不替代 aat:containsDirectly;消费者需要树结构时仍应读取直接父子关系,并在同一 parent 的 direct children 上按 numeric aat:childOrder 排序。
7.7. 查找标题发出的交叉引用边
SELECT ?edge ?predicate ?target ?targetHeadline ?weight WHERE {
?source aat:addressLabel "delivery" .
?edge a aat:XrefEdge ;
aat:sourceHeading ?source ;
aat:targetHeading ?target ;
rdf:reifies <<( ?source ?predicate ?target )>> ;
aat:weight ?weight .
?target aat:headline ?targetHeadline .
}
xref target selector 指向本地非标题 target ID 时,?target 仍返回该 target 所属的标题节点。edge evidence 的 aat:targetSelector 和 aat:officialResolvedType 表达源文档中被引用的具体 AsciiDoc target 表面。
7.8. 查找未绑定交叉引用边
SELECT ?edge ?selector ?path ?start ?end WHERE {
?edge a aat:XrefEdge ;
aat:targetSelector ?selector ;
aat:relativePath ?path ;
aat:startLine ?start ;
aat:endLine ?end .
FILTER NOT EXISTS { ?edge aat:targetHeading ?target . }
FILTER NOT EXISTS { ?edge aat:candidateHeading ?candidate . }
}
该查询返回 selector 没有绑定到标题节点的 xref edge evidence。该结果不自动表示 dead link;dead link 判断属于下游 lint。
7.9. 查找多义交叉引用边
SELECT ?edge ?selector ?candidate WHERE {
?edge a aat:XrefEdge ;
aat:targetSelector ?selector ;
aat:candidateHeading ?candidate .
}
多义边不生成主 relation triple。
7.10. 按直接字段查找标题
SELECT ?heading ?headline ?start ?end WHERE {
?heading a aat:Heading ;
aat:role "policy" ;
aat:status "active" ;
aat:headline ?headline ;
aat:startLine ?start ;
aat:endLine ?end .
}
直接字段谓词表达源文档表面字段。该查询不要求投影器解释 policy 或 active 的业务含义。
7.11. 读取 Heading Complex Property
消费者按 field predicate 读取 heading complex property。
SELECT ?raw ?format ?path ?start ?end WHERE {
?heading aat:addressLabel "delivery" ;
aat:policy-risk-profile ?value .
?value aat:raw ?raw ;
aat:format ?format ;
aat:relativePath ?path ;
aat:startLine ?start ;
aat:endLine ?end .
}
aat:policy-risk-profile 是下游模型入口。raw value object 保存 raw、format 和 source coordinate。查询不需要枚举机制字段或过滤 role。
冷链样例中的标题复杂属性查询使用业务字段名:
SELECT ?configRaw ?playbookRaw WHERE {
?heading aat:addressLabel "cold-chain-release" ;
aat:release-policy-config ?config ;
aat:review-playbook ?playbook .
?config aat:format "json" ;
aat:raw ?configRaw .
?playbook aat:format "yaml" ;
aat:raw ?playbookRaw .
}
7.12. 读取 Xref Edge Complex Property
消费者按 xref edge evidence 上的 field predicate 读取 edge complex property。
SELECT ?raw ?format ?path ?start ?end WHERE {
?source aat:addressLabel "delivery" .
?target aat:addressLabel "capacity" .
?edge a aat:XrefEdge ;
rdf:reifies <<( ?source rel:depends-on ?target )>> ;
aat:relation-evidence ?value .
?value aat:raw ?raw ;
aat:format ?format ;
aat:relativePath ?path ;
aat:startLine ?start ;
aat:endLine ?end .
}
冷链样例中的边复杂属性查询使用 aat:dependency-evidence:
SELECT ?raw WHERE {
?edge a aat:XrefEdge ;
aat:dependency-evidence ?evidence .
?evidence aat:format "yaml" ;
aat:raw ?raw .
}
7.13. 查找 Source Set 文件
包含 source file reconstruction surface 的 RDF12 输出可以列出 source set 中的 source files。
SELECT ?path WHERE {
?sourceDoc a aat:AsciiDocSourceDocument ;
aat:sourceFile ?sourceFile .
?sourceFile a aat:SourceFile ;
aat:relativePath ?path .
}
ORDER BY ?path
8. 完整样例
本章使用 samples/structural-payload.adoc 展示标题投影图。
8.1. Source Document
样例中的 delivery 和 capacity 是标题 address labels。.policy 和 .rule 是标题 roles。policy-risk-profile 是 heading complex property 字段名。relation-evidence 是 xref edge complex property 字段名。rel-delivery-capacity 是 edge complex property 的 source value id。
= root
一段摘要
[#delivery.policy, status=active, owner=ops]
== 配送策略
配送策略依赖 xref:capacity[运力规则, rel=depends-on, weight=0.8, relation-evidence=rel-delivery-capacity]。
[.policy-risk-profile, for=delivery]
[source,json]
----
{
"owner": {
"team": "ops",
"fallback": "manual-review"
},
"risk": {
"level": "high",
"signals": ["weather", "capacity"]
}
}
----
[#rel-delivery-capacity]
[source,yaml]
----
reason:
type: risk-control
signals:
- weather
- capacity
description: 配送策略需要读取运力规则来决定是否降级。
edge:
direction: outbound
required: true
----
[#capacity.rule, status=active]
== 运力规则
运力规则描述系统在不同运力条件下如何判断配送策略是否需要降级。
=== 我是3级标题
123
8.2. 标题节点
该文档产生四个标题节点:
| 节点 | headline | label | level | 切片 |
|---|---|---|---|---|
|
|
|
line 1 到 line 4 |
|
|
|
|
|
line 5 到 line 38 |
|
|
|
|
line 39 到 line 43 |
|
|
|
|
line 44 到 line 46 |
rel-delivery-capacity 是 source value block 的本地 target ID。该 ID 按本地非标题 target 规则归属为 配送策略 标题节点的 address label。该归属只表示 rel-delivery-capacity 可以在标题投影图中寻址到 配送策略 标题节点,不表示 source value block 成为标题节点。
8.3. 标题结构
:heading-l1-o0 aat:containsDirectly :heading-l5-o0 .
:heading-l1-o0 aat:containsDirectly :heading-l39-o0 .
:heading-l39-o0 aat:containsDirectly :heading-l44-o0 .
:heading-l1-o0 aat:documentOrder 1 .
:heading-l5-o0 aat:documentOrder 2 ;
aat:childOrder 1 .
:heading-l39-o0 aat:documentOrder 3 ;
aat:childOrder 2 .
:heading-l44-o0 aat:documentOrder 4 ;
aat:childOrder 1 .
root 不直接包含 我是3级标题。该关系由递归查询推出。同一父标题下的 direct children 通过 aat:childOrder 排序;整篇文档的 preorder 通过 aat:documentOrder 排序。
8.4. 来源事实
:source-doc a prov:Entity, aat:AsciiDocSourceDocument ;
aat:relativePath "samples/structural-payload.adoc" .
:projection a prov:Entity, aat:HeadingProjection ;
prov:wasDerivedFrom :source-doc ;
prov:hadPrimarySource :source-doc ;
prov:wasGeneratedBy :projection-activity .
:projection-activity a prov:Activity, aat:ProjectionActivity ;
prov:used :source-doc .
包含 source file reconstruction surface 的 RDF12 输出还会通过 aat:sourceFile 指向 aat:SourceFile。aat:SourceFile 保存 source file 的 aat:relativePath 和完整 aat:raw。
8.5. 节点事实
:heading-l5-o0 a aat:Heading ;
aat:headline "配送策略" ;
aat:addressLabel "delivery" ;
aat:addressLabel "rel-delivery-capacity" ;
aat:role "policy" ;
aat:status "active" ;
aat:owner "ops" ;
aat:headingLevel 1 ;
aat:documentOrder 2 ;
aat:childOrder 1 ;
aat:policy-risk-profile :value-l10-o0 ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 5 ;
aat:endLine 38 ;
aat:headingLine 6 ;
aat:metadataStartLine 5 ;
aat:metadataEndLine 5 ;
aat:contentStartLine 8 ;
aat:contentEndLine 37 ;
aat:raw """[#delivery.policy, status=active, owner=ops]
== 配送策略
配送策略依赖 xref:capacity[运力规则, rel=depends-on, weight=0.8, relation-evidence=rel-delivery-capacity]。
[.policy-risk-profile, for=delivery]
[source,json]
----
{
"owner": {
"team": "ops",
"fallback": "manual-review"
},
"risk": {
"level": "high",
"signals": ["weather", "capacity"]
}
}
----
[#rel-delivery-capacity]
[source,yaml]
----
reason:
type: risk-control
signals:
- weather
- capacity
description: 配送策略需要读取运力规则来决定是否降级。
edge:
direction: outbound
required: true
----
""" .
:heading-l39-o0 a aat:Heading ;
aat:headline "运力规则" ;
aat:addressLabel "capacity" ;
aat:role "rule" ;
aat:status "active" ;
aat:headingLevel 1 ;
aat:documentOrder 3 ;
aat:childOrder 2 ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 39 ;
aat:endLine 43 ;
aat:headingLine 40 ;
aat:metadataStartLine 39 ;
aat:metadataEndLine 39 ;
aat:contentStartLine 42 ;
aat:contentEndLine 42 ;
aat:raw """[#capacity.rule, status=active]
== 运力规则
运力规则描述系统在不同运力条件下如何判断配送策略是否需要降级。
""" .
8.6. Heading Complex Property
[.policy-risk-profile, for=delivery] 表达 heading complex property。policy-risk-profile 是字段名。for=delivery 是 heading selector binding。该 source value block 没有 source value id;heading complex property 不要求 source value id。
:heading-l5-o0 aat:policy-risk-profile :value-l10-o0 .
:value-l10-o0 aat:forSelector "delivery" ;
aat:format "json" ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 10 ;
aat:endLine 23 ;
aat:contentStartLine 13 ;
aat:contentEndLine 22 ;
aat:raw """{
"owner": {
"team": "ops",
"fallback": "manual-review"
},
"risk": {
"level": "high",
"signals": ["weather", "capacity"]
}
}""" .
该 complex property 的公共读取路径是 heading 的 aat:policy-risk-profile。消费者按字段名取得 raw value object,并按 aat:format 解析 raw。
8.7. 交叉引用边
:heading-l5-o0 rel:depends-on :heading-l39-o0 .
:xref-edge-l8-c8-o0 a aat:XrefEdge ;
rdf:reifies <<( :heading-l5-o0 rel:depends-on :heading-l39-o0 )>> ;
aat:sourceHeading :heading-l5-o0 ;
aat:targetHeading :heading-l39-o0 ;
aat:targetSelector "capacity" ;
aat:displayLabel "运力规则" ;
aat:rel "depends-on" ;
aat:weight "0.8" ;
aat:relation-evidence :value-l25-o0 ;
aat:raw "xref:capacity[运力规则, rel=depends-on, weight=0.8, relation-evidence=rel-delivery-capacity]" ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 8 ;
aat:endLine 8 ;
aat:startColumn 8 ;
aat:endColumn 96 .
8.8. Xref Edge Complex Property
relation-evidence=rel-delivery-capacity 表达 xref edge complex property。relation-evidence 是字段名。rel-delivery-capacity 唯一匹配 source value block id,因此字段值是 raw value object。该 complex property 归属于 xref edge evidence,不归属于 source heading 或 target heading。
:xref-edge-l8-c8-o0 aat:relation-evidence :value-l25-o0 .
:value-l25-o0 aat:sourceValueId "rel-delivery-capacity" ;
aat:format "yaml" ;
aat:relativePath "samples/structural-payload.adoc" ;
aat:startLine 25 ;
aat:endLine 37 ;
aat:contentStartLine 28 ;
aat:contentEndLine 36 ;
aat:raw """reason:
type: risk-control
signals:
- weather
- capacity
description: 配送策略需要读取运力规则来决定是否降级。
edge:
direction: outbound
required: true""" .
8.9. 本地 Target Address Label 补充样例
本地非标题 target 的 ID 成为所属标题的 address label。以下补充样例中,capacity-evidence 是 listing block 的本地 target ID;该 listing 位于 运力规则 标题切片内。
[#capacity.rule, status=active]
== 运力规则
运力规则描述系统在不同运力条件下如何判断配送策略是否需要降级。
[#capacity-evidence]
[source,json]
----
{"threshold": 80}
----
[#delivery.policy]
== 配送策略
配送策略读取 xref:capacity-evidence[运力证据, rel=depends-on]。
补充样例的投影把 capacity-evidence 写为 运力规则 标题节点的 address label,并把 xref 关系投影为标题之间的关系边。
:heading-capacity a aat:Heading ;
aat:headline "运力规则" ;
aat:addressLabel "capacity" ;
aat:addressLabel "capacity-evidence" .
:heading-delivery rel:depends-on :heading-capacity .
:xref-edge-capacity-evidence a aat:XrefEdge ;
rdf:reifies <<( :heading-delivery rel:depends-on :heading-capacity )>> ;
aat:sourceHeading :heading-delivery ;
aat:targetHeading :heading-capacity ;
aat:targetSelector "capacity-evidence" ;
aat:displayLabel "运力证据" ;
aat:officialResolvedId "capacity-evidence" ;
aat:officialResolvedType "listing" .
该投影不创建 listing block 结构节点。消费者通过 aat:addressLabel "capacity-evidence" 查到 运力规则 标题节点,并读取该标题节点的 aat:raw 或标题子树。
8.10. 验收事实
samples/structural-payload.adoc 的投影必须满足:
-
标题节点数量为四个。
-
= root创建标题节点。 -
配送策略节点有aat:addressLabel "delivery"、aat:addressLabel "rel-delivery-capacity"、aat:role "policy"、aat:status "active"和aat:owner "ops"。 -
运力规则节点有aat:addressLabel "capacity"、aat:role "rule"和aat:status "active"。 -
运力规则节点自身 raw 不包含=== 我是3级标题。 -
root直接包含配送策略和运力规则。 -
运力规则直接包含我是3级标题。 -
配送策略和运力规则在root的 direct children 中分别拥有aat:childOrder 1和aat:childOrder 2。 -
四个标题节点的
aat:documentOrder按root、配送策略、运力规则、我是3级标题连续递增。 -
配送策略到运力规则生成rel:depends-on边。 -
xref
weight=0.8投影为边证据上的aat:weight "0.8"。 -
xref
relation-evidence=rel-delivery-capacity投影为边证据上的aat:relation-evidenceraw value object。 -
[.policy-risk-profile, for=delivery]表达 heading complex property。 -
heading complex property 通过
for=delivery绑定为配送策略的aat:policy-risk-profile。 -
heading raw value object 有
aat:forSelector "delivery"和aat:format "json"。 -
[#rel-delivery-capacity]通过 xref 的relation-evidence=rel-delivery-capacity绑定为depends-on边证据的aat:relation-evidenceraw value object。 -
edge raw value object 有
aat:sourceValueId "rel-delivery-capacity"和aat:format "yaml"。 -
format 来自 source block language。
-
raw 不展开为业务 RDF 图。
-
第 8 行 paragraph 不创建结构节点。
-
第 10 到 23 行 heading complex property source value block 不创建结构节点。
-
第 25 到 37 行 edge complex property source value block 不创建结构节点。
-
本地非标题 target ID 作为所属标题的
aat:addressLabel,但该 target 不创建 listing、table、block 或 inline anchor 结构节点。 -
role、status、owner和weight使用直接aat:谓词,不生成属性资源。
Appendix A: 术语表
- source document
-
作为事实来源的 AsciiDoc 源文件。
- heading projection graph
-
从 source document 派生出的 RDF 1.2 标题投影图。
- heading node
-
由等号标题创建的 RDF resource。标题节点是标题投影图的唯一结构节点类型。
- headline
-
标题文本,不包含标题等号标记。
- heading slice
-
标题节点对应的连续源文本区域。该区域从标题头部 metadata 或标题行开始,到下一个标题切片起点之前结束。
- heading raw
-
标题切片的源文本原文。
- structure edge
-
标题节点之间的直接父子结构边。
aat:containsDirectly表达直接包含;同父局部顺序由aat:childOrder表达,全局 preorder 由aat:documentOrder表达。 - xref edge
-
由标题切片中的交叉引用创建的非层级关系边。
- xref edge evidence
-
保存 xref raw、source heading、target heading、target selector、字段、官方解析事实、RDF 1.2 reifier 和回源坐标的边证据 resource。
- field predicate
-
由源表面的字段名映射得到的
aat:<name>谓词。字段名不能直接作为 prefixed local name 时,投影器使用稳定的 IRI-safe 编码。 - literal field
-
值为 string literal 的字段。标题 metadata named attribute 和未绑定 source value block 的 xref named attribute 产生 literal field。
- complex property
-
值为 raw value object 的字段。heading node 和 xref edge evidence 都可以拥有 complex property。
- raw value object
-
保存 source value block 的 raw、format、source coordinate 和 binding evidence 的 RDF resource。raw value object 不展开 raw 内部字段,不作为 heading node,不参与标题结构边,不作为 xref target heading。
- source value block
-
源文档中承载 raw value 的 listing/source block。source value block 只有在 heading complex property 或 xref edge complex property 规则匹配时进入 RDF 图,并以 raw value object 的形式出现。
- source value id
-
source value block 的本地 ID。xref edge complex property 使用 xref named attribute value 匹配 source value id。source value id 是 binding evidence,不是字段名,不是 raw value object 的 RDF identity。source value id 作为本地非标题 target ID 时归属为 owning heading 的 address label。
- property role
-
heading complex property source block 上承担字段名职责的 role token。property role 通过 field predicate 成为 heading node 上的 complex property 谓词。
- format
-
raw value object 的源文本语法。format 来自 source block language,例如
[source,json]输出aat:format "json",[source,yaml]输出aat:format "yaml"。 - local target
-
source document 内可由 AsciiDoc xref 寻址的 target catalog entry。local target 可以是 section、listing、table、block、inline anchor 或未知类型 target。
- selector
-
用于绑定 heading node 的字符串。xref target selector 和带值 heading complex property marker 查询 heading projection label space。无值 heading complex property marker 不是 selector,它按 source value block 源位置归属 owning heading。
- heading complex property marker
-
source value block attrlist 中的
for或forSelector字段。该字段的存在使 source value block 成为 heading complex property candidate;字段有非空值时,该值是 heading selector;字段无值时,source value block 按源位置归属 owning heading。 - address label
-
标题投影图中可寻址到 heading node 的作者声明 label。address label 来自标题自身手动 ID,或来自归属到该标题切片的本地非标题 target ID。
- generated address label
-
解析器为没有手动 ID 的标题恢复出的可寻址 label。
- heading projection label space
-
selector 绑定 heading node 时查询的 label 空间。该空间由
aat:addressLabel、aat:generatedAddressLabel和aat:headline构成。 - relative path
-
相对于投影调用方指定文档根目录的文件路径。
- line span
-
使用 1-based line number 表示的源文件连续行范围。line span 是闭区间。
- source span
-
使用 1-based line number 和 1-based Unicode code point column 表示的源文件行列范围。
start.column是 token 起始列;end.column是 token 结束后的列位置。 - triple term
-
RDF 1.2 中作为 RDF term 使用的 triple。
- reifier
-
使用
rdf:reifies指向 triple term 的 resource。 - provenance
-
描述投影图、投影活动和源文档之间来源关系的信息。
参考坐标
-
[rdf12-concepts] W3C, RDF 1.2 Concepts and Abstract Data Model, W3C Candidate Recommendation Snapshot, 07 April 2026. https://www.w3.org/TR/rdf12-concepts/
-
[rdf12-turtle] W3C, RDF 1.2 Turtle, W3C Working Draft, 19 May 2026. https://www.w3.org/TR/rdf12-turtle/
-
[prov-o] W3C, PROV-O: The PROV Ontology, W3C Recommendation, 30 April 2013. https://www.w3.org/TR/prov-o/
-
[dcmi-terms] DCMI, DCMI Metadata Terms. https://www.dublincore.org/specifications/dublin-core/dcmi-terms/
-
[asciidoc-abundant-tree-ontology]
asciidoc-abundant-tree 本体规约.md。 -
[asciidoc-abundant-tree-engineering]
asciidoc-abundant-tree 工程实现规约.md。 -
[asciidoc-abundant-tree-acceptance]
asciidoc-abundant-tree 验收标准与黑盒测试.md。