<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" version="1.0" 
  xmlns:tns="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" 
  xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:xlink="http://www.w3.org/1999/xlink" elementFormDefault="qualified">

<!--

	S-RAMP Version 1.0
	Committee Specification Draft 01
	20 March 2013
	Source: http://docs.oasis-open.org/s-ramp/s-ramp/v1.0/csd01/schemas/
       
  Copyright (c) OASIS Open 2013. All rights reserved.
      
  Portions may also be Copyright © 2010 Hewlett-Packard Company (HP),
  International Business Machines Corporation (IBM), Software AG (SAG)
  and TIBCO Software Inc.
       
All capitalized terms in the following text have the meanings assigned to them in the OASIS Intellectual Property Rights Policy (the "OASIS IPR Policy"). The full Policy may be found at the OASIS website.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to OASIS, except as needed for the purpose of developing any document or deliverable produced by an OASIS Technical Committee (in which case the rules applicable to copyrights, as set forth in the OASIS IPR Policy, must be followed) or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

[OASIS requests that any OASIS Party or any other party that believes it has patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable, to notify OASIS TC Administrator and provide an indication of its willingness to grant patent licenses to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this deliverable.]

[OASIS invites any party to contact the OASIS TC Administrator if it is aware of a claim of ownership of any patent claims that would necessarily be infringed by implementations of this OASIS Standards Final Deliverable by a patent holder that is not willing to provide a license to such patent claims in a manner consistent with the IPR Mode of the OASIS Technical Committee that produced this OASIS Standards Final Deliverable. OASIS may include such claims on its website, but disclaims any obligation to do so.]

[OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this OASIS Standards Final Deliverable or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS' procedures with respect to rights in any document or deliverable produced by an OASIS Technical Committee can be found on the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this OASIS Standards Final Deliverable, can be obtained from the OASIS TC Administrator. OASIS makes no representation that any information or list of intellectual property rights will at any time be complete, or that any claims in such list are, in fact, Essential Claims.]     
       
       -->
  
  <xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd" />

  <!-- Core data types: -->
  <xsd:simpleType name="baseArtifactEnum">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="BaseArtifactType" />
      <xsd:enumeration value="DocumentArtifactType" />
      <xsd:enumeration value="Document" />
      <xsd:enumeration value="XmlDocument" />
      <!-- xsd model -->
      <xsd:enumeration value="XsdDocument" />
      <!-- wsdl model -->
      <xsd:enumeration value="WsdlDocument" />
      <!-- policy model -->
      <xsd:enumeration value="PolicyDocument" />
      <!-- derived artifacts -->
      <xsd:enumeration value="DerivedArtifactType" />
      <!-- policy model -->
      <xsd:enumeration value="PolicyAttachment" />
      <xsd:enumeration value="PolicyExpression" />
      <!-- xsd model -->
      <xsd:enumeration value="AttributeDeclaration" />
      <xsd:enumeration value="ElementDeclaration" />
      <xsd:enumeration value="XsdType" />
      <xsd:enumeration value="ComplexTypeDeclaration" />
      <xsd:enumeration value="SimpleTypeDeclaration" />
      <!-- wsdl model -->
      <xsd:enumeration value="WsdlDerivedArtifactType" />
      <xsd:enumeration value="NamedWsdlDerivedArtifactType" />
      <xsd:enumeration value="WsdlService" />
      <xsd:enumeration value="Port" />
      <xsd:enumeration value="Binding" />
      <xsd:enumeration value="PortType" />
      <xsd:enumeration value="BindingOperation" />
      <xsd:enumeration value="BindingOperationInput" />
      <xsd:enumeration value="BindingOperationFault" />
      <xsd:enumeration value="Operation" />
      <xsd:enumeration value="OperationInput" />
      <xsd:enumeration value="Fault" />
      <xsd:enumeration value="Message" />
      <xsd:enumeration value="Part" />
      <xsd:enumeration value="BindingOperationOutput" />
      <xsd:enumeration value="OperationOutput" />
      <xsd:enumeration value="WsdlExtension" />
      <!-- soapwsdl model -->
      <xsd:enumeration value="SoapAddress" />
      <xsd:enumeration value="SoapBinding" />
      <!-- extended artifacts -->
      <xsd:enumeration value="ExtendedArtifactType" />
      <xsd:enumeration value="ExtendedDocument" />
      <!-- soa model -->
      <xsd:enumeration value="SoaModelType" />
      <xsd:enumeration value="ServiceInterface" />
      <xsd:enumeration value="Effect" />
      <xsd:enumeration value="Event" />
      <xsd:enumeration value="InformationType" />
      <xsd:enumeration value="Policy" />
      <xsd:enumeration value="PolicySubject" />
      <xsd:enumeration value="ServiceContract" />
      <xsd:enumeration value="Element" />
      <xsd:enumeration value="Service" />
      <xsd:enumeration value="Actor" />
      <xsd:enumeration value="Organization" />
      <xsd:enumeration value="System" />
      <xsd:enumeration value="Task" />
      <xsd:enumeration value="Composition" />
      <xsd:enumeration value="ServiceComposition" />
      <xsd:enumeration value="Choreography" />
      <xsd:enumeration value="Collaboration" />
      <xsd:enumeration value="Orchestration" />
      <xsd:enumeration value="Process" />
      <xsd:enumeration value="ChoreographyProcess" />
      <xsd:enumeration value="CollaborationProcess" />
      <xsd:enumeration value="OrchestrationProcess" />
      <!-- serviceimplementation model -->
      <xsd:enumeration value="ServiceImplementationModelType" />
      <xsd:enumeration value="ServiceInstance" />
      <xsd:enumeration value="ServiceOperation" />
      <xsd:enumeration value="ServiceEndpoint" />
      <xsd:enumeration value="ServiceOperation" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="derivedArtifactEnum">
    <xsd:restriction base="s-ramp:baseArtifactEnum">
      <xsd:enumeration value="DerivedArtifactType" />
      <!-- policy model -->
      <xsd:enumeration value="PolicyAttachment" />
      <xsd:enumeration value="PolicyExpression" />
      <!-- xsd model -->
      <xsd:enumeration value="AttributeDeclaration" />
      <xsd:enumeration value="ElementDeclaration" />
      <xsd:enumeration value="XsdType" />
      <xsd:enumeration value="ComplexTypeDeclaration" />
      <xsd:enumeration value="SimpleTypeDeclaration" />
      <!-- wsdl model -->
      <xsd:enumeration value="WsdlDerivedArtifactType" />
      <xsd:enumeration value="NamedWsdlDerivedArtifactType" />
      <xsd:enumeration value="WsdlService" />
      <xsd:enumeration value="Port" />
      <xsd:enumeration value="Binding" />
      <xsd:enumeration value="PortType" />
      <xsd:enumeration value="BindingOperation" />
      <xsd:enumeration value="BindingOperationInput" />
      <xsd:enumeration value="BindingOperationFault" />
      <xsd:enumeration value="Operation" />
      <xsd:enumeration value="OperationInput" />
      <xsd:enumeration value="Fault" />
      <xsd:enumeration value="Message" />
      <xsd:enumeration value="Part" />
      <xsd:enumeration value="BindingOperationOutput" />
      <xsd:enumeration value="OperationOutput" />
      <xsd:enumeration value="WsdlExtension" />
      <!-- soapwsdl model -->
      <xsd:enumeration value="SoapAddress" />
      <xsd:enumeration value="SoapBinding" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="documentArtifactEnum">
    <xsd:restriction base="s-ramp:baseArtifactEnum">
      <xsd:enumeration value="DocumentArtifactType" />
      <xsd:enumeration value="Document" />
      <xsd:enumeration value="XmlDocument" />
      <xsd:enumeration value="ExtendedDocument" />
      <!-- xsd model -->
      <xsd:enumeration value="XsdDocument" />
      <!-- wsdl model -->
      <xsd:enumeration value="WsdlDocument" />
      <!-- policy model -->
      <xsd:enumeration value="PolicyDocument" />
    </xsd:restriction>
  </xsd:simpleType>
  
  <!-- Base type for almost all Artifacts in S-RAMP. Most other types in S-RAMP extend this one. Extensions of BaseArtifactType are limited to attributes. -->
  <xsd:complexType abstract="true" name="BaseArtifactType">
    <xsd:sequence>
      <xsd:element ref="tns:classifiedBy" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="tns:relationship" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element ref="tns:property" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="artifactType" type="s-ramp:baseArtifactEnum" use="required" />
    <xsd:attribute name="name" type="xsd:string" use="required" />
    <xsd:attribute name="description" type="xsd:string" use="optional" />
    <xsd:attribute name="createdBy" type="xsd:string" use="required" />
    <xsd:attribute name="version" type="xsd:string" use="optional" />
    <xsd:attribute name="uuid" type="xsd:string" use="required" />
    <xsd:attribute name="createdTimestamp" type="xsd:dateTime" use="required" />
    <xsd:attribute name="lastModifiedTimestamp" type="xsd:dateTime" use="required" />
    <xsd:attribute name="lastModifiedBy" type="xsd:string" use="required" />
    <xsd:anyAttribute namespace="##any" />
  </xsd:complexType>

  <!-- Base type for all Derived Artifacts in S-RAMP -->
  <xsd:complexType abstract="true" name="DerivedArtifactType">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:BaseArtifactType">
        <xsd:sequence>
          <xsd:element name="relatedDocument" type="tns:documentArtifactTarget" minOccurs="1" maxOccurs="1" />
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:element name="DerivedArtifactType" type="tns:DerivedArtifactType" />

  <!-- Base type for all Documents in S-RAMP -->
  <xsd:complexType abstract="true" name="DocumentArtifactType">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:BaseArtifactType">
        <xsd:attribute name="contentType" type="xsd:string" />
        <xsd:attribute name="contentSize" type="xsd:long" />
        <xsd:attribute name="contentHash" type="xsd:string" />
        <xsd:anyAttribute namespace="##any" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <!-- Document type implements DocumentArtifactType -->
  <xsd:complexType name="Document">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:DocumentArtifactType" />
    </xsd:complexContent>
  </xsd:complexType>

  <!-- Base Type for all XML documents. Specific document types extend XmlDocument -->
  <xsd:complexType name="XmlDocument">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:DocumentArtifactType">
        <xsd:attribute name="contentEncoding" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <!-- Types used for Extended Artifact Models in S-RAMP -->
  <xsd:complexType name="ExtendedArtifactType">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:BaseArtifactType">
        <xsd:attribute name="extendedType" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:complexType name="ExtendedDocument">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:DocumentArtifactType">
        <xsd:attribute name="extendedType" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <!-- Relationship target artifact's UUID. Used by all types of relationships -->
  <xsd:complexType name="target">
    <xsd:simpleContent>
      <xsd:extension base="xsd:string">
        <xsd:attribute ref="xlink:href" use="required" />
        <xsd:anyAttribute namespace="##any" />
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

  <!-- Relationship referencing the artifact's UUID, to reference any BaseArtifact. -->
  <xsd:complexType name="baseArtifactTarget">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:target">
        <xsd:attribute name="artifactType" type="s-ramp:baseArtifactEnum" use="required" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <!-- Relationship referencing the artifact's UUID, to reference any DerivedArtifact. -->
  <xsd:complexType name="derivedArtifactTarget">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:target">
        <xsd:attribute name="artifactType" type="s-ramp:derivedArtifactEnum" use="required" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <!-- Relationship referencing the artifact's UUID, to reference any DocumentArtifact. -->
  <xsd:complexType name="documentArtifactTarget">
    <xsd:complexContent>
      <xsd:extension base="s-ramp:target">
        <xsd:attribute name="artifactType" type="s-ramp:documentArtifactEnum" use="required" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <!-- Global Element Declarations -->

  <!-- Relationship element used for all GENERIC (user-defined) Relationships -->
  <xsd:element name="relationship">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:relationshipType" minOccurs="1" maxOccurs="1" />
        <xsd:element name="relationshipTarget" type="tns:target" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
      <xsd:anyAttribute namespace="##any" />
    </xsd:complexType>
  </xsd:element>

  <!-- Stored Queries Artifact element -->
  <xsd:element name="StoredQuery">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:propertyName" minOccurs="0" maxOccurs="unbounded" />
        <xsd:element ref="tns:queryExpression" />
      </xsd:sequence>
      <xsd:attribute name="queryName" type="xsd:string" />
      <xsd:anyAttribute namespace="##any" />
    </xsd:complexType>
  </xsd:element>

  <!-- Property -->
  <xsd:element name="property">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="tns:propertyName" minOccurs="1" maxOccurs="1" />
        <xsd:element ref="tns:propertyValue" minOccurs="1" maxOccurs="1" />
      </xsd:sequence>
      <xsd:anyAttribute namespace="##any" />
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="relationshipType" type="xsd:string" />
  <xsd:element name="classifiedBy" type="xsd:anyURI" />
  <xsd:element name="propertyName" type="xsd:string" />
  <xsd:element name="propertyValue" type="xsd:string" />
  <xsd:element name="queryExpression" type="xsd:string" />
  <!-- The sourceId and targetId contain the UUID's corresponding to a relationship's source and target -->
  <xsd:element name="sourceId" type="xsd:string" />
  <xsd:element name="targetId" type="xsd:string" />

</xsd:schema>
