<?xml version="1.0" encoding="UTF-8"?>
<!--
  This data schema was developed by DFF - Deutsches Filminstitut & Filmmuseum (www.dff.film) 
  for the purpose of exporting metadata for digital objects on filmportal.de and the film works 
  related to those objects.
  Schema developed by Eleonore Emsbach; last edit by Kristina Rose on 12.01.2025.
  Version: 1.8 (cardinality for fpr properties in edm:Agent changed to optional (was oneOrMore)
-->
<grammar ns="http://filmstandards.org/schemas/filmportal-dff-edm"
  xmlns:rdac="http://rdaregistry.info/Elements/c/"
  xmlns:ore="http://www.openarchives.org/ore/terms/" xmlns:owl="http://www.w3.org/2002/07/owl#"
  xmlns:fpr="http://www.filmstandards.org/schemas/filmportal_relations#"
  xmlns:skos="http://www.w3.org/2004/02/skos/core#"
  xmlns:edm="http://www.europeana.eu/schemas/edm/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/"
  xmlns:rdaw="http://rdaregistry.info/Elements/w/" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:marcrel="http://id.loc.gov/vocabulary/relators/"
  xmlns="http://relaxng.org/ns/structure/1.0"
  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <element name="rdf:RDF">
      <interleave>
      <element name="edm:ProvidedCHO">
        <attribute name="rdf:about"/>
        <interleave>
        <zeroOrMore>
          <element name="dc:contributor">
            <optional>
              <attribute name="rdf:resource">
                <data type="anyURI"/>
              </attribute>
            </optional>
            <optional>
              <attribute>
                <name>xml:lang</name>
                <data type="NCName"/>
              </attribute>
            </optional>
            <text/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="dc:creator">
            <optional>
              <attribute name="rdf:resource">
                <data type="anyURI"/>
              </attribute>
            </optional>
            <optional>
              <attribute>
                <name>xml:lang</name>
                <data type="NCName"/>
              </attribute>
            </optional>
            <text/>
          </element>
        </zeroOrMore>
        <optional>
          <element name="dc:date">
            <text/>
          </element>
        </optional>
        <zeroOrMore>
          <element name="dc:description">
            <attribute>
              <name>xml:lang</name>
              <data type="NCName"/>
            </attribute>
            <text/>
          </element>
        </zeroOrMore>
        <element name="dc:identifier">
          <text/>
        </element>
        <zeroOrMore>
          <element name="dcterms:identifier">
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="dc:language">
            <data type="language"/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <ref name="dc.rights"/>
        </zeroOrMore>
        <zeroOrMore>
          <element name="dc:subject">
            <optional>
              <attribute name="rdf:resource">
                <data type="anyURI"/>
              </attribute>
            </optional>
            <optional>
              <attribute>
                <name>xml:lang</name>
                <data type="NCName"/>
              </attribute>
            </optional>
            <text/>
          </element>
        </zeroOrMore>
        <oneOrMore>
          <element name="dc:title">
          <optional>
            <attribute>
              <name>xml:lang</name>
              <data type="NCName"/>
            </attribute>
            </optional>
            <text/>
          </element>
        </oneOrMore>
        <element name="dc:type"><!--2021-10-05: added possibility to add non-URI values in dc:type; Kristina Rose-->
          <optional>
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </optional>
          <optional>
            <attribute>
              <name>xml:lang</name>
              <data type="NCName"/>
            </attribute>
          </optional>
          <text/>
        </element>
        <optional>
          <element name="dcterms:created">
            <text/>
          </element>
        </optional>
        <zeroOrMore>
          <element name="dcterms:provenance">
            <optional>
              <attribute>
                <name>xml:lang</name>
                <data type="NCName"/>
              </attribute>
            </optional>
            <text/>
          </element>
        </zeroOrMore>
        <zeroOrMore>
          <element name="dcterms:references">
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </element>
        </zeroOrMore>
        <element name="edm:type">
          <data type="NCName"/>
        </element>
        </interleave>
      </element>
      <oneOrMore>
        <element name="edm:WebResource">
          <attribute name="rdf:about">
            <data type="anyURI"/>
          </attribute>
          <interleave>
          <optional>
            <element name="dc:format">
              <attribute>
                <name>xml:lang</name>
                <data type="NCName"/>
              </attribute>
              <text/>
            </element>
          </optional>
          <zeroOrMore>
            <ref name="dc.rights"/>
          </zeroOrMore>
          <optional>
            <element name="dcterms:extent">
              <text/>
            </element>
          </optional>
          <optional>
           <ref name="edm.rights"/>
         </optional>
          <zeroOrMore>
            <element name="marcrel:fnd"><!-- Added property marcrel:fnd; 28.10.2021 /kr -->
              <text/>
            </element>
          </zeroOrMore>
          </interleave>
        </element>
      </oneOrMore>
      <zeroOrMore>
        <element name="edm:Agent">
          <attribute name="rdf:about">
            <data type="anyURI"/>
          </attribute>
          <interleave>
              <ref name="skos.prefLabel"/>
            <optional>
              <element name="edm:begin">
                <choice>
                <data type="date"/>
                <data type="gYear"/>
                <data type="gYearMonth"/>
                </choice>
              </element>
            </optional>
            <optional>
              <element name="edm:end">
                <data type="date"/>
              </element>
            </optional>
            <zeroOrMore>
             <ref name="owl.sameAs"/>
            </zeroOrMore>
            <!-- changed in version 1.8, was oneOrMore before /kr -->
            <optional>
              <choice>
                <ref name="fpr.isSubjectOf"/>
                <ref name="fpr.hasImage"/>
                <ref name="fpr.hasSound"/>
                <ref name="fpr.hasText"/>
                <element name="fpr:isContributorTo">
                  <attribute name="rdf:resource"/>
                </element>
                <element name="fpr:isCreatorOf">
                  <attribute name="rdf:resource"/>
                </element>
                <element name="fpr:isDepictedIn">
                  <attribute name="rdf:resource"/>
                </element>
              </choice>
            </optional>
          </interleave>
        </element>
      </zeroOrMore>
      <zeroOrMore>
        <element name="edm:Place">
          <attribute name="rdf:about">
            <data type="anyURI"/>
          </attribute>
          <ref name="skos.prefLabel"/>
        </element>
      </zeroOrMore>
      <zeroOrMore>
        <element name="skos:Concept">
          <attribute name="rdf:about">
            <data type="anyURI"/>
          </attribute>
          <ref name="skos.prefLabel"/>
        </element>
      </zeroOrMore>
      <zeroOrMore>
        <element name="rdac:C10001">
          <attribute name="rdf:about">
            <data type="anyURI"/>
          </attribute>
          <interleave>
          <optional>
            <element name="rdaw:P10004">
              <attribute name="rdf:resource">
                <data type="anyURI"/>
              </attribute>
            </element>
          </optional>
          <zeroOrMore>
            <element name="rdaw:P10066">
              <attribute name="rdf:resource">
                <data type="anyURI"/>
              </attribute>
            </element>
          </zeroOrMore>
          <zeroOrMore>
            <element name="rdaw:P10218">
              <attribute name="rdf:resource">
                <data type="anyURI"/>
              </attribute>
            </element>
          </zeroOrMore>
          <optional>
            <element name="rdaw:P10219">
              <text/>
            </element>
          </optional>
          <element name="rdaw:P10223">
            <optional>
              <attribute>
                <name>xml:lang</name>
                <data type="NCName"/>
              </attribute>
            </optional>
            <text/>
          </element>
          <zeroOrMore>
            <ref name="owl.sameAs"/>
          </zeroOrMore>
            <choice>
<!--          <optional>-->
            <ref name="fpr.hasText"/>
            <ref name="fpr.hasImage"/>
            <ref name="fpr.hasSound"/>
            <ref name="fpr.isSubjectOf"/>
            <element name="fpr:hasExtract">
              <attribute name="rdf:resource"/>
            </element>
            <element name="fpr:hasIncipit">
              <attribute name="rdf:resource"/>
            </element>
            <element name="fpr:hasFilm">
              <attribute name="rdf:resource"/>
            </element>
            <element name="fpr:hasPoster">
              <attribute name="rdf:resource"/>
            </element>
            <element name="fpr:hasTrailer">
              <attribute name="rdf:resource"/>
            </element>
            <element name="fpr:hasTeaser">
              <attribute name="rdf:resource"/>
            </element>
          <!--</optional>-->
            </choice>
          </interleave>
        </element>
      </zeroOrMore>
      <element name="ore:Aggregation">
        <attribute name="rdf:about">
          <data type="anyURI"/>
        </attribute>
        <interleave>
        <element name="edm:aggregatedCHO">
          <attribute name="rdf:resource"/>
        </element>
        <element name="edm:dataProvider">
          <optional>
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </optional>
          <optional>
            <attribute>
              <name>xml:lang</name>
              <data type="NCName"/>
            </attribute>
           </optional>
          <text/>
        </element>
        <optional>
          <element name="edm:isShownAt">
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </element>
        </optional>
        <optional>
          <element name="edm:isShownBy">
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </element>
        </optional>
        <zeroOrMore>
          <element name="edm:hasView">
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </element>
        </zeroOrMore>
        <optional>
          <element name="edm:object">
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </element>
        </optional>
        <element name="edm:provider">
          <optional>
            <attribute name="rdf:resource">
              <data type="anyURI"/>
            </attribute>
          </optional>
          <optional>
            <attribute>
              <name>xml:lang</name>
              <data type="NCName"/>
            </attribute>
          </optional>
          <text/>
        </element>
        <ref name="edm.rights"/>
        </interleave>
      </element>
      </interleave>
    </element>
  </start>
  <define name="dc.rights">
    <element name="dc:rights">
      <optional>
        <attribute name="rdf:resource">
          <data type="anyURI"/>
        </attribute>
      </optional>
      <optional>
        <attribute>
          <name>xml:lang</name>
          <data type="NCName"/>
        </attribute>
      </optional>
      <text/>
    </element>
  </define>
  <define name="edm.rights">
    <element name="edm:rights">
      <attribute name="rdf:resource">
        <data type="anyURI"/>
      </attribute>
    </element>
  </define>
  <define name="skos.prefLabel">
    <oneOrMore>
      <element name="skos:prefLabel">
        <attribute>
          <name>xml:lang</name>
          <data type="NCName"/>
        </attribute>
        <text/>
      </element>
    </oneOrMore>
  </define>
  <define name="owl.sameAs">
    <element name="owl:sameAs">
      <attribute name="rdf:resource">
        <data type="anyURI"/>
      </attribute>
    </element>
  </define>
  <define name="fpr.isSubjectOf">
    <element name="fpr:isSubjectOf">
      <attribute name="rdf:resource"/>
    </element>
  </define>
  <define name="fpr.hasImage">
    <element name="fpr:hasImage">
      <attribute name="rdf:resource"/>
    </element>
  </define>
  <define name="fpr.hasSound">
    <element name="fpr:hasSound">
      <attribute name="rdf:resource"/>
    </element>
  </define>
  <define name="fpr.hasText">
    <element name="fpr:hasText">
      <attribute name="rdf:resource"/>
    </element>
  </define>
</grammar>
