]> Lady’s Gitweb - Vocab/commitdiff
Fix some small rendering bugs
authorLady <redacted>
Thu, 31 Jul 2025 02:01:07 +0000 (22:01 -0400)
committerLady <redacted>
Thu, 31 Jul 2025 02:35:44 +0000 (22:35 -0400)
- Values in comments were not being serialized properly.

- Rendering `owl:oneOf` lists was broken due to a typo in the
  transform.

- A title wasn¦t present on the root index file, and the wrapping
  `<article>` was dropped.

- S·P·D·X licence comments are now dropped.

parsers/ontology.xslt
transforms/cleanup.xslt
transforms/render.xslt
transforms/terms.xslt

index 766d38669a9beed186dae15286d70700ccdd0104..dce85eb1e83954e0c45f412c083122ca95953442 100644 (file)
@@ -335,6 +335,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                </call-template>
                                                        </variable>
                                                        <if test="$prefixed!='xsd:string'">
+                                                               <text>^^</text>
                                                                <choose>
                                                                        <when test="contains($prefixed, '/') or contains(substring-after($prefixed, ':'), ':')">
                                                                                <text>&lt;</text>
index f572d607b32a2091b7f4c2756fc5942338c72cfb..33fb41247d3d5b4b22e1de9ff2f0d99f75c7958c 100644 (file)
@@ -42,4 +42,5 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        <template match="/rdf:RDF//text()[not(ancestor::html:*) and normalize-space()!='']" mode="书社:finalize" priority="10">
                <value-of select="normalize-space()"/>
        </template>
+       <template match="comment()[contains(., '&#xA;SPDX-License-Identifier:')]"/>
 </transform>
index cdde418d377e9c447e50ac35d595e31ed67ba8a9..5b2cc940ad74f903c845fbd0628979f111eef1ac 100644 (file)
@@ -162,7 +162,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        <when test="owl:oneOf">
                                <text>{</text>
                                <for-each select="owl:oneOf/*">
-                                       <apply-templates select="." name="Vocab:render-individual">
+                                       <apply-templates select="." mode="Vocab:render-individual">
                                                <with-param name="root" select="$root"/>
                                                <with-param name="resource-context" select="$resource-context"/>
                                        </apply-templates>
@@ -375,7 +375,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </call-template>
                </for-each>
        </template>
-       <template match="*" mode="Vocab:render-class">
+       <template match="@*|node()" mode="Vocab:render-class">
                <text>??</text>
        </template>
        <template match="rdf:Description" mode="Vocab:render-individual">
@@ -432,7 +432,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </call-template>
                </for-each>
        </template>
-       <template match="*" mode="Vocab:render-individual">
+       <template match="@*|node()" mode="Vocab:render-individual">
                <text>??</text>
        </template>
        <template match="owl:AnnotationProperty|owl:DatatypeProperty|rdf:Description" mode="Vocab:render-property">
@@ -515,10 +515,10 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </call-template>
                </for-each>
        </template>
-       <template match="*" mode="Vocab:render-property">
+       <template match="@*|node()" mode="Vocab:render-property">
                <text>??</text>
        </template>
-       <template match="*" mode="Vocab:render-value">
+       <template match="@*|node()" mode="Vocab:render-value">
                <param name="root" select="/"/>
                <variable name="datatype" select="@rdf:datatype"/>
                <element name="code" namespace="&xhtml;">
index 201e757186fe8d4e851f62ce8f4e5fb2203f2f14..796c55f7dc2edd531162b7012f1ef88ce1fd92ca 100644 (file)
@@ -257,150 +257,167 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                </copy>
        </template>
        <template match="html:article[rdf:RDF]">
-               <for-each select="rdf:RDF">
-                       <for-each select="//owl:Ontology[1]">
-                               <element name="hgroup" namespace="&xhtml;">
-                                       <element name="h1" namespace="&xhtml;">
+               <copy>
+                       <copy-of select="@*"/>
+                       <for-each select="rdf:RDF">
+                               <for-each select="//owl:Ontology[1]">
+                                       <element name="meta" namespace="&xhtml;">
+                                               <attribute name="itemprop">
+                                                       <text>urn:fdc:ladys.computer:20231231:Shu1She4:title</text>
+                                               </attribute>
                                                <attribute name="lang">
                                                        <value-of select="rdfs:label[1]/@xml:lang"/>
                                                </attribute>
                                                <attribute name="xml:lang">
                                                        <value-of select="rdfs:label[1]/@xml:lang"/>
                                                </attribute>
-                                               <value-of select="rdfs:label[1]"/>
+                                               <attribute name="content">
+                                                       <value-of select="//owl:Ontology[1]/rdfs:label[1]"/>
+                                               </attribute>
                                        </element>
-                                       <element name="p" namespace="&xhtml;">
-                                               &en;
-                                               <text>An ontology.</text>
+                                       <element name="hgroup" namespace="&xhtml;">
+                                               <element name="h1" namespace="&xhtml;">
+                                                       <attribute name="lang">
+                                                               <value-of select="rdfs:label[1]/@xml:lang"/>
+                                                       </attribute>
+                                                       <attribute name="xml:lang">
+                                                               <value-of select="rdfs:label[1]/@xml:lang"/>
+                                                       </attribute>
+                                                       <value-of select="rdfs:label[1]"/>
+                                               </element>
+                                               <element name="p" namespace="&xhtml;">
+                                                       &en;
+                                                       <text>An ontology.</text>
+                                               </element>
                                        </element>
-                               </element>
-                               <element name="div" namespace="&xhtml;">
-                                       <attribute name="class">
-                                               <text>owl</text>
-                                       </attribute>
-                                       <element name="dl" namespace="&xhtml;">
-                                               <element name="div" namespace="&xhtml;">
-                                                       <element name="dt" namespace="&xhtml;">
-                                                               <element name="abbr" namespace="&xhtml;">
-                                                                       &en;
-                                                                       <attribute name="title">
-                                                                               <text>Internationalized Resource Identifier</text>
-                                                                       </attribute>
-                                                                       <text>I·R·I</text>
+                                       <element name="div" namespace="&xhtml;">
+                                               <attribute name="class">
+                                                       <text>owl</text>
+                                               </attribute>
+                                               <element name="dl" namespace="&xhtml;">
+                                                       <element name="div" namespace="&xhtml;">
+                                                               <element name="dt" namespace="&xhtml;">
+                                                                       <element name="abbr" namespace="&xhtml;">
+                                                                               &en;
+                                                                               <attribute name="title">
+                                                                                       <text>Internationalized Resource Identifier</text>
+                                                                               </attribute>
+                                                                               <text>I·R·I</text>
+                                                                       </element>
                                                                </element>
-                                                       </element>
-                                                       <element name="dd" namespace="&xhtml;">
-                                                               <element name="a" namespace="&xhtml;">
-                                                                       <attribute name="href">
-                                                                               <value-of select="@rdf:about"/>
-                                                                       </attribute>
-                                                                       <element name="code" namespace="&xhtml;">
-                                                                               <value-of select="@rdf:about"/>
+                                                               <element name="dd" namespace="&xhtml;">
+                                                                       <element name="a" namespace="&xhtml;">
+                                                                               <attribute name="href">
+                                                                                       <value-of select="@rdf:about"/>
+                                                                               </attribute>
+                                                                               <element name="code" namespace="&xhtml;">
+                                                                                       <value-of select="@rdf:about"/>
+                                                                               </element>
                                                                        </element>
                                                                </element>
                                                        </element>
                                                </element>
                                        </element>
-                               </element>
-                               <apply-templates select="rdfs:comment[1]/html:div" mode="Vocab:render-term"/>
-                               <element name="section" namespace="&xhtml;">
-                                       <element name="h2" namespace="&xhtml;">
-                                               &en;
-                                               <text>List of Name·spaces</text>
-                                       </element>
-                                       <element name="table" namespace="&xhtml;">
-                                               <element name="thead" namespace="&xhtml;">
-                                                       <element name="tr" namespace="&xhtml;">
-                                                               <element name="th" namespace="&xhtml;">
-                                                                       &en;
-                                                                       <attribute name="scope">
-                                                                               <text>col</text>
-                                                                       </attribute>
-                                                                       Prefix
-                                                               </element>
-                                                               <element name="th" namespace="&xhtml;">
-                                                                       &en;
-                                                                       <attribute name="scope">
-                                                                               <text>col</text>
-                                                                       </attribute>
-                                                                       Name·space I·R·I
-                                                               </element>
-                                                       </element>
+                                       <apply-templates select="rdfs:comment[1]/html:div" mode="Vocab:render-term"/>
+                                       <element name="section" namespace="&xhtml;">
+                                               <element name="h2" namespace="&xhtml;">
+                                                       &en;
+                                                       <text>List of Name·spaces</text>
                                                </element>
-                                               <element name="tbody" namespace="&xhtml;">
-                                                       <for-each select="shacl:declare[shacl:prefix!='']">
-                                                               <sort select="shacl:prefix"/>
+                                               <element name="table" namespace="&xhtml;">
+                                                       <element name="thead" namespace="&xhtml;">
                                                                <element name="tr" namespace="&xhtml;">
                                                                        <element name="th" namespace="&xhtml;">
+                                                                               &en;
                                                                                <attribute name="scope">
-                                                                                       <text>row</text>
+                                                                                       <text>col</text>
                                                                                </attribute>
-                                                                               <element name="code" namespace="&xhtml;">
-                                                                                       <value-of select="shacl:prefix"/>
-                                                                                       <text>:</text>
-                                                                               </element>
+                                                                               Prefix
                                                                        </element>
-                                                                       <element name="td" namespace="&xhtml;">
-                                                                               <element name="code" namespace="&xhtml;">
-                                                                                       <value-of select="shacl:namespace"/>
-                                                                               </element>
+                                                                       <element name="th" namespace="&xhtml;">
+                                                                               &en;
+                                                                               <attribute name="scope">
+                                                                                       <text>col</text>
+                                                                               </attribute>
+                                                                               Name·space I·R·I
                                                                        </element>
                                                                </element>
-                                                       </for-each>
+                                                       </element>
+                                                       <element name="tbody" namespace="&xhtml;">
+                                                               <for-each select="shacl:declare[shacl:prefix!='']">
+                                                                       <sort select="shacl:prefix"/>
+                                                                       <element name="tr" namespace="&xhtml;">
+                                                                               <element name="th" namespace="&xhtml;">
+                                                                                       <attribute name="scope">
+                                                                                               <text>row</text>
+                                                                                       </attribute>
+                                                                                       <element name="code" namespace="&xhtml;">
+                                                                                               <value-of select="shacl:prefix"/>
+                                                                                               <text>:</text>
+                                                                                       </element>
+                                                                               </element>
+                                                                               <element name="td" namespace="&xhtml;">
+                                                                                       <element name="code" namespace="&xhtml;">
+                                                                                               <value-of select="shacl:namespace"/>
+                                                                                       </element>
+                                                                               </element>
+                                                                       </element>
+                                                               </for-each>
+                                                       </element>
                                                </element>
                                        </element>
-                               </element>
+                                       <element name="section" namespace="&xhtml;">
+                                               <element name="h2" namespace="&xhtml;">
+                                                       &en;
+                                                       <text>Terms Defined By </text>
+                                                       <element name="cite" namespace="&xhtml;">
+                                                               <attribute name="lang">
+                                                                       <value-of select="rdfs:label[1]/@xml:lang"/>
+                                                               </attribute>
+                                                               <attribute name="xml:lang">
+                                                                       <value-of select="rdfs:label[1]/@xml:lang"/>
+                                                               </attribute>
+                                                               <value-of select="rdfs:label[1]"/>
+                                                       </element>
+                                               </element>
+                                               <call-template name="Vocab:list-all-terms"/>
+                                       </element>
+                               </for-each>
                                <element name="section" namespace="&xhtml;">
                                        <element name="h2" namespace="&xhtml;">
                                                &en;
-                                               <text>Terms Defined By </text>
-                                               <element name="cite" namespace="&xhtml;">
-                                                       <attribute name="lang">
-                                                               <value-of select="rdfs:label[1]/@xml:lang"/>
-                                                       </attribute>
-                                                       <attribute name="xml:lang">
-                                                               <value-of select="rdfs:label[1]/@xml:lang"/>
-                                                       </attribute>
-                                                       <value-of select="rdfs:label[1]"/>
-                                               </element>
+                                               <text>Terms Defined Else·where</text>
                                        </element>
-                                       <call-template name="Vocab:list-all-terms"/>
-                               </element>
-                       </for-each>
-                       <element name="section" namespace="&xhtml;">
-                               <element name="h2" namespace="&xhtml;">
-                                       &en;
-                                       <text>Terms Defined Else·where</text>
-                               </element>
-                               <for-each select="//owl:NamedIndividual">
-                                       <sort select="rdfs:label" lang="en"/>
-                                       <if test="(//rdfs:isDefinedBy|//rdfs:isDefinedBy/anno:ResourceSelection/anno:hasSource)[string(@rdf:resource)=string(current()/@rdf:about)]">
-                                               <element name="section" namespace="&xhtml;">
-                                                       <element name="h3" namespace="&xhtml;">
-                                                               <element name="a" namespace="&xhtml;">
-                                                                       <attribute name="href">
-                                                                               <value-of select="@rdf:about"/>
-                                                                       </attribute>
-                                                                       <element name="cite" namespace="&xhtml;">
-                                                                               <attribute name="lang">
-                                                                                       <value-of select="rdfs:label[1]/@xml:lang"/>
-                                                                               </attribute>
-                                                                               <attribute name="xml:lang">
-                                                                                       <value-of select="rdfs:label[1]/@xml:lang"/>
+                                       <for-each select="//owl:NamedIndividual">
+                                               <sort select="rdfs:label" lang="en"/>
+                                               <if test="(//rdfs:isDefinedBy|//rdfs:isDefinedBy/anno:ResourceSelection/anno:hasSource)[string(@rdf:resource)=string(current()/@rdf:about)]">
+                                                       <element name="section" namespace="&xhtml;">
+                                                               <element name="h3" namespace="&xhtml;">
+                                                                       <element name="a" namespace="&xhtml;">
+                                                                               <attribute name="href">
+                                                                                       <value-of select="@rdf:about"/>
                                                                                </attribute>
-                                                                               <value-of select="rdfs:label[1]"/>
+                                                                               <element name="cite" namespace="&xhtml;">
+                                                                                       <attribute name="lang">
+                                                                                               <value-of select="rdfs:label[1]/@xml:lang"/>
+                                                                                       </attribute>
+                                                                                       <attribute name="xml:lang">
+                                                                                               <value-of select="rdfs:label[1]/@xml:lang"/>
+                                                                                       </attribute>
+                                                                                       <value-of select="rdfs:label[1]"/>
+                                                                               </element>
                                                                        </element>
                                                                </element>
+                                                               <apply-templates select="rdfs:comment[1]/html:div" mode="Vocab:render-term"/>
+                                                               <call-template name="Vocab:list-all-terms">
+                                                                       <with-param name="source" select="@rdf:about"/>
+                                                               </call-template>
                                                        </element>
-                                                       <apply-templates select="rdfs:comment[1]/html:div" mode="Vocab:render-term"/>
-                                                       <call-template name="Vocab:list-all-terms">
-                                                               <with-param name="source" select="@rdf:about"/>
-                                                       </call-template>
-                                               </element>
-                                       </if>
-                               </for-each>
-                       </element>
-               </for-each>
+                                               </if>
+                                       </for-each>
+                               </element>
+                       </for-each>
+               </copy>
        </template>
        <template match="*[@rdf:about and (self::owl:AnnotationProperty or self::owl:Class or self::owl:DatatypeProperty or self::owl:NamedIndividual or self::owl:ObjectProperty or self::rdfs:Datatype)]" mode="Vocab:render-term" priority="2">
                <variable name="root" select="/"/>
This page took 0.185132 seconds and 4 git commands to generate.