﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"                      
           xmlns:sobek="http://sobekrepository.org/schemas/sobekcm_lom"
           targetNamespace="http://sobekrepository.org/schemas/sobekcm_lom" 
           version="1.0">
  <xs:annotation>
    <xs:documentation xml:lang="en">
      Schema defines the subset of IEEE-LOM, LOM-NL which will be used initially by the
      SobekCM digital repository system as an extension schema in the METS.  Not included are
      all the fields which are already present in the MODS/DC/MARC, such as title, author,
      keywords, related items, etc..
      Developer: Mark Sullivan (Mark.V.Sullivan@gmail.com)
      Creation Date: 03/24/2013
    </xs:documentation>
  </xs:annotation>
  <xs:element name="lom">
    <xs:complexType>
      <xs:sequence>
        <!-- (1) This category groups the general information that describes this learning object as a whole -->
        <xs:element name="general" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <!-- (1.8) The functional granularity of this learning object [1,2,3,4] -->
              <xs:element name="aggregationlevel" type="sobek:aggregationLevelEnumeration" minOccurs="0" maxOccurs="1" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>

        <!-- (2) This category describes the history and current state of this learning object and thoses entities that have affected this learning object during it evolution -->
        <xs:element name="lifecycle" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <!-- (2.2) The completion status or condition of this learning object [ draft, final, revised, unavailable ] -->
              <!--       (Simplified: documentation claims vocabularyStateType, but appears that it really is an enum?) -->
              <xs:element name="status" type="sobek:statusEnumeration" minOccurs="0" maxOccurs="1" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        
        <!-- (4) This category describes the technical requirements and characteristics of this learning object -->
        <xs:element name="technical" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <!-- (4.4) The technical capabilities necessary for using this learning object -->
              <xs:element name="requirement" minOccurs="0" maxOccurs="unbounded" >
                <xs:complexType>
                  <xs:sequence>
                    <!-- (4.4.1) Grouping of multiple requirements.  When one composite is satisfied, all are.  i.e., the logical connector is OR -->
                    <xs:element name="orcomposite" minOccurs="1" maxOccurs="unbounded" >
                      <xs:complexType>
                        <xs:sequence>
                          <!-- (4.4.1.1) The technology type required to use this learning object [ operating system, browser, hardware, or software ] -->
                          <!--           (Simplified: documentation claims vocabularyStateType, but appears that it really is an enum?) -->
                          <xs:element name="type" type="sobek:requirementTypeEnumeration" minOccurs="1" maxOccurs="1" />
                          
                          <!-- (4.4.1.2) Name of the rqeuired technology to use this learning object -->
                          <xs:element name="name" type="sobek:vocabularyStateType" minOccurs="1" maxOccurs="1" />
                          
                          <!-- (4.4.1.3) Lowest possible version of the required technology to use this learning object -->
                          <xs:element name="minimumversion" type="xs:string" minOccurs="0" maxOccurs="1" />

                          <!-- (4.4.1.4) Highest possible version of the required technology to use this learning object -->
                          <xs:element name="maximumversion" type="xs:string" minOccurs="0" maxOccurs="1" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        
        <!-- (5) This category descibes the key educational or pedagogic characteristics of this learning object -->
        <!-- (Artificially restricting to one instance.. don't really understand the use of multiples here) -->
        <xs:element name="educational" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <!-- (5.1) Predominant mode of learning supported by this learning object [ active, expositive, mixed ] -->
              <xs:element name="interactivitytype" type="sobek:interactivityTypeEnumeration" minOccurs="0" maxOccurs="1" />
              
              <!-- (5.2) Specific kind of learning object.  The most dominant kind should be first -->
              <xs:element name="learningresourcetype" type="sobek:vocabularyStateType" minOccurs="0" maxOccurs="unbounded" />

              <!-- (5.3) Degree of interactivity characterizing this learning object.  Refers to degree to which  -->
              <!-- the learner can influence the aspect or behavior of the learning object. [ very low, low, medium, high, very high ] -->
              <xs:element name="interactivitylevel" type="sobek:interactivityLevelEnumeration" minOccurs="0" maxOccurs="1" />
              
              <!-- (5.5) Principal user(s) for which this learning object was designed, most dominant first [ teacher, author, learner, manager ] -->
              <!--       (Simplified: documentation claims vocabularyStateType, but appears that it really is an enum?) -->
              <xs:element name="intendedenduserrole" type="sobek:intendedendUserRoleEnumeration" minOccurs="0" maxOccurs="unbounded" />

              <!-- (5.6) Principal environment within which the learning and use of the learning object is intended to take place -->
              <xs:element name="context" type="sobek:vocabularyStateType" minOccurs="0" maxOccurs="unbounded" />
             
              <!-- (5.7) Age (range) of the typical intended user -->
              <xs:element name="typicalagerange" type="sobek:langStringType" minOccurs="0" maxOccurs="unbounded" />

              <!-- (5.8) How hard it is to work with or through this learning object for the typical intended target audience [ very easy, easy, medium, hard, very hard ] -->
              <xs:element name="difficulty" type="sobek:difficultyEnumeration" minOccurs="0" maxOccurs="1" />
              
              <!-- (5.9) Approximate or typical time it takes to work with or through this learning object for the typical intended audience -->
              <xs:element name="typicallearningtime" minOccurs="0" maxOccurs="1" >
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="duration" type="xs:duration" minOccurs="1" maxOccurs="1" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>            
          </xs:complexType>
        </xs:element>

        <!-- (9) This category describes where this learning object falls within a particular classification schema -->
        <!-- To define multiple classifications, there may be multiple instances of this category -->
        <xs:element name="classification" minOccurs="0" maxOccurs="unbounded" >
          <xs:complexType>
            <xs:sequence>
              <!-- (9.1) The purpose of classifying this learning object (i.e., discipline, idea, educational objective, skill level, etc..) -->
              <xs:element name="purpose" type="sobek:vocabularyStateType" minOccurs="0" maxOccurs="1" />
              
              <!-- (9.2) A taxonomic path in a specific classification system.  Each succeeding level is a refinement of the preceeding level -->
              <xs:element name="taxonpath" minOccurs="1" maxOccurs="unbounded" >
                <xs:complexType>
                  <xs:sequence>
                    
                    <!-- (9.2.1) The name of the classification system -->
                    <xs:element name="source" type="sobek:langStringType" minOccurs="1" maxOccurs="1" />

                    <!-- (9.2.2) Particular term within a taxonomy.  A node that has a defined label or term -->
                    <xs:element name="taxon" minOccurs="1" maxOccurs="unbounded" >
                      <xs:complexType>
                        <xs:sequence>
                          
                          <!-- (9.2.2.1) Identifier of the taxon, such as a number or letter combination provided by the source of the taxonomy -->
                          <xs:element name="id" type="xs:string" minOccurs="0" maxOccurs="1" />
                          
                          <!-- (9.2.2.2) Textual label of the taxon (note: langStringType allows multiple languages to be present) -->
                          <xs:element name="entry" type="sobek:langStringType" minOccurs="0" maxOccurs="1" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>


  <!-- Enumeration for the aggregation level type under general ( 1.8 ) -->
  <xs:simpleType name="aggregationLevelEnumeration">
    <xs:restriction base="xs:integer">
      <xs:enumeration value="1" />
      <xs:enumeration value="2" />
      <xs:enumeration value="3" />
      <xs:enumeration value="4" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Enumeration for the status under lifecycle ( 2.2 ) -->
  <xs:simpleType name="statusEnumeration">
    <xs:restriction base="xs:string">
      <xs:enumeration value="draft" />
      <xs:enumeration value="final" />
      <xs:enumeration value="revised" />
      <xs:enumeration value="unavailable" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Enumeration for the type of requirements ( 4.4.1.1 ) -->
  <xs:simpleType name="requirementTypeEnumeration">
    <xs:restriction base="xs:string">      
      <xs:enumeration value="browser" />
      <xs:enumeration value="operating system" />
      <xs:enumeration value="hardware" />
      <xs:enumeration value="software" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Enumeration for the interactivity type ( 5.1 ) -->
  <xs:simpleType name="interactivityTypeEnumeration">
    <xs:restriction base="xs:string">
      <xs:enumeration value="active" />
      <xs:enumeration value="expositive" />
      <xs:enumeration value="mixed" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Enumeration for the interactivity level ( 5.3 ) -->
  <xs:simpleType name="interactivityLevelEnumeration">
    <xs:restriction base="xs:string">
      <xs:enumeration value="very low" />
      <xs:enumeration value="low" />
      <xs:enumeration value="medium" />
      <xs:enumeration value="high" />
      <xs:enumeration value="very high" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Enumeration for the intended end user role ( 5.5 ) -->
  <xs:simpleType name="intendedendUserRoleEnumeration">
    <xs:restriction base="xs:string">
      <xs:enumeration value="teacher" />
      <xs:enumeration value="author" />
      <xs:enumeration value="learner" />
      <xs:enumeration value="manager" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Enumeration for the difficulty ( 5.8 ) -->
  <xs:simpleType name="difficultyEnumeration">
    <xs:restriction base="xs:string">
      <xs:enumeration value="very easy" />
      <xs:enumeration value="easy" />
      <xs:enumeration value="medium" />
      <xs:enumeration value="difficult" />
      <xs:enumeration value="very difficult" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Type used several places throughout the schema when a string and source are required -->
  <xs:complexType name="vocabularyStateType">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="source" type="xs:string" use="optional" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

  <!-- Type used several places throughout the schema when a language needs to be associated with a string -->
  <xs:complexType name="langStringType">
    <xs:sequence>
      <!-- Within a collection of language strings, there must be at least one.  Otherwise the parent type -->
      <!-- should be left out completely  -->
      <xs:element name="langstring" minOccurs="1" maxOccurs="unbounded">
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:string">
              <xs:attribute name="lang" type="xs:string" use="optional" />
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>


</xs:schema>