<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://namespace.openaire.eu/oaf"
  targetNamespace="http://namespace.openaire.eu/oaf" elementFormDefault="unqualified">

  <xs:annotation>
    <xs:documentation>This schema describes elements and properties of OpenAIRE+ entities of type
      organisation</xs:documentation>
  </xs:annotation>

  <xs:include schemaLocation="oaf-common-0.1.xsd"/>

  <xs:element name="organization">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="legalname" type="xs:string"/>
        <xs:element name="legalshortname" type="xs:string"/>
        <xs:element name="logourl" type="xs:string"/>
        <xs:element name="originalId" type="xs:string"/>
        <xs:element name="websiteurl" type="xs:string"/>
        <xs:element name="country" type="optionalClassedSchemedElement"/>
        <xs:element name="ecenterprise" type="xs:string">
          <xs:annotation>
            <xs:documentation>Tells if this organisation is an enteprise. Value comes from CORDA
              (Enterprise) </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="echighereducation" type="xs:string">
          <xs:annotation>
            <xs:documentation>Tells if this organisation is in the higher education. Value comes
              from CORDA (HigherEducation). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <!-- We might want to remove this field since it seems to be a duplicate of ecinternationalorganizationeurinterests -->
        <xs:element name="ecinternationalorganization" type="xs:string">
          <xs:annotation>
            <xs:documentation>Tells if this organisation is international. Value comes from CORDA
              (InternationalOrgEurInterest). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ecinternationalorganizationeurinterests" type="xs:string">
          <xs:annotation>
            <xs:documentation>Value comes from CORDA (InternationalOrgEurInterest).
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="eclegalbody" type="xs:string">
          <xs:annotation>
            <xs:documentation>Tells if this organisation is a legal body. Value comes from CORDA
              (PublicBody). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="eclegalperson" type="xs:string">
          <xs:annotation>
            <xs:documentation>Tells if this organisation is a legal person. Value comes from CORDA
              (LegalPerson). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ecnonprofit" type="xs:string">
          <xs:annotation>
            <xs:documentation>Tells if this organisation is non-profit. Value comes from CORDA
              (NonProfit). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ecnutscode" type="xs:string">
          <xs:annotation>
            <xs:documentation>Value comes from CORDA. </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ecresearchorganization" type="xs:string">
          <xs:annotation>
            <xs:documentation>Tells if this organisation is a research organisation. Value comes
              from CORDA (ResearchOrganisation). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="ecsmevalidated" type="xs:string">
          <xs:annotation>
            <xs:documentation>Value comes from CORDA (SMEValidated). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="collectedfrom" type="namedIdElement">
          <xs:annotation>
            <xs:documentation>Identifier and name of the datasource from which this organization has
              been collected from.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="pid">
          <xs:complexType mixed="true"/>
        </xs:element>
        <xs:element name="datainfo" type="datainfoType"/>
        <xs:element name="rels" type="relsType">
          <xs:annotation>
            <xs:documentation>Relationships to other entities.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="children">
          <xs:complexType mixed="true"/>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>
