]> Lady’s Gitweb - Vocab/blobdiff - transforms/infer.xslt
Make pcdm:File a siocactions:DigitalArtifact
[Vocab] / transforms / infer.xslt
index 056e57a7d8b0b4d8ec52dfc1da5c5f0787f1bcb7..9d12e2151ec5a5bac3201b27822ad4e8874ca267 100644 (file)
@@ -30,6 +30,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        <key name="Vocab:inverse-class" match="owl:Class|rdfs:Datatype" use="owl:complementOf/@rdf:resource"/>
        <key name="Vocab:inverse-property" match="owl:DatatypeProperty|owl:ObjectProperty" use="owl:inverseOf/@rdf:resource"/>
        <key name="Vocab:disjoint-class" match="owl:Class|rdfs:Datatype" use="owl:disjointWith/@rdf:resource"/>
        <key name="Vocab:inverse-class" match="owl:Class|rdfs:Datatype" use="owl:complementOf/@rdf:resource"/>
        <key name="Vocab:inverse-property" match="owl:DatatypeProperty|owl:ObjectProperty" use="owl:inverseOf/@rdf:resource"/>
        <key name="Vocab:disjoint-class" match="owl:Class|rdfs:Datatype" use="owl:disjointWith/@rdf:resource"/>
+       <key name="Vocab:disjoint-class-union" match="owl:Class" use="owl:disjointUnionOf/rdf:Description/@rdf:about"/>
        <key name="Vocab:disjoint-property" match="owl:DatatypeProperty|owl:ObjectProperty" use="owl:propertyDisjointWith/@rdf:resource"/>
        <exslfunc:function name="Vocab:get-equivalents">
                <param name="resource-nodes"/>
        <key name="Vocab:disjoint-property" match="owl:DatatypeProperty|owl:ObjectProperty" use="owl:propertyDisjointWith/@rdf:resource"/>
        <exslfunc:function name="Vocab:get-equivalents">
                <param name="resource-nodes"/>
@@ -92,16 +93,29 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                        <with-param name="source" select="$source"/>
                                                                </apply-templates>
                                                        </for-each>
                                                                        <with-param name="source" select="$source"/>
                                                                </apply-templates>
                                                        </for-each>
-                                                       <for-each select="key($relationship-key, $source)">
+                                                       <for-each select="key($relationship-key, $source)[@rdf:about]">
                                                                <apply-templates select="." mode="Vocab:format-get">
                                                                        <with-param name="source" select="string(@rdf:about)"/>
                                                                </apply-templates>
                                                        </for-each>
                                                                <apply-templates select="." mode="Vocab:format-get">
                                                                        <with-param name="source" select="string(@rdf:about)"/>
                                                                </apply-templates>
                                                        </for-each>
+                                                       <if test="$relationship-names/Vocab:in-union">
+                                                               <for-each select="key(concat($relationship-key, '-union'), $source)">
+                                                                       <apply-templates select="*[local-name()=$relationship-names/Vocab:in-union/Vocab:local-name and namespace-uri()=$relationship-names/Vocab:in-union/Vocab:namespace]/*" mode="Vocab:format-get">
+                                                                               <with-param name="source" select="string(@rdf:about)"/>
+                                                                       </apply-templates>
+                                                               </for-each>
+                                                       </if>
                                                </for-each>
                                        </for-each>
                                </variable>
                                                </for-each>
                                        </for-each>
                                </variable>
+                               <variable name="filter-fragment">
+                                       <copy-of select="$exclude"/>
+                                       <if test="not($include-self)">
+                                               <copy-of select="$equivalents"/>
+                                       </if>
+                               </variable>
                                <for-each select="exsl:node-set($unfiltered-result-fragment)/*">
                                <for-each select="exsl:node-set($unfiltered-result-fragment)/*">
-                                       <copy-of select="self::*[not(@rdf:about and ($exclude|preceding-sibling::*)/@rdf:about[string()=string(current()/@rdf:about)])]"/>
+                                       <copy-of select="self::*[not(@rdf:about and (exsl:node-set($filter-fragment)/*|preceding-sibling::*)/@rdf:about[string()=string(current()/@rdf:about)])]"/>
                                </for-each>
                        </if>
                </variable>
                                </for-each>
                        </if>
                </variable>
@@ -152,6 +166,16 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                        </otherwise>
                                </choose>
                        </element>
                                        </otherwise>
                                </choose>
                        </element>
+                       <if test="$relationship='disjoint' and $kind='class'">
+                               <element name="Vocab:in-union">
+                                       <element name="Vocab:local-name">
+                                               <text>disjointUnionOf</text>
+                                       </element>
+                                       <element name="Vocab:namespace">
+                                               <text>http://www.w3.org/2002/07/owl#</text>
+                                       </element>
+                               </element>
+                       </if>
                </variable>
                <exslfunc:result select="exsl:node-set($result-fragment)"/>
        </exslfunc:function>
                </variable>
                <exslfunc:result select="exsl:node-set($result-fragment)"/>
        </exslfunc:function>
@@ -175,7 +199,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                <with-param name="source" select="$source"/>
                                                        </apply-templates>
                                                </for-each>
                                                                <with-param name="source" select="$source"/>
                                                        </apply-templates>
                                                </for-each>
-                                               <for-each select="key(concat('Vocab:equivalent-', $kind), $source)">
+                                               <for-each select="key(concat('Vocab:equivalent-', $kind), $source)[@rdf:about]">
                                                        <apply-templates select="." mode="Vocab:format-get">
                                                                <with-param name="source" select="string(@rdf:about)"/>
                                                        </apply-templates>
                                                        <apply-templates select="." mode="Vocab:format-get">
                                                                <with-param name="source" select="string(@rdf:about)"/>
                                                        </apply-templates>
@@ -276,6 +300,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                </element>
                        </when>
                        <otherwise>
                                </element>
                        </when>
                        <otherwise>
+                               <!-- assume this is a property (like `owl:inverseOf´), not an instance (like `owl:ObjectProperty´); in this case, the members are what is desired -->
                                <for-each select="*">
                                        <copy>
                                                <copy-of select="@*|node()"/>
                                <for-each select="*">
                                        <copy>
                                                <copy-of select="@*|node()"/>
This page took 0.211137 seconds and 4 git commands to generate.