]> Lady’s Gitweb - Vocab/blob - data/datatype_properties/¦n
Update ⛩📰 书社 to 1.0.1
[Vocab] / data / datatype_properties / ¦n
1 <?xml version="1.0"?>
2 <!--
3 SPDX-FileCopyrightText: 2025 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: CC0-1.0
5 -->
6 <!DOCTYPE DatatypeProperty SYSTEM "../../DTD">
7 <DatatypeProperty functional="yes" status="testing">
8 <label xml:lang="en">local notation</label>
9 <comment xml:lang="en">
10 <p>
11 An integer, string, or time·stamp which identifies and orders a thing within a given context.
12 </p>
13 <p>
14 String values can either be valid <resource name="xsd:NCName"/>¦s or else have the form of a <resource name="xsd:gYearMonth"/> or <resource name="xsd:date"/> with no time·zone component.
15 These possibilities were selected to ensure that the lexical forms of each type are disjoint.
16 </p>
17 <p>
18 Because this property is functional, a <resource name="Proxy"/> must be used when local notation depends on a particular context.
19 </p>
20 <p>
21 Correctly ordering things by local notation involves two steps.
22 First, the local notation must be split into a tuple of two parts :⁠—
23 </p>
24 <list>
25 <item>
26 <p>
27 If it is a string which begins with an underscore and contains another underscore which is followed by a period :⁠—
28 </p>
29 <list>
30 <item>
31 <p>
32 Let <var>base</var> be the portion of the string which follows the initial underscore and precedes the first successive underscore‐period sequence.
33 </p>
34 </item>
35 <item>
36 <p>
37 Let <var>mod</var> be the portion of the string which follows that same underscore‐period sequence.
38 </p>
39 </item>
40 <item>
41 <p>
42 If <var>mod</var> is not itself a valid canonical representation for some local notation, then the first value of the tuple is the original string, and the second value is the empty string.
43 </p>
44 </item>
45 <item>
46 <p>
47 Otherwise, if <var>base</var> is a valid <resource name="xsd:NCName"/> or else has the form of a <resource name="xsd:gYearMonth"/> or <resource name="xsd:date"/> with no time·zone component, then the tuple is {<var>base</var>, <var>mod</var>}.
48 </p>
49 </item>
50 <item>
51 <p>
52 Otherwise, if <var>base</var> is the canonical representation of some <resource name="xsd:integer"/> <var>int</var>, then the tuple is {<var>int</var>, <var>mod</var>}.
53 </p>
54 </item>
55 <item>
56 <p>
57 Otherwise, make the following modifications to <var>base</var> :⁠—
58 </p>
59 <list>
60 <item>
61 <p>
62 Replace all underscores in <var>base</var> with plusses.
63 </p>
64 </item>
65 <item>
66 <p>
67 If <var>base</var> contains <code>T</code>, replace the first two periods in <var>base</var> which follow <code>T</code> (if present) with colons.
68 </p>
69 </item>
70 <item>
71 <p>
72 If <var>base</var> ends in a digit, replace the final remaining period in <var>base</var> (if present) with a colon.
73 </p>
74 </item>
75 </list>
76 <p>
77 If, after making the above substitutions, <var>base</var> is the canonical representation of some <resource name="xsd:dateTimeStamp"/> <var>time</var>, then the tuple is {<var>time</var>, <var>mod</var>}.
78 </p>
79 </item>
80 <item>
81 <p>
82 Otherwise, the first value of the tuple is the original string, and the second value is the empty string.
83 </p>
84 </item>
85 </list>
86 </item>
87 <item>
88 <p>
89 Otherwise, the first value of the tuple is the original string, and the second value is the empty string.
90 </p>
91 </item>
92 </list>
93 <p>
94 Then, the values of the tuples can be sorted according to the following rules, with the first part taking priority over the second :⁠—
95 </p>
96 <list>
97 <item>
98 <p>
99 Empty strings are always sorted first.
100 </p>
101 </item>
102 <item>
103 <p>
104 Integers are sorted by numeric value and come after empty strings.
105 </p>
106 </item>
107 <item>
108 <p>
109 Time·stamps and strings which match <resource name="xsd:gYearMonth"/> or <resource name="xsd:date"/> come after integers, and are sorted according to their corresponding “time on timeline” values, with the following modifications :⁠—
110 </p>
111 <list>
112 <item>
113 <p>
114 For <resource name="xsd:gYearMonth"/> values, the missing day component is treated as the first rather than the last day of the month
115 </p>
116 </item>
117 <item>
118 <p>
119 When the “time on timeline” value is the same, <resource name="xsd:gYearMonth"/> sorts before <resource name="xsd:date"/>, and <resource name="xsd:date"/> sorts before <resource name="xsd:dateTimeStamp"/>.
120 </p>
121 </item>
122 <item>
123 <p>
124 When the “time on timeline” value is the same for two <resource name="xsd:dateTimeStamp"/> values, they are sorted based on their timezone offsets in ascending order.
125 </p>
126 </item>
127 </list>
128 </item>
129 <item>
130 <p>
131 Strings which match <resource name="xsd:NCName"/> follow the above, and are sorted lexically by code·point value.
132 </p>
133 </item>
134 </list>
135 <p>
136 The above algorithm effectively establishes a special microsyntax in which <code>_base_.mod</code> will always sort after <code>base</code>, regardless of <code>base</code>¦s type.
137 When <code>base</code> is a <resource name="xsd:dateTimeStamp"/>, a few reversible modifications need to be made in order to satisfy the <resource name="xsd:NCName"/> syntax :⁠—
138 </p>
139 <list>
140 <item>
141 <p>
142 Any colons in the time component or time·zone offset must be replaced with periods.
143 </p>
144 </item>
145 <item>
146 <p>
147 A plus in the time·zone offset, if present, must be replaced with an underscore.
148 </p>
149 </item>
150 </list>
151 </comment>
152 <subPropertyOf>
153 <resource name="dcterms:identifier"/>
154 </subPropertyOf>
155 <range>
156 <Datatype>
157 <unionOf>
158 <resource name="xsd:integer"/>
159 <resource name="xsd:NCName"/>
160 <Datatype>
161 <onDatatype>
162 <resource name="xsd:string"/>
163 </onDatatype>
164 <withRestrictions>
165 <pattern>[0-9]{4}(-[0-9]{2}){1,2}</pattern>
166 </withRestrictions>
167 </Datatype>
168 <resource name="xsd:dateTimeStamp"/>
169 </unionOf>
170 </Datatype>
171 </range>
172 </DatatypeProperty>
This page took 0.366132 seconds and 5 git commands to generate.