]> Lady’s Gitweb - Vocab/blobdiff - transforms/infer.xslt
Support disjoint unions; improve modelling somewhat
[Vocab] / transforms / infer.xslt
index c37f339ab80520dfedea887ed26a8d03954a90f2..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: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"/>
@@ -97,11 +98,24 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                                                        <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>
+                               <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)/*">
-                                       <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>
@@ -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>
+                       <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>
This page took 0.243315 seconds and 4 git commands to generate.