]> Lady’s Gitweb - Vocab/blob - parsers/data/ontology.xslt
Initial commit; initial set of vocabs
[Vocab] / parsers / data / ontology.xslt
1 <?xml version="1.0"?>
2 <!--
3 SPDX-FileCopyrightText: 2024 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: MPL-2.0
5 -->
6 <!--
7 © 2024 Lady [@ Ladys Computer].
8
9 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
10 If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
11 -->
12 <!DOCTYPE transform [
13 <!ENTITY continue '<apply-templates xmlns="http://www.w3.org/1999/XSL/Transform" select="@*[not(local-name()=&#x27;status&#x27; and namespace-uri()=&#x27;&#x27;)]"/><apply-templates xmlns="http://www.w3.org/1999/XSL/Transform" select="resource|value"/><apply-templates xmlns="http://www.w3.org/1999/XSL/Transform" select="@status|node()[not(self::resource or self::value)]"/>'>
14 <!ENTITY unprefix '<call-template xmlns="http://www.w3.org/1999/XSL/Transform" name="Vocab:unprefix"><with-param name="prefixed" select="string()"/></call-template>'>
15 ]>
16 <transform
17 xmlns="http://www.w3.org/1999/XSL/Transform"
18 xmlns:Vocab="urn:fdc:vocab.ladys.computer:20240731:ns"
19 xmlns:Vocabvocab="urn:fdc:vocab.ladys.computer:20240731:vocab:"
20 xmlns:anno="http://www.w3.org/ns/oa#"
21 xmlns:dcterms="http://purl.org/dc/terms/"
22 xmlns:exsl="http://exslt.org/common"
23 xmlns:html="http://www.w3.org/1999/xhtml"
24 xmlns:owl="http://www.w3.org/2002/07/owl#"
25 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
26 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
27 xmlns:shacl="http://www.w3.org/ns/shacl#"
28 xmlns:skos="http://www.w3.org/2004/02/skos/core#"
29 xmlns:vocabstatus="http://www.w3.org/2003/06/sw-vocab-status/ns#"
30 xmlns:xlink="http://www.w3.org/1999/xlink"
31 xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
32 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
33 extension-element-prefixes="exsl"
34 exclude-result-prefixes="Vocab"
35 version="1.0"
36 >
37 <书社:id>urn:fdc:vocab.ladys.computer:20240731:parsers:data:ontology.xslt</书社:id>
38 <template name="Vocab:local-name">
39 <choose>
40 <when test="substring-after($IDENTIFIER, '/')=''"/>
41 <when test="starts-with(substring-after($IDENTIFIER, '/'), '%C2%A6')">
42 <value-of select="substring-after(substring-after($IDENTIFIER, '/'), '%C2%A6')"/>
43 </when>
44 <when test="substring(substring-after($IDENTIFIER, '/'), 1, 1)='_' and substring($IDENTIFIER, string-length($IDENTIFIER), 1)='_'">
45 <variable name="underscored" select="substring-after($IDENTIFIER, '/')"/>
46 <text>(</text>
47 <value-of select="substring($underscored, 2, string-length($underscored)-2)"/>
48 <text>)</text>
49 </when>
50 <when test="not(contains(substring-after($IDENTIFIER, '/'), '%C2%A6'))">
51 <value-of select="substring-after($IDENTIFIER, '/')"/>
52 </when>
53 <otherwise>
54 <value-of select="substring-before(substring-after($IDENTIFIER, '/'), '%C2%A6')"/>
55 <text>:</text>
56 <value-of select="substring-after(substring-after($IDENTIFIER, '/'), '%C2%A6')"/>
57 </otherwise>
58 </choose>
59 </template>
60 <template name="Vocab:prefix">
61 <param name="unprefixed" select="''"/>
62 <variable name="namespace" select="document('../../data/ontologies/%C2%A6')/Ontology/declare/namespace[starts-with($unprefixed, string())][1]"/>
63 <choose>
64 <when test="not($namespace)">
65 <value-of select="$unprefixed"/>
66 </when>
67 <otherwise>
68 <value-of select="$namespace/preceding-sibling::prefix"/>
69 <text>:</text>
70 <value-of select="substring-after($unprefixed, $namespace)"/>
71 </otherwise>
72 </choose>
73 </template>
74 <template name="Vocab:unprefix">
75 <param name="prefixed" select="''"/>
76 <variable name="prefix" select="substring-before($prefixed, ':')"/>
77 <choose>
78 <when test="not(contains($prefixed, ':'))">
79 <value-of select="document('../../data/ontologies/%C2%A6')/Ontology/declare/prefix[string()='']/following-sibling::namespace"/>
80 <value-of select="$prefixed"/>
81 </when>
82 <when test="not(document('../../data/ontologies/%C2%A6')/Ontology/declare/prefix[string()=$prefix])">
83 <value-of select="$prefixed"/>
84 </when>
85 <otherwise>
86 <value-of select="document('../../data/ontologies/%C2%A6')/Ontology/declare/prefix[string()=$prefix]/following-sibling::namespace"/>
87 <value-of select="substring-after($prefixed, ':')"/>
88 </otherwise>
89 </choose>
90 </template>
91 <template match="*[namespace-uri()='']/@status" priority="2">
92 <element name="vocabstatus:term_status">
93 <attribute name="rdf:datatype">
94 <text>http://www.w3.org/2001/XMLSchema#string</text>
95 </attribute>
96 <value-of select="."/>
97 </element>
98 </template>
99 <template match="*[namespace-uri()='']/@name" priority="2">
100 <attribute name="rdf:about">
101 &unprefix;
102 </attribute>
103 </template>
104 <template match="*[namespace-uri()='']/@datatype" priority="2">
105 <attribute name="rdf:datatype">
106 &unprefix;
107 </attribute>
108 </template>
109 <template match="Ontology" priority="2">
110 <variable name="local-name">
111 <call-template name="Vocab:local-name"/>
112 </variable>
113 <element name="rdf:RDF">
114 <attribute name="书社:destination">
115 <choose>
116 <when test="$local-name=''">
117 <text>ontology</text>
118 </when>
119 <otherwise>
120 <value-of select="translate($local-name, ':', '¦')"/>
121 </otherwise>
122 </choose>
123 <text>.rdf</text>
124 </attribute>
125 <attribute name="xml:base">
126 <call-template name="Vocab:unprefix"/>
127 </attribute>
128 <!--
129 The ontology element is “manually” created by the parser in order to provide dynamic control over its name·spaces, as X·S·L·T provides no mechanism for creating name·space nodes.
130
131 (Technically, name·space nodes can be created with the `@namespace´ property on `<xslt:element>´, but the resulting prefix is, ⅌ the specification text, implementation‐specific.)
132 -->
133 <text disable-output-escaping="yes">&lt;owl:Ontology</text>
134 <for-each select="declare">
135 <text disable-output-escaping="yes"> xmlns</text>
136 <if test="string(prefix)!=''">
137 <text disable-output-escaping="yes">:</text>
138 </if>
139 <value-of select="prefix"/>
140 <text disable-output-escaping="yes">=&quot;</text>
141 <value-of select="namespace"/>
142 <text disable-output-escaping="yes">&quot;</text>
143 </for-each>
144 <text disable-output-escaping="yes"> rdf:about=&quot;</text>
145 <call-template name="Vocab:unprefix">
146 <with-param name="prefixed" select="$local-name"/>
147 </call-template>
148 <text disable-output-escaping="yes">&quot;&gt;</text>
149 &continue;
150 <text disable-output-escaping="yes">&lt;/owl:Ontology&gt;</text>
151 <书社:link xlink:href="about:shushe?include=classes/" xlink:show="embed"/>
152 <书社:link xlink:href="about:shushe?include=datatypes/" xlink:show="embed"/>
153 <书社:link xlink:href="about:shushe?include=annotation_properties/" xlink:show="embed"/>
154 <书社:link xlink:href="about:shushe?include=object_properties/" xlink:show="embed"/>
155 <书社:link xlink:href="about:shushe?include=datatype_properties/" xlink:show="embed"/>
156 <书社:link xlink:href="about:shushe?include=named_individuals/" xlink:show="embed"/>
157 </element>
158 </template>
159 <template match="SpecificResource" priority="2">
160 <choose>
161 <when test="@fragment">
162 <element name="anno:ResourceSelection">
163 <element name="anno:hasSource">
164 <attribute name="rdf:resource">
165 <if test="not(contains(@source, '/'))">
166 <text>about:vocab?individual=</text>
167 </if>
168 <value-of select="@source"/>
169 </attribute>
170 </element>
171 <element name="anno:hasSelector">
172 <element name="anno:FragmentSelector">
173 <element name="rdf:value">
174 <attribute name="rdf:datatype">
175 <text>http://www.w3.org/2001/XMLSchema#string</text>
176 </attribute>
177 <value-of select="@fragment"/>
178 </element>
179 <element name="dcterms:conformsTo">
180 <attribute name="rdf:resource">
181 <text>https://html.spec.whatwg.org/</text>
182 </attribute>
183 </element>
184 </element>
185 </element>
186 </element>
187 </when>
188 <otherwise>
189 <attribute name="rdf:resource">
190 <if test="not(contains(@source, '/'))">
191 <text>about:vocab?individual=</text>
192 </if>
193 <value-of select="@source"/>
194 </attribute>
195 </otherwise>
196 </choose>
197 </template>
198 <template match="cell" priority="2">
199 <choose>
200 <when test="parent::row[@role='label']">
201 <element name="html:th">
202 <attribute name="scope">
203 <text>col</text>
204 </attribute>
205 <apply-templates/>
206 </element>
207 </when>
208 <when test="@role='label'">
209 <element name="html:th">
210 <attribute name="scope">
211 <text>row</text>
212 </attribute>
213 <apply-templates/>
214 </element>
215 </when>
216 <otherwise>
217 <element name="html:td">
218 <apply-templates/>
219 </element>
220 </otherwise>
221 </choose>
222 </template>
223 <template match="item" priority="2">
224 <element name="html:li">
225 <apply-templates/>
226 </element>
227 </template>
228 <template match="list" priority="2">
229 <variable name="kind">
230 <choose>
231 <when test="rend='numbered'">
232 <text>ol</text>
233 </when>
234 <otherwise>
235 <text>ul</text>
236 </otherwise>
237 </choose>
238 </variable>
239 <element name="html:{$kind}">
240 <apply-templates/>
241 </element>
242 </template>
243 <template match="note" priority="2">
244 <element name="html:sup">
245 <element name="html:a">
246 <attribute name="href">
247 <text>#footnote-</text>
248 <value-of select="generate-id()"/>
249 </attribute>
250 <value-of select="@n"/>
251 </element>
252 </element>
253 </template>
254 <template match="table" priority="2">
255 <variable name="head" select="row[@role='label' and not(preceding-sibling::row[not(@role='label')])]"/>
256 <variable name="foot" select="row[@role='label' and not(following-sibling::row[not(@role='label')])]"/>
257 <element name="html:table">
258 <if test="$head">
259 <element name="html:thead">
260 <for-each select="$head">
261 <element name="html:tr">
262 <apply-templates/>
263 </element>
264 </for-each>
265 </element>
266 </if>
267 <element name="html:tbody">
268 <for-each select="row[not(@role='label') or preceding-sibling::row[not(@role='label')] and following-sibling::row[not(@role='label')]]">
269 <element name="html:tr">
270 <apply-templates/>
271 </element>
272 </for-each>
273 </element>
274 <if test="$foot">
275 <element name="html:tfoot">
276 <for-each select="$foot">
277 <element name="html:tr">
278 <apply-templates/>
279 </element>
280 </for-each>
281 </element>
282 </if>
283 </element>
284 </template>
285 <template match="ptr|ref" priority="2">
286 <element name="html:a">
287 <attribute name="href">
288 <call-template name="Vocab:unprefix">
289 <with-param name="prefixed" select="@target"/>
290 </call-template>
291 </attribute>
292 <if test="@type">
293 <attribute name="data-kind">
294 <value-of select="@type"/>
295 </attribute>
296 </if>
297 <choose>
298 <when test="self::ptr">
299 <element name="html:code">
300 <value-of select="@target"/>
301 </element>
302 </when>
303 <otherwise>
304 <apply-templates/>
305 </otherwise>
306 </choose>
307 </element>
308 </template>
309 <template match="resource" priority="2">
310 <choose>
311 <when test="ancestor::p">
312 <element name="html:code">
313 <variable name="prefixed">
314 <call-template name="Vocab:prefix">
315 <with-param name="unprefixed" select="string(@name)"/>
316 </call-template>
317 </variable>
318 <choose>
319 <when test="contains($prefixed, '/') or contains(substring-after($prefixed, ':'), ':')">
320 <text>&lt;</text>
321 <call-template name="Vocab:unprefix">
322 <with-param name="prefixed" select="string(@name)"/>
323 </call-template>
324 <text>&gt;</text>
325 </when>
326 <otherwise>
327 <value-of select="$prefixed"/>
328 </otherwise>
329 </choose>
330 </element>
331 </when>
332 <otherwise>
333 <for-each select="@name">
334 <attribute name="rdf:resource">
335 &unprefix;
336 </attribute>
337 </for-each>
338 </otherwise>
339 </choose>
340 </template>
341 <template match="value" priority="2">
342 <choose>
343 <when test="ancestor::p">
344 <element name="html:code">
345 <text>&quot;</text>
346 <apply-templates/>
347 <text>&quot;</text>
348 <choose>
349 <when test="@xml:lang">
350 <text>@</text>
351 <value-of select="@xml:lang"/>
352 </when>
353 <when test="@datatype">
354 <variable name="prefixed">
355 <call-template name="Vocab:prefix">
356 <with-param name="unprefixed" select="string(@datatype)"/>
357 </call-template>
358 </variable>
359 <if test="$prefixed!='xsd:string'">
360 <choose>
361 <when test="contains($prefixed, '/') or contains(substring-after($prefixed, ':'), ':')">
362 <text>&lt;</text>
363 <call-template name="Vocab:unprefix">
364 <with-param name="prefixed" select="string(@name)"/>
365 </call-template>
366 <text>&gt;</text>
367 </when>
368 <otherwise>
369 <value-of select="$prefixed"/>
370 </otherwise>
371 </choose>
372 </if>
373 </when>
374 </choose>
375 </element>
376 </when>
377 <otherwise>
378 &continue;
379 </otherwise>
380 </choose>
381 </template>
382 <template match="DatatypeProperty/@functional|ObjectProperty/@functional|ObjectProperty/@inverseFunctional|ObjectProperty/@reflexive|ObjectProperty/@irreflexive|ObjectProperty/@symmetric|ObjectProperty/@asymmetric|ObjectProperty/@transitive" priority="2"/>
383 <template match="@*[namespace-uri()='']" priority="1">
384 <message terminate="yes">
385 <text>Error: Unrecognized attribute in null namespace: @</text>
386 <value-of select="local-name()"/>
387 </message>
388 </template>
389 <template match="*[namespace-uri()='']" priority="1">
390 <variable name="spaced" select="concat(' ', local-name(), ' ')"/>
391 <variable name="qname">
392 <choose>
393 <when test="contains(' superClassOf ', $spaced)">
394 <text>Vocabvocab:</text>
395 </when>
396 <when test="contains(' code em p strong ', $spaced)">
397 <text>html:</text>
398 </when>
399 <when test="contains(' AllDifferent AllDisjointClasses AllDisjointProperties AnnotationProperty Class DatatypeProperty NamedIndividual NegativeObjectPropertyAssertion ObjectProperty Ontology Restriction allValuesFrom assertionProperty cardinality complementOf differentFrom disjointUnionOf disjointWith equivalentClass equivalentProperty hasKey hasSelf hasValue intersectionOf inverseOf maxCardinality maxQualifiedCardinality members minCardinality minQualifiedCardinality onClass onDataRange onDatatype onProperty oneOf propertyChainAxiom propertyDisjointWith qualifiedCardinality sameAs someValuesFrom sourceIndividual targetIndividual unionOf withRestrictions ', $spaced)">
400 <text>owl:</text>
401 </when>
402 <when test="contains(' type ', $spaced)">
403 <text>rdf:</text>
404 </when>
405 <when test="contains(' Datatype comment domain isDefinedBy label range subClassOf subPropertyOf ', $spaced)">
406 <text>rdfs:</text>
407 </when>
408 <when test="contains(' declare namespace prefix ', $spaced)">
409 <text>shacl:</text>
410 </when>
411 <when test="contains(' inScheme ', $spaced)">
412 <text>skos:</text>
413 </when>
414 <otherwise>
415 <message terminate="yes">
416 <text>Error: Unrecognized element in null namespace: &lt;</text>
417 <value-of select="local-name()"/>
418 <text>&gt;</text>
419 </message>
420 </otherwise>
421 </choose>
422 <value-of select="local-name()"/>
423 </variable>
424 <element name="{$qname}">
425 <variable name="iri">
426 <choose>
427 <when test="@name">
428 <for-each select="@name">
429 &unprefix;
430 </for-each>
431 </when>
432 <when test="not(parent::*)">
433 <call-template name="Vocab:unprefix">
434 <with-param name="prefixed">
435 <call-template name="Vocab:local-name"/>
436 </with-param>
437 </call-template>
438 </when>
439 </choose>
440 </variable>
441 <if test="not(@name) and not(parent::*)">
442 <attribute name="rdf:about">
443 <value-of select="$iri"/>
444 </attribute>
445 </if>
446 <choose>
447 <when test="contains(' comment ', $spaced)">
448 <attribute name="rdf:parseType">
449 <text>Literal</text>
450 </attribute>
451 <element name="html:div">
452 &continue;
453 <if test=".//note">
454 <element name="html:footer">
455 <element name="html:h5">
456 <attribute name="lang">
457 <text>en</text>
458 </attribute>
459 <attribute name="xml:lang">
460 <text>en</text>
461 </attribute>
462 <text>Footnotes</text>
463 </element>
464 <for-each select=".//note">
465 <element name="html:div">
466 <attribute name="id">
467 <text>footnote-</text>
468 <value-of select="generate-id()"/>
469 </attribute>
470 <element name="html:p">
471 <apply-templates select="p[1]/@*"/>
472 <element name="html:strong">
473 <value-of select="@n"/>
474 <text>.</text>
475 </element>
476 <text> </text>
477 <apply-templates select="p[1]/node()"/>
478 </element>
479 <apply-templates select="p[1]/following-sibling::p"/>
480 </element>
481 </for-each>
482 </element>
483 </if>
484 </element>
485 </when>
486 <when test="contains(' disjointUnionOf hasKey intersectionOf members oneOf propertyChainAxiom unionOf withRestrictions ', $spaced)">
487 <attribute name="rdf:parseType">
488 <text>Collection</text>
489 </attribute>
490 <apply-templates select="@*"/>
491 <for-each select="node()">
492 <choose>
493 <when test="self::resource">
494 <element name="rdf:Description">
495 <attribute name="rdf:about">
496 <for-each select="@name">
497 &unprefix;
498 </for-each>
499 </attribute>
500 </element>
501 </when>
502 <when test="self::langRange or self::length or self::maxExclusive or self::maxInclusive or self::maxLength or self::minExclusive or self::minInclusive or self::minLength or self::pattern">
503 <variable name="ns">
504 <choose>
505 <when test="self::langRange">
506 <text>rdf</text>
507 </when>
508 <otherwise>
509 <text>xsd</text>
510 </otherwise>
511 </choose>
512 </variable>
513 <element name="rdf:Description">
514 <element name="{$ns}:{local-name()}">
515 <attribute name="rdf:datatype">
516 <choose>
517 <when test="self::length or self::minLength or self::maxLength">
518 <text>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</text>
519 </when>
520 <when test="self::langRange or self::pattern">
521 <text>http://www.w3.org/2001/XMLSchema#string</text>
522 </when>
523 <otherwise>
524 <call-template name="unprefix">
525 <with-param name="prefixed" select="@datatype"/>
526 </call-template>
527 </otherwise>
528 </choose>
529 </attribute>
530 <value-of select="."/>
531 </element>
532 </element>
533 </when>
534 <otherwise>
535 <apply-templates select="."/>
536 </otherwise>
537 </choose>
538 </for-each>
539 </when>
540 <when test="contains(' hasSelf ', $spaced)">
541 <attribute name="rdf:datatype">
542 <text>http://www.w3.org/2001/XMLSchema#boolean</text>
543 </attribute>
544 <text>true</text>
545 </when>
546 <otherwise>
547 <if test="contains(' namespace ', $spaced)">
548 <attribute name="rdf:datatype">
549 <text>http://www.w3.org/2001/XMLSchema#anyURI</text>
550 </attribute>
551 </if>
552 <if test="contains(' cardinality maxCardinality maxQualifiedCardinality minCardinality minQualifiedCardinality qualifiedCardinality ', $spaced)">
553 <attribute name="rdf:datatype">
554 <text>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</text>
555 </attribute>
556 </if>
557 <if test="contains(' prefix ', $spaced)">
558 <attribute name="rdf:datatype">
559 <text>http://www.w3.org/2001/XMLSchema#string</text>
560 </attribute>
561 </if>
562 <if test="contains(' declare ', $spaced)">
563 <attribute name="rdf:parseType">
564 <text>Resource</text>
565 </attribute>
566 </if>
567 <choose>
568 <when test="starts-with($qname, 'html:')">
569 <apply-templates/>
570 </when>
571 <otherwise>
572 &continue;
573 </otherwise>
574 </choose>
575 <if test="contains(' DatatypeProperty ObjectProperty ', $spaced)">
576 <if test="@functional='yes'">
577 <element name="rdf:type">
578 <attribute name="rdf:resource">
579 <text>http://www.w3.org/2002/07/owl#FunctionalProperty</text>
580 </attribute>
581 </element>
582 </if>
583 </if>
584 <if test="contains(' ObjectProperty ', $spaced)">
585 <if test="@inverseFunctional='yes'">
586 <element name="rdf:type">
587 <attribute name="rdf:resource">
588 <text>http://www.w3.org/2002/07/owl#InverseFunctionalProperty</text>
589 </attribute>
590 </element>
591 </if>
592 <if test="@reflexive='yes'">
593 <element name="rdf:type">
594 <attribute name="rdf:resource">
595 <text>http://www.w3.org/2002/07/owl#ReflexiveProperty</text>
596 </attribute>
597 </element>
598 </if>
599 <if test="@irreflexive='yes'">
600 <element name="rdf:type">
601 <attribute name="rdf:resource">
602 <text>http://www.w3.org/2002/07/owl#IrreflexiveProperty</text>
603 </attribute>
604 </element>
605 </if>
606 <if test="@symmetric='yes'">
607 <element name="rdf:type">
608 <attribute name="rdf:resource">
609 <text>http://www.w3.org/2002/07/owl#SymmetricProperty</text>
610 </attribute>
611 </element>
612 </if>
613 <if test="@asymmetric='yes'">
614 <element name="rdf:type">
615 <attribute name="rdf:resource">
616 <text>http://www.w3.org/2002/07/owl#AsymmetricProperty</text>
617 </attribute>
618 </element>
619 </if>
620 <if test="@transitive='yes'">
621 <element name="rdf:type">
622 <attribute name="rdf:resource">
623 <text>http://www.w3.org/2002/07/owl#TransitiveProperty</text>
624 </attribute>
625 </element>
626 </if>
627 </if>
628 </otherwise>
629 </choose>
630 <if test="not(parent::*)">
631 <variable name="base">
632 <call-template name="Vocab:unprefix"/>
633 </variable>
634 <variable name="curie">
635 <call-template name="Vocab:prefix">
636 <with-param name="unprefixed" select="$iri"/>
637 </call-template>
638 </variable>
639 <variable name="shortname">
640 <choose>
641 <when test="string($curie)!='' and not(contains($curie, '/'))">
642 <value-of select="$curie"/>
643 </when>
644 <otherwise>
645 <call-template name="Vocab:local-name"/>
646 </otherwise>
647 </choose>
648 </variable>
649 <variable name="localid">
650 <choose>
651 <when test="$shortname=':' or $shortname=''">
652 <text>index</text>
653 </when>
654 <when test="starts-with($shortname, ':')">
655 <value-of select="substring-after($shortname, ':')"/>
656 </when>
657 <otherwise>
658 <value-of select="$shortname"/>
659 </otherwise>
660 </choose>
661 </variable>
662 <element name="rdfs:isDefinedBy">
663 <attribute name="rdf:resource">
664 <value-of select="$base"/>
665 <choose>
666 <when test="contains(' Class Datatype ', $spaced)">
667 <text>classes/</text>
668 </when>
669 <when test="contains(' AnnotationProperty DatatypeProperty ObjectProperty ', $spaced)">
670 <text>properties/</text>
671 </when>
672 <otherwise>
673 <text>individuals/</text>
674 </otherwise>
675 </choose>
676 <value-of select="$localid"/>
677 <text>.xhtml</text>
678 </attribute>
679 </element>
680 <if test="self::NamedIndividual and substring($shortname, 1, 1)='(' and substring($shortname, string-length($shortname), 1)=')'">
681 <element name="owl:sameAs">
682 <attribute name="rdf:resource">
683 <value-of select="$base"/>
684 <value-of select="$localid"/>
685 </attribute>
686 </element>
687 </if>
688 </if>
689 </element>
690 </template>
691 <template match="text()[ancestor::cell or ancestor::p]" priority="1">
692 <variable name="normalized" select="normalize-space()"/>
693 <if test="$normalized!=''">
694 <if test="preceding-sibling::* and normalize-space(substring(., 1, 1))=''">
695 <text> </text>
696 </if>
697 <value-of select="$normalized"/>
698 <if test="following-sibling::* and normalize-space(substring(., string-length(), 1))=''">
699 <text> </text>
700 </if>
701 </if>
702 </template>
703 <template match="text()[not(ancestor::cell or ancestor::p) and normalize-space()='']" priority="1"/>
704 </transform>
This page took 0.183446 seconds and 5 git commands to generate.