]> Lady’s Gitweb - Vocab/commitdiff
Add UnicodeString and UnicodeScalarValue
authorLady <redacted>
Mon, 24 Feb 2025 03:04:27 +0000 (22:04 -0500)
committerLady <redacted>
Mon, 24 Feb 2025 03:04:27 +0000 (22:04 -0500)
Some fixup was needed in the transforms for datatype restrictions to
accommodate this.

data/classes/¦UnicodeScalarValue [new file with mode: 0644]
data/classes/¦UnicodeString [new file with mode: 0644]
parsers/ontology.xslt
transforms/render.xslt

diff --git a/data/classes/¦UnicodeScalarValue b/data/classes/¦UnicodeScalarValue
new file mode 100644 (file)
index 0000000..9042c9b
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<!--
+SPDX-FileCopyrightText: 2025 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: CC0-1.0
+-->
+<!DOCTYPE Class SYSTEM "../../DTD">
+<Class>
+       <label xml:lang="en">Unicode Scalar Value</label>
+       <comment xml:lang="en">
+               <p>
+                       A thing with a <ref target="rdf:value">value</ref> between 0 and 10FFFF₁₆ but not between D800₁₆ and DFFF₁₆, representing a valid Unicode scalar value.
+               </p>
+               <p>
+                       Not all Unicode scalar values can be represented in a <resource name="xsd:string"/>, so representing them as integers is required.
+                       Unicode Scalar Values are uniquely identified by their value.
+               </p>
+       </comment>
+       <subClassOf>
+               <Restriction>
+                       <onProperty>
+                               <resource name="rdf:value"/>
+                       </onProperty>
+                       <cardinality>1</cardinality>
+               </Restriction>
+       </subClassOf>
+       <subClassOf>
+               <Restriction>
+                       <onProperty>
+                               <resource name="rdf:value"/>
+                       </onProperty>
+                       <allValuesFrom>
+                               <Datatype>
+                                       <unionOf>
+                                               <Datatype>
+                                                       <onDatatype>
+                                                               <resource name="xsd:integer"/>
+                                                       </onDatatype>
+                                                       <withRestrictions>
+                                                               <minInclusive datatype="xsd:integer">0</minInclusive>
+                                                               <maxInclusive datatype="xsd:integer">55295</maxInclusive>
+                                                       </withRestrictions>
+                                               </Datatype>
+                                               <Datatype>
+                                                       <onDatatype>
+                                                               <resource name="xsd:integer"/>
+                                                       </onDatatype>
+                                                       <withRestrictions>
+                                                               <minInclusive datatype="xsd:integer">57344</minInclusive>
+                                                               <maxInclusive datatype="xsd:integer">1114111</maxInclusive>
+                                                       </withRestrictions>
+                                               </Datatype>
+                                       </unionOf>
+                               </Datatype>
+                       </allValuesFrom>
+               </Restriction>
+       </subClassOf>
+       <hasKey>
+               <resource name="rdf:value"/>
+       </hasKey>
+</Class>
diff --git a/data/classes/¦UnicodeString b/data/classes/¦UnicodeString
new file mode 100644 (file)
index 0000000..fcfaad7
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+SPDX-FileCopyrightText: 2025 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: CC0-1.0
+-->
+<!DOCTYPE Class SYSTEM "../../DTD">
+<Class>
+       <label xml:lang="en">Unicode String</label>
+       <comment xml:lang="en">
+               <p>
+                       A <ref target="olo:OrderedList">Ordered List</ref> of <ref target="UnicodeScalarValue">Unicode Scalar Values</ref>.
+               </p>
+               <p>
+                       Unicode Strings essentially provide an alternative encoding of <resource name="xsd:string"/> in a way which can be reasoned about in R·D·F.
+                       Some Unicode scalar values cannot be represented in a <resource name="xsd:string"/>, so strings containing them can only be represented in this manner.
+               </p>
+       </comment>
+       <subClassOf>
+               <resource name="olo:OrderedList"/>
+       </subClassOf>
+       <subClassOf>
+               <Restriction>
+                       <onProperty>
+                               <resource name="olo:slot"/>
+                       </onProperty>
+                       <allValuesFrom>
+                               <Restriction>
+                                       <onProperty>
+                                               <resource name="olo:item"/>
+                                       </onProperty>
+                                       <allValuesFrom>
+                                               <resource name="UnicodeScalarValue"/>
+                                       </allValuesFrom>
+                               </Restriction>
+                       </allValuesFrom>
+               </Restriction>
+       </subClassOf>
+</Class>
index 83d0079f28573b3a46d9c30752eba6920de8795d..2dfdfcf5e8b320d64b20cbd301510d65298f2b43 100644 (file)
@@ -499,8 +499,8 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                                                        <text>http://www.w3.org/2001/XMLSchema#string</text>
                                                                                                </when>
                                                                                                <otherwise>
-                                                                                                       <call-template name="unprefix">
-                                                                                                               <with-param name="prefixed" select="@datatype"/>
+                                                                                                       <call-template name="Vocab:unprefix">
+                                                                                                               <with-param name="prefixed" select="string(@datatype)"/>
                                                                                                        </call-template>
                                                                                                </otherwise>
                                                                                        </choose>
index a014cc1a0f3b6e6722c5afb336b76bf90b01180b..cdde418d377e9c447e50ac35d595e31ed67ba8a9 100644 (file)
@@ -520,6 +520,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        </template>
        <template match="*" mode="Vocab:render-value">
                <param name="root" select="/"/>
+               <variable name="datatype" select="@rdf:datatype"/>
                <element name="code" namespace="&xhtml;">
                        <text>&quot;</text>
                        <element name="span" namespace="&xhtml;">
@@ -539,11 +540,11 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                        <text>@</text>
                                        <value-of select="@xml:lang"/>
                                </when>
-                               <when test="@rdf:datatype and string(@rdf:datatype)!='http://www.w3.org/2001/XMLSchema#string'">
+                               <when test="$datatype and string($datatype)!='http://www.w3.org/2001/XMLSchema#string'">
                                        <text>^^</text>
-                                       <for-each select="/">
+                                       <for-each select="$root">
                                                <call-template name="Vocab:link-to">
-                                                       <with-param name="resource" select="@rdf:datatype"/>
+                                                       <with-param name="resource" select="string($datatype)"/>
                                                        <with-param name="kind" select="'class'"/>
                                                </call-template>
                                        </for-each>
This page took 0.037861 seconds and 4 git commands to generate.