]> Lady’s Gitweb - Vocab/blob - transforms/shared.xslt
Drop foaf:weblog
[Vocab] / transforms / shared.xslt
1 <?xml version="1.0"?>
2 <!--
3 SPDX-FileCopyrightText: 2024, 2025 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: MPL-2.0
5 -->
6 <!--
7 © 2024–2025 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
13 <transform
14 xmlns="http://www.w3.org/1999/XSL/Transform"
15 xmlns:Vocab="urn:fdc:vocab.ladys.computer:20240731:ns"
16 xmlns:owl="http://www.w3.org/2002/07/owl#"
17 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
18 xmlns:shacl="http://www.w3.org/ns/shacl#"
19 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
20 exclude-result-prefixes="Vocab"
21 version="1.0"
22 >
23 <书社:id>urn:fdc:vocab.ladys.computer:20240731:transforms:shared.xslt</书社:id>
24 <template name="Vocab:base">
25 <value-of select="//rdf:RDF//owl:Ontology/shacl:declare/shacl:namespace[preceding-sibling::shacl:prefix='']"/>
26 </template>
27 <template name="Vocab:prefix">
28 <param name="unprefixed" select="''"/>
29 <variable name="namespace" select="//rdf:RDF//owl:Ontology/shacl:declare/shacl:namespace[starts-with($unprefixed, string()) and string(preceding-sibling::shacl:prefix)!=''][1]"/>
30 <choose>
31 <when test="not($namespace)">
32 <value-of select="$unprefixed"/>
33 </when>
34 <otherwise>
35 <value-of select="$namespace/preceding-sibling::shacl:prefix"/>
36 <text>:</text>
37 <value-of select="substring-after($unprefixed, $namespace)"/>
38 </otherwise>
39 </choose>
40 </template>
41 </transform>
This page took 0.061859 seconds and 5 git commands to generate.