<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : NSI-schema.xsd
    Created on : 3 August 2006, 19:11
    revision   : 6 September 2006, 11:56
    Author     : Yusri Bong, TU-Dresden 
    Description:
        Proposal of DIG 2.0 NSI (Non-Standard Inferences) XML Schema definition.
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace='http://dl.kr.org/dig/lang/NSI'
            xmlns='http://dl.kr.org/dig/lang/NSI'
            xmlns:lang='http://dl.kr.org/dig/lang/schema'
            xmlns:ask='http://dl.kr.org/dig/lang/asks-schema'
            elementFormDefault="qualified">
                
    <!-- IMPORTS -->            
    <xsd:import namespace="http://dl.kr.org/dig/lang/schema" 
        schemaLocation="http://homepages.cs.manchester.ac.uk/~seanb/dig/schema.xsd"/>            

    <xsd:import namespace="http://dl.kr.org/dig/lang/asks-schema" 
        schemaLocation="http://www.informatik.uni-ulm.de/ki/Weithoener/dig/asks.xsd"/>            
    <!-- END OF IMPORTS -->            
            
    <!-- GROUPS -->            
    <xsd:group name="conceptPattern">
        <xsd:annotation>
        <xsd:documentation> Everything that can be considered as a concept pattern</xsd:documentation>
        </xsd:annotation>
        <xsd:choice>
            <xsd:element ref="lang:class">
                <xsd:annotation>
                <xsd:documentation> Every class name is a concept pattern </xsd:documentation>
                </xsd:annotation>
            </xsd:element>    
            <xsd:element name="variable" type="lang:named">
                <xsd:annotation>
                <xsd:documentation> Every variable is a concept pattern </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="complementOf">
                <xsd:annotation>
                <xsd:documentation> A complement of a class name or variable is a concept pattern</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:choice>
                        <xsd:element ref="lang:class"/>
                        <xsd:element name="variable" type="lang:named"/>
                    </xsd:choice>
                </xsd:complexType>
            </xsd:element> 
            <xsd:element name="intersectionOf">
                <xsd:annotation>
                <xsd:documentation> An intersection of concept patterns is a concept pattern</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:group ref="conceptPattern" minOccurs="1" maxOccurs="unbounded"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

            <xsd:element name="someValuesFrom">
                <xsd:annotation>
                <xsd:documentation> \exists r.C where r is an object property and C is a concept pattern is a concept pattern</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element ref="lang:objectProperty"/>
                        <xsd:group ref="conceptPattern"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="allValuesFrom">
                <xsd:annotation>
                <xsd:documentation> \forall r.C where r is an object property and C is a concept pattern is a concept pattern</xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element ref="lang:objectProperty"/>
                        <xsd:group ref="conceptPattern"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:choice>
    </xsd:group>

    <xsd:group name="nsiQueries">
        <xsd:choice>
            <xsd:element name="approximation" type="basicTargetDLClassAsk">
                <xsd:annotation>
                <xsd:documentation>Intuitively, the approximation of a concept description written in a DL L1 is a translation into a typically less expressive DL L2 with a minimal loss of information; There is an implementation of computing ALEN-approximations of ALCN-concept descriptions.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>

            <xsd:element name="findMatcher" type="findAssignmentsAsk">
                <xsd:annotation>
                <xsd:documentation>This operation has two parameters: a concept description and a concept pattern; Roughly speaking, a concept pattern is a concept description where variables can appear at the places where concept names can appear in usual concept descriptions; Matching of a concept description C and a concept pattern D answers the question whether and how the variables in the concept pattern D can be assigned to concept descriptions such that a concept description is obtained that is equivalent with respect to a knowledge base to the concept description C. </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="findMatchingConcepts" type="findAssignableConceptsAsk"/>
            <xsd:element name="lcs" type="basicTargetDLClassSequenceAsk">
                <xsd:annotation>
                <xsd:documentation>The Least Common Subsumer (LCS) of a set of concept descriptions is a concept description that subsumes all input concepts and is the least one with respect to subsumption to do so; The most expressive DL for which the LCS inference is currently available is ALEN.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="gcs" type="basicTargetDLClassSequenceAsk">
                <xsd:annotation>
                <xsd:documentation>The Good Common Subsumer (GCS) of a set of concept descriptions is a concept description that subsumes all input concepts, but need not to be the least one with respect to subsumption; Furthermore, the implementation performs the computation with respect to a background terminology approach; This approach supports a (usually expressive) background terminology that is extended by the (usually not so expressive) user terminology; The most expressive DL for which the GCS is available is ALE user terminology with respect to an ALC background terminology.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="minimalRewriting" type="ask:basicClassAsk">
                <xsd:annotation>
                <xsd:documentation>The minimal rewriting of a concept description C1 with respect to a terminology is a concept description C2, which is equivalent to C1 and of minimal size; Usually the minimal rewriting is obtained by replacing sub-concept descriptions by concept names form the terminology; In our implementation we realized a heuristic for minimal rewriting that returns a small, but not necessary the smallest rewriting for ALE concept descriptions.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:choice>
    </xsd:group>
    <!-- END OF GROUPS -->            
    
    <!-- ELEMENTS -->            
    <xsd:element name="asks">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:group ref="nsiQueries" minOccurs="1" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute name="machineName" type="xsd:string" use="optional" default="localhost">
                <xsd:annotation>
                <xsd:documentation>The machine name (IP address) where the DL-standard reasoner is running.</xsd:documentation>
                </xsd:annotation>
            </xsd:attribute>
            <xsd:attribute name="port" type="xsd:int" use="required">
                <xsd:annotation>
                <xsd:documentation>The port where the DL-standard reasoner DIG 2.0 server is running.</xsd:documentation>
                </xsd:annotation>
            </xsd:attribute>
            <xsd:attribute name="kb" type="xsd:string" use="required">
                <xsd:annotation>
                <xsd:documentation>The knowledge base name where the TBox and ABox is stored.</xsd:documentation>
                </xsd:annotation>
            </xsd:attribute>
        </xsd:complexType>
    </xsd:element>
    
    <xsd:element name='assignments' type='basicAssignmentsResponse'/>


    <!-- END OF ELEMENTS -->            

    <!-- TYPES -->            
    <xsd:complexType name="basicTargetDLClassAsk">
        <xsd:complexContent>
            <xsd:extension base="ask:basicClassAsk">
                <xsd:attribute name="targetDL" type="xsd:string" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="basicTargetDLClassSequenceAsk">
        <xsd:complexContent>
            <xsd:extension base="ask:basicAsk">
             <xsd:sequence>
                <xsd:group ref="lang:description" minOccurs="2" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:attribute name="targetDL" type="xsd:string" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="conceptPattern">
        <xsd:group ref="conceptPattern"/>
    </xsd:complexType>
    
    <xsd:complexType name="findAssignmentsAsk">
        <xsd:complexContent>
            <xsd:extension base="ask:basicAsk">
                <xsd:sequence>
                    <xsd:group ref='lang:description'/>
                    <xsd:group ref='conceptPattern'/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="findAssignableConceptsAsk">
        <xsd:complexContent>
            <xsd:extension base="ask:basicAsk">
                <xsd:group ref='conceptPattern'/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name='basicAssignmentsResponse'>
       <xsd:sequence>
          <xsd:element name='assignment' type='basicAssignment' minOccurs="0" maxOccurs="unbounded"/>
       </xsd:sequence>
       <xsd:attributeGroup ref="ask:basicAskAttributes"/>
    </xsd:complexType>

    <xsd:complexType name='basicAssignment'>
        <xsd:sequence>
            <xsd:element name="variable" type="lang:named"/>
            <xsd:group ref='lang:description'/>
        </xsd:sequence>
    </xsd:complexType>

    <!-- END OF TYPES -->            

    
</xsd:schema>

