<Realm>
    "Archivo Fotográfico Manuel Toussaint"@es
    "Manuel Toussaint Photograph Archive"@en

    abbreviation afmt
    thisOntology "http://www.iie.unam.mx/archivo-fotografico-manuel-toussaint#"

    dependsRealm sys
    dependsRealm swv

    <RepositoryArea>
       "Archivo Fotográfico Manuel Toussaint"@es
       "Manuel Toussaint Photograph Archive"@en
        generalArchivalThings
    </RepositoryArea>
</Realm>

<DefinitionSet photo_collection>
    <Vocabulary>
        <Property afmt:hasCallNumber>
            "Call number"@en
            "Código de referencia"@es
            subPropertyOf swv:hasUniqueIdentifier
            range afmt:CallNumber
            adjPhraseRule es "cuyo código de referencia es <refTerm/>" tailReferringTerm
            adjPhraseRule es "cuyo código de referencia contiene <searchTerm/>" tailSearchTerm
        </Property>
    
        <AbstractDataType afmt:CallNumber>
            "Call number"@en
            "Código de referencia"@es 
            subDataTypeOf xsd:string
            comparisonVector String correct_order default
        </AbstractDataType>
    
        <FundamentalDataType afmt:CallNumberStyle1>
            "Style 1 Call Number"@en
            "Clasificación en formato 1"@es
            subDataTypeOf afmt:CallNumber
            bindToRuleSet call_number_style_1
        </FundamentalDataType>
        
        <FundamentalDataType afmt:CallNumberStyle2>
            "Style 2 Call Number"@en
            "Clasificación en formato 2"@es
            subDataTypeOf afmt:CallNumber
            bindToRuleSet call_number_style_2
        </FundamentalDataType>

        <FundamentalDataType afmt:CallNumberStyle3>
            "Style 3 Call Number"@en
            "Clasificación en formato 3"@es
            subDataTypeOf afmt:CallNumber
            bindToRuleSet call_number_style_3
        </FundamentalDataType>
        
    </Vocabulary>

    <RuleSet call_number_style_1>
        <CompVectorFunctions>
            <CompVectorFunction correct_order>
                |{ 
                  call_num = @lit.val
                  match = /^(\D*)(\d+)$/.match(call_num)
                  ids = match[1]
                  nums = match[2].to_i
                  nums_str = sprintf("%04d", nums)
                  ids + nums_str
                }|
            </CompVectorFunction>
        </CompVectorFunctions>
    </RuleSet>

    <RuleSet call_number_style_2>
        <CompVectorFunctions>
            <CompVectorFunction correct_order>
                |{ 
                  call_num = @lit.val
                  match = /^(\d+)(\D+)(\d+)$/.match(call_num)
                  
                  nums1 = match[1].to_i
                  nums1_str = sprintf("%04d", nums1)
                  
                  ids = match[2]
                  
                  nums2 = match[3].to_i
                  nums2_str = sprintf("%04d", nums2)
                  
                  nums1_str + ids + nums2_str
                }|
            </CompVectorFunction>
        </CompVectorFunctions>
    </RuleSet>

    <RuleSet call_number_style_3>
        <CompVectorFunctions>
            <CompVectorFunction correct_order>
                |{ 
				  @lit.val
                }|
            </CompVectorFunction>
        </CompVectorFunctions>
    </RuleSet>

    <RuleSet photographic_print>
	    forAllMainLevelSOCMembersMembers
        <Structure>
            <Descriptor has_unique_id>
                property afmt:hasCallNumber
                minCardinality 1
                maxCardinality 1
                outRequirement fromPropRange
            </Descriptor>

            <Descriptor has_primary_support>
                 property swv:hasPrimarySupport
            </Descriptor>

            <Descriptor has_secondary_support>
                 property swv:hasSecondarySupport
            </Descriptor>

          <Descriptor mismo_negativo>
             property swv:producedFromSameNegative
          </Descriptor>
           
          <Descriptor reprografia>
             property swv:isReproductionOf
          </Descriptor>
           
          <Descriptor misma_serie>
             property swv:isInTheSameSeries
          </Descriptor>
           
          <Descriptor misma_composicion>
             property swv:hasTheSameComposition
          </Descriptor>
           
          <Descriptor otros_objetos>
             property swv:otherRelatedObjects
          </Descriptor>
           
          <Descriptor camaras_diferentes>
             property swv:sameShotDifferentCamera
          </Descriptor>
            
          <Descriptor nota_de_publicaciones>
             property swv:publicationNote
          </Descriptor>
          
          <Descriptor exposicion>
             property swv:hasExhibition
          </Descriptor>

          <Descriptor curated_by>
             property swv:curatedBy
          </Descriptor>
          
        </Structure>
        
       <KRRelationRules>
         <KRRelationRule has_photograph_manifestation>
           has_primary_support->primary_support.has_photograph_manifestation
           menotymizeInSearch
         </KRRelationRule>
         
         <KRRelationRule has_photograph_as_content>
           has_primary_support->primary_support.has_photograph_as_content
           menotymizeInSearch
         </KRRelationRule>
         
         <KRRelationRule has_title>
           has_photograph_as_content->image_as_content.has_title
         </KRRelationRule>
         
         <KRRelationRule in_collection>
           photographic_print_soc.has_members[inv]
         </KRRelationRule>         
         
         <KRRelationRule has_editor>
           has_photograph_as_content->image_as_content.has_editor
         </KRRelationRule>

         <KRRelationRule has_photographer>
           has_photograph_as_content->image_as_content.has_photographer
         </KRRelationRule>
         
        <KRRelationRule has_date>
           has_photograph_as_content->image_as_content.has_date
         </KRRelationRule>

        <KRRelationRule has_formal_structure>
           has_photograph_as_content->image_as_content.has_formal_structure
         </KRRelationRule>
         
        <KRRelationRule has_orientation>
           has_photograph_as_content->image_as_content.has_orientation
         </KRRelationRule>
         
        <KRRelationRule has_plane>
           has_photograph_as_content->image_as_content.has_plane
         </KRRelationRule>                  

        <KRRelationRule has_description>
           has_photograph_as_content->image_as_content.has_description
         </KRRelationRule>
         
        <KRRelationRule taken_from>
           has_photograph_as_content->image_as_content.taken_from
         </KRRelationRule>
         
        <KRRelationRule taken_facing>
           has_photograph_as_content->image_as_content.taken_facing
         </KRRelationRule>  

        <KRRelationRule initial_photo_location>
           has_photograph_as_content->image_as_content.has_initial_photo_location
        </KRRelationRule>
        
        <KRRelationRule in_country>
           initial_photo_location->swv.place.in_country
         </KRRelationRule>  

        <KRRelationRule in_state_or_province>
           initial_photo_location->swv.place.in_state_or_province
         </KRRelationRule>  

        <KRRelationRule in_delegation_or_municipality>
           initial_photo_location->swv.place.in_delegation_or_municipality
         </KRRelationRule>  

        <KRRelationRule in_neighborhood>
           initial_photo_location->swv.place.in_neighborhood
         </KRRelationRule>  

        <KRRelationRule has_street_location>
           initial_photo_location->swv.place.has_street_location
        </KRRelationRule>  

        <KRRelationRule has_role_in_photographic_process>
           has_primary_support->primary_support.has_role_in_photographic_process
         </KRRelationRule>

        <KRRelationRule has_primary_dimensions>
           has_primary_support->primary_support.has_dimensions
         </KRRelationRule> 

        <KRRelationRule has_primary_height>
           has_primary_dimensions->swv.dimensions_description.has_height
         </KRRelationRule> 
         
         <KRRelationRule has_primary_width>
           has_primary_dimensions->swv.dimensions_description.has_width
         </KRRelationRule> 

        <KRRelationRule has_primary_material>
           has_primary_support->primary_support.has_material
         </KRRelationRule> 
         
        <KRRelationRule has_secondary_dimensions>
           has_secondary_support->secondary_support.has_dimensions
         </KRRelationRule> 

        <KRRelationRule has_secondary_height>
           has_secondary_dimensions->swv.dimensions_description.has_height
         </KRRelationRule> 
         
         <KRRelationRule has_secondary_width>
           has_secondary_dimensions->swv.dimensions_description.has_width
         </KRRelationRule> 

        <KRRelationRule has_secondary_material>
           has_secondary_support->secondary_support.has_material
         </KRRelationRule> 

        <KRRelationRule has_secondary_inscription>
           has_secondary_support->secondary_support.has_linked_inscription
         </KRRelationRule>

        <KRRelationRule has_secondary_inscription_content>
           has_secondary_inscription->swv.inscription.has_main_content
           traverseInSearch
           adjPhraseRule es "con la inscripción <refTerm/>" tailReferringTerm
           adjPhraseRule es "con una inscripción" chaining F S
        </KRRelationRule>  

        <KRRelationRule has_secondary_seal>
           has_secondary_support->secondary_support.has_linked_seal
        </KRRelationRule>   

        <KRRelationRule has_secondary_seal_content>
           has_secondary_seal->swv.seal_manifestation.has_main_content
           traverseInSearch
           adjPhraseRule es "con el sello <refTerm/>" tailReferringTerm
           adjPhraseRule es "con un sello" chaining M S           
        </KRRelationRule>  
        
        <KRRelationRule publications_note_work>
           nota_de_publicaciones->swv.content_component_link.has_linked_publication
           adjPhraseRule es "que aparece<hvpl/> en <refTerm/>" tailReferringTerm
           adjPhraseRule es "que aparece<hvpl/> en una obra" chaining F S
           traverseInSearch
           searchWeight 2
        </KRRelationRule>  

        <KRRelationRule other_objects_work>
           otros_objetos->swv.content_component_link.has_linked_publication
           adjPhraseRule es "insert<hgen/><hpl/> con <refTerm/>" tailReferringTerm
           adjPhraseRule es "insert<hgen/><hpl/> en una obra" chaining F S
           traverseInSearch
           searchWeight 2
        </KRRelationRule>  
        
         # <KRRelationRule mismo_negativo>
         #  has_primary_support->primary_support.mismo_negativo->has_primary_support[inv]
         # </KRRelationRule> 
         
        # <KRRelationRule reprografia>
        #   has_primary_support->primary_support.reprografia
        # </KRRelationRule>          
         
        # <KRRelationRule misma_serie>
        #   has_primary_support->primary_support.misma_serie
        # </KRRelationRule>          
         
        # <KRRelationRule misma_composicion>
        #   has_primary_support->primary_support.misma_composicion->has_primary_support[inv]
        # </KRRelationRule>          
         
        # <KRRelationRule otros_objetos>
        #   has_primary_support->primary_support.otros_objetos
        # </KRRelationRule>          
         
        # <KRRelationRule camaras_diferentes>
        #   has_primary_support->primary_support.camaras_diferentes
        # </KRRelationRule>    
          
        # <KRRelationRule nota_de_publicaciones>
        #   has_primary_support->primary_support.nota_de_publicaciones
        #  </KRRelationRule>             
         
        # <KRRelationRule exposicion>
        #   has_primary_support->primary_support.exposicion
        # </KRRelationRule>           
              
       </KRRelationRules>

      <Descriptions>
        <VariableDesc>
            df has_unique_id
            df has_title
           	df has_date
           	df has_editor
           	df has_photographer
           	df curated_by
           	df has_formal_structure
           	df has_orientation
           	df has_plane
           	df has_description
             <UniqueDF>
                 <Label>
                    "Fotografía tomada desde"@es
                 </Label>
                 <Value>
                    textBPV taken_from
                 </Value>
                 onlySearchShowable
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Fotografía tomada hacia"@es
                 </Label>
                 <Value>
                    textBPV taken_facing
                 </Value>
                 onlySearchShowable
             </UniqueDF>
             <UniqueDF initial_photo_location_df>
                 <Label>
                    "Lugar de registro"@es
                 </Label>
                 <Value>
                    textBPV initial_photo_location
                 </Value>
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "País de registro"@es
                 </Label>
                 <Value>
                    textBPV in_country
                 </Value>
                 unShowable
                 showInstead initial_photo_location_df
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Estado de registro"@es
                 </Label>
                 <Value>
                    textBPV in_state_or_province
                 </Value>
                 unShowable
                 showInstead initial_photo_location_df
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Municipio o delegación de registro"@es
                 </Label>
                 <Value>
                    textBPV in_delegation_or_municipality
                 </Value>
                 unShowable
                 showInstead initial_photo_location_df
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Colonia o barrio de registro"@es
                 </Label>
                 <Value>
                    textBPV in_neighborhood
                 </Value>
                 unShowable
                 showInstead initial_photo_location_df
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Calle y número de registro"@es
                 </Label>
                 <Value>
                    textBPV has_street_location
                 </Value>
                 unShowable
                 showInstead initial_photo_location_df
             </UniqueDF>
             <UniqueDF has_primary_dimensions_df>
                 <Label>
                    "Dimensiones del soporte primario"@es
                 </Label>
                 <Value>
                    textBPV has_primary_dimensions
                 </Value>
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Ancho del soporte primario"@es
                 </Label>
                 <Value>
                    textBPV has_primary_width
                 </Value>
                 unShowable
                 showInstead has_primary_dimensions_df
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Alto del soporte primario"@es
                 </Label>
                 <Value>
                    textBPV has_primary_height
                 </Value>
                 unShowable
                 showInstead has_primary_dimensions_df
             </UniqueDF>
             <UniqueDF has_secondary_dimensions_df>
                 <Label>
                    "Dimensiones del soporte secundario"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_dimensions
                 </Value>
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Ancho del soporte secundario"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_width
                 </Value>
                 unShowable
                 showInstead has_secondary_dimensions_df
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Alto del soporte secundario"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_height
                 </Value>
                 unShowable
                 showInstead has_secondary_dimensions_df
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Materiales del soporte primario"@es
                 </Label>
                 <Value>
                    textBPV has_primary_material
                 </Value>
             </UniqueDF>
             <UniqueDF>
                 <Label>
                    "Materiales del soporte secundario"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_material
                 </Value>
             </UniqueDF>             
           	<UniqueDF>
                 <Label>
                    "Inscripción en el objeto"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_inscription
                 </Value>
            </UniqueDF>
           	<UniqueDF>
                 <Label>
                    "Sello en el objeto"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_seal
                 </Value>
            </UniqueDF>
            <UniqueDF>
               <Label>
                  "Fotografía producida a partir del mismo negativo"@es
               </Label>
               <Value>
                  textBPV mismo_negativo
               </Value>
            </UniqueDF>           	
           	df reprografia
           	df misma_serie
            <UniqueDF>
               <Label>
                  "Fotografía con la misma composición"@es
               </Label>
               <Value>
                  textBPV misma_composicion
               </Value>
            </UniqueDF>    
           	df otros_objetos
           	df camaras_diferentes
            df nota_de_publicaciones
            df exposicion
        </VariableDesc>
      
    	<ShortDesc>
        	df has_unique_id
            df has_title
           	df has_date
           	df has_editor
           	df has_photographer
    	</ShortDesc>

    	<TitleDesc>
        	textBPV has_unique_id
#            textBPV has_title swv.complex_title.short_text_ref
 #           <UniqueDF>
 #               <Label>
 #            		"Colección"@es
 #               </Label>
 #            	<Value>
 #            	   textBPV in_collection
 #               </Value>
 #           </UniqueDF>            	
    	</TitleDesc>
    	
        <FullDesc>
          <Area full_record>
          <Title>
             "Full record"@en
             "Ficha completa"@es
          </Title>
          <Block>
             <Title>
                "Identification area"@en
                "Área de identificación"@es
             </Title>
             df has_unique_id          
             df has_title
             <UniqueDF>
                <Label>
             		"Fecha"@es
             		"Date"@en
                </Label>
             	<Value>
             	   textBPV has_date
                </Value>
             </UniqueDF>
             <BlockSection>
           	   <Label>
                   "Autores"@es
                   "Authors"@en
               </Label>
               df has_editor
               df has_photographer
             </BlockSection>
             <UniqueDF>
                <Label>
             		"Colección"@es
                </Label>
             	<Value>
             	   #textBPV in_collection photographic_print_soc.short_title
             	   textBPV in_collection photographic_print_soc
                </Value>
             </UniqueDF>
               df curated_by  
          </Block>
          <Block>
             <Title>
                "Estructura y contenido"@es
             </Title>
             df has_formal_structure
             df has_orientation
             df has_plane
             <BlockSection>
           	   <Label>
                   "Descripción"@es
               </Label>
               textBPV has_description
               df taken_from
               df taken_facing
             </BlockSection>
             <BlockSection>
           	   <Label>
                   "Lugar de registro"@es
               </Label>
               df in_country
               <UniqueDF>
                 <Label>
             		"Estado"@es
                 </Label>
             	 <Value>
             	   textBPV in_state_or_province swv.place.short_name1
                 </Value>
               </UniqueDF>
               <UniqueDF>
                 <Label>
             		"Municipio o Delegación"@es
                 </Label>
             	 <Value>
             	   textBPV in_delegation_or_municipality swv.place.short_name1
                 </Value>
               </UniqueDF>
               <UniqueDF>
                 <Label>
             		"Colonia o Barrio"@es
                 </Label>
             	 <Value>
             	   textBPV in_neighborhood swv.place.short_name1
                 </Value>
               </UniqueDF>
               <UniqueDF>
                 <Label>
             		"Calle y número"@es
                 </Label>
             	 <Value>
             	   textBPV has_street_location swv.place.short_name1
                 </Value>
               </UniqueDF>
             </BlockSection>
           </Block>
           <Block>
             <Title>
                "Características físicas"@es
             </Title>
             <UniqueDF>
                 <Label>
                    "Tipo"@es
                 </Label>
                 <Value>
                    textBPV has_role_in_photographic_process
                 </Value>
             </UniqueDF>
             <BlockSection>
           	   <Label>
                   "Soporte primario"@es
               </Label>             
               df has_primary_dimensions
               df has_primary_material
             </BlockSection>
             <BlockSection>
           	   <Label>
                   "Soporte secundario"@es
               </Label>
               df has_secondary_dimensions
               df has_secondary_material
               <UniqueDF>
                 <Label>
                    "Inscripción"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_inscription
                 </Value>
               </UniqueDF>
               
               <UniqueDF>
                 <Label>
                    "Sello"@es
                 </Label>
                 <Value>
                    textBPV has_secondary_seal
                 </Value>
               </UniqueDF>
               
              </BlockSection>
            </Block>
            <Block>
             <Title>
                "Documentación asociada"@es
             </Title>
               <UniqueDF>
                 <Label>
                    "Fotografía producida a partir del mismo negativo"@es
                 </Label>
                 <Value>
                    textBPV mismo_negativo
                 </Value>
               </UniqueDF>
           	   df reprografia
           	   df misma_serie
               <UniqueDF>
                 <Label>
                    "Fotografía con la misma composición"@es
                 </Label>
                 <Value>
                    textBPV misma_composicion
                 </Value>
               </UniqueDF>           	              	   
               df otros_objetos
               df camaras_diferentes
               df nota_de_publicaciones
               df exposicion
            </Block>
          </Area>
        </FullDesc>
      </Descriptions>
    </RuleSet>
    
    <RuleSet photographic_print_soc>
        forPersistentGroup
        forMembersOfMainLevelSOCs
        <Structure>
            <Descriptor has_extended_identifier>
                property swv:hasExtendedIdentifier
            </Descriptor>

            <Descriptor has_short_title>
                property swv:hasShortTitle
            </Descriptor>

            <Descriptor has_photographer>
                property swv:hasPhotographer
            </Descriptor>

            <Descriptor has_editor>
                property swv:hasEditor
            </Descriptor>

            <Descriptor has_initial_photo_date>
                property swv:hasInitialPhotoDate
            </Descriptor>
            
            <Descriptor has_size>
                property swv:hasSize
            </Descriptor>
            
            <Descriptor has_institutional_history_and_biography>
                property swv:hasInstitutionalHistoryAndBiography
            </Descriptor>
            
            <Descriptor has_archival_history>
                property swv:hasArchivalHistory
            </Descriptor>
            
            <Descriptor has_inclusion_route>
                property swv:hasInclusionRoute
            </Descriptor>
            
            <Descriptor has_extension_and_summary>
                property swv:hasExtensionAndContentSummary
            </Descriptor>
            
            <Descriptor has_valoration_selection_and_removal_info>
                property swv:hasValorationSelectionAndRemovalInfo
            </Descriptor>
            
            <Descriptor has_new_additions>
                property swv:hasNewAdditions
            </Descriptor>
            
            <Descriptor has_archival_organization>
                property swv:hasArchivalOrganization
            </Descriptor>
            
            <Descriptor has_access_terms>
                property swv:hasAccessTerms
            </Descriptor>
            
            <Descriptor has_copying_terms>
                property swv:hasCopyingTerms
            </Descriptor>
            
            <Descriptor has_conservation_status>
                property swv:hasConservationStatus
            </Descriptor>
            
            <Descriptor has_other_copies_info>
                property swv:hasOtherCopiesInfo
            </Descriptor>
            
            <Descriptor has_documentalists_note>
                property swv:hasDocumentalistsNote
            </Descriptor>
            
            <Descriptor uses_rules_or_standards>
                property swv:usesRulesOrStandards
            </Descriptor>
            
            <Descriptor has_description_date>
                property swv:hasDescriptionDate
            </Descriptor>
        </Structure>
        
        <BPVFunctions>
            <TextBPVFunction text_ref>
                defaultTextBPVFunction
                slot has_title
                |{ (@root->has_title).text_bpv }|
            </TextBPVFunction>
            
            <TextBPVFunction short_title>
            	slot has_short_title
                |{ (@root->has_short_title).text_bpv }|
            </TextBPVFunction>
        </BPVFunctions>        
        
        <Descriptions>
            <ShortDesc>
        	    df has_title
                df has_description
                df has_size
         	</ShortDesc>
         	
         	<TitleDesc>
         	    textBPV has_title
#                textBPV has_description
         	</TitleDesc>
         	
         	<VariableDesc>
         	  df has_extended_identifier
         	  df has_title
                        <UniqueDF>
                            <Label>
             	    	        "Resumen"@es
                            </Label>
                         	<Value>
                         	    textBPV has_description
                            </Value>
                        </UniqueDF>         	  

                        <UniqueDF>
                            <Label>
             	    	        "Fecha"@es
                            </Label>
                         	<Value>
                         	    textBPV has_initial_photo_date
                            </Value>
                        </UniqueDF>
                            df has_editor
                            df has_photographer
                            df has_size
                            df has_institutional_history_and_biography
                            df has_extension_and_summary
         	</VariableDesc>
         	
            <FullDesc>
                <Area full_record>
                    <Block>
                        <Title>
                            "Área de identificación"@es
                        </Title>
                        df has_extended_identifier
                        df has_title
                        <UniqueDF>
                            <Label>
             	    	        "Resumen"@es
                            </Label>
                         	<Value>
                         	    textBPV has_description
                            </Value>
                        </UniqueDF>                        
                        <UniqueDF>
                            <Label>
             	    	        "Fecha"@es
                            </Label>
                         	<Value>
                         	    textBPV has_initial_photo_date
                            </Value>
                        </UniqueDF>
                        <BlockSection>
               	            <Label>
                                 "Autores"@es
                            </Label>
                            df has_editor
                            df has_photographer
                        </BlockSection>
                        <UniqueDF>
                            <Label>
             	    	        "Nivel de la descripción"@es
                            </Label>
                         	<Value>
                         	    "Colección"@es
                            </Value>
                        </UniqueDF>
                        df has_size
                    </Block>
                    <Block>
                        <Title>
                            "Contexto"@es
                        </Title>
                        df has_institutional_history_and_biography
                        df has_archival_history
                        df has_inclusion_route
                    </Block>
                    <Block>
                        <Title>
                            "Estructura y contenido"@es
                        </Title>
                        df has_extension_and_summary
                        df has_valoration_selection_and_removal_info
                        df has_new_additions
                        df has_archival_organization
                    </Block>
                    <Block>
                        <Title>
                            "Condiciones de acceso y utilización"@es
                        </Title>
                        df has_access_terms
                        df has_copying_terms
                        df has_conservation_status
                    </Block>
                    <Block>
                        <Title>
                            "Documentación asociada"@es
                        </Title>
                        df has_other_copies_info
                        df has_documentalists_note
                        df uses_rules_or_standards
                        df has_description_date
                    </Block>                                        
                </Area>
            </FullDesc>
        </Descriptions>
    </RuleSet>
    
    <RuleSet image_as_content>
        <Structure>
            <Descriptor has_title>
            	# had been temporarily changed to swv:hasTitle, check that everything still works...
                property swv:hasComplexTitle
                # property swv:hasTitle
                minCardinality 1
                maxCardinality 1
            </Descriptor>

            <Descriptor has_date>
                property swv:hasInitialPhotoDate
                minCardinality 0
                maxCardinality 1
                outRequirement fromPropRange
            </Descriptor>
    
            <Descriptor has_photographer>
              minCardinality 0
              maxCardinality 1  
              property swv:hasPhotographer
              outRequirement fromPropRange  
            </Descriptor>   

            <Descriptor has_editor>
              minCardinality 1
              maxCardinality 1  
              property swv:hasEditor
              outRequirement fromPropRange  
            </Descriptor>  
            
            <Descriptor has_formal_structure>
                property swv:hasFormalStructure
                minCardinality 1
                maxCardinality 1
                outRequirement fromPropRange
            </Descriptor>
            
            <Descriptor has_orientation>
                property swv:hasOrientation                    
                minCardinality 1
                maxCardinality 1
                outRequirement fromPropRange
            </Descriptor>
            
            <Descriptor has_plane>
                property swv:hasPlane
                minCardinality 1
                maxCardinality 1
                outRequirement fromPropRange
            </Descriptor>

            <Descriptor taken_from>
                property swv:takenFrom
                minCardinality 0
                maxCardinality 1
            </Descriptor>    
            
            <Descriptor taken_facing>
                property swv:takenFacing
                minCardinality 0
                maxCardinality 1
            </Descriptor>
              
            <Descriptor has_description>
                property swv:hasDescription
                minCardinality 1
                maxCardinality 1
                outRequirement fromPropRange
            </Descriptor>  
            
            <Descriptor has_initial_photo_location>
                property swv:hasInitialPhotoLocation
            </Descriptor>
            
        </Structure>
    </RuleSet>
    
    #<RuleSet image_as_content_soc>
    #</RuleSet>
    
    <RuleSet primary_support>
      <Structure>
      
            <Descriptor has_material>
                useDefinition swv.physical_objects.has_material
             </Descriptor>
                              

             <Descriptor has_dimensions>
               useDefinition swv.physical_objects.has_dimensions
             </Descriptor>
              
                            
        <Descriptor has_main_manifestation_link>
            property swv:hasMainManifestationLink
            minCardinality 1
            maxCardinality 1
        </Descriptor>
        
         <Descriptor has_format>
                property swv:hasFormat
                minCardinality 1
                maxCardinality 1
                outRequirement fromPropRange
          </Descriptor>
        
          <Descriptor has_role_in_photographic_process>
              useDefinition swv.photograph.has_role_in_photographic_process
           </Descriptor>
      </Structure>
      
      <KRRelationRules>
         <KRRelationRule has_photograph_manifestation>
           has_main_manifestation_link->swv.manifestation_link.has_linked_manifestation
         </KRRelationRule>
         
         <KRRelationRule has_photograph_as_content>
           has_photograph_manifestation->photograph_manifestation.has_main_content_link->swv.content_link.has_linked_content
         </KRRelationRule>
      </KRRelationRules>
      
    </RuleSet>  

    <RuleSet secondary_support>
        <Structure>            
             <Descriptor has_material>
                 useDefinition swv.physical_objects.has_material
             </Descriptor>
                        
             <Descriptor has_dimensions>
               useDefinition swv.physical_objects.has_dimensions
             </Descriptor>
 
             <Descriptor has_inscription_link>
               property swv:hasInscriptionLink
               outRequirement fromPropRange
            </Descriptor> 
            
             <Descriptor has_seal_link>
               property swv:hasSealLink
               outRequirement fromPropRange
            </Descriptor> 
                          
        </Structure>  
        
        <KRRelationRules>
          <KRRelationRule has_linked_inscription>
            has_inscription_link->swv.manifestation_link.has_linked_manifestation
          </KRRelationRule>
          
           <KRRelationRule has_linked_seal>
            has_seal_link->swv.manifestation_link.has_linked_manifestation
          </KRRelationRule>
        </KRRelationRules>
                    
    </RuleSet>
    
    <RuleSet photograph_manifestation>
        <Structure>
             <Descriptor has_main_content_link>
                useDefinition swv.manifestation.has_main_content_link
            </Descriptor>
 
            <Descriptor has_tone_and_color>
                property swv:hasToneAndColor
                minCardinality 1
                maxCardinality 1
                outRequirement fromPropRange
            </Descriptor>
        </Structure>


  		  <BPVFunctions>
   			  <TextBPVFunction text_ref>
        		 defaultTextBPVFunction
        		 |{
        		 	# medida temporal para evitar resultados de búsqueda repetidas
        		 	# TODO: see if it's still needed...
        		    @root.node_to_string 
		         }|
      		  </TextBPVFunction>
		  </BPVFunctions>
    </RuleSet>

    
   <RepositorySetup>
        <SOC photographic_prints>
            "Julio Michaud Collection"@en
            "Colección Julio Michaud"@es
            comment "Fotografías del siglo XIX, del editor Julio Michaud, que forman parte del acervo del IIE"@es
            hasGroupDomain swv:PhotographicPrint
            bindToRuleSet photographic_print
            mainLevel
            bindSOCToRuleSet photographic_print_soc
        </SOC>
        
         <SOC primary_photograph_supports>
                "Primary Photograph Supports"@en
                "Soportes fotográficos primarios"@es
                hasGroupDomain swv:PhotographSupport
                bindToRuleSet primary_support   
                secondaryLevel
                groupInSearchResults
         </SOC>
                       
        <SOC secondary_photograph_supports>
                "Secondary Photograph Supports"@en
                "Soportes fotográficos secundarios"@es
                hasGroupDomain swv:PhotographSupport
                bindToRuleSet secondary_support   
                secondaryLevel
                groupInSearchResults
         </SOC>
         
         <SOC manifestation_links>
                "Manifestation Links"@en
                "Vínculos a manifestaciones"@es
                hasGroupDomain swv:ManifestationLink
                bindToRuleSet swv.manifestation_link   
                internal
         </SOC>

        <SOC seal_manifestation_links>
                "Manifestation Links"@en
                "Vínculos a manifestaciones"@es
                hasGroupDomain swv:ManifestationLink
                bindToRuleSet swv.manifestation_link
                internal
        </SOC>  

         <SOC locations_on_object>
               "Locations on Object"@en
               "Ubicaciones sobre el objeto"@es
               hasGroupDomain swv:LocationOnObject
               bindToRuleSet swv.thing
               secondaryLevel
         </SOC>   

         <SOC inscriptions>
           "Inscriptions"@en
           "Inscripciones"@es
           #hasGroupDomain swv:Inscriptions
           hasGroupDomain swv:HandWrittenNote
           bindToRuleSet swv.inscription
           secondaryLevel
           groupInSearchResults
         </SOC>                   
                
         <SOC seal_manifestations>
           "Seal Manifestations"@en
           "Manifestaciones de sellos"@es
           hasGroupDomain swv:SealManifestation
           bindToRuleSet swv.seal_manifestation
           secondaryLevel
           groupInSearchResults         
         </SOC>       
                
         <SOC content_links>
            "Content Links"@en
            "Vínculos de contenido"@es
            hasGroupDomain swv:ContentLink
            bindToRuleSet swv.content_link
            internal
        </SOC>
        
        <SOC seal_content_links>
            "Seal Content Link"@en
            "Vínculos de contenido"@es
            hasGroupDomain swv:ContentLink
            bindToRuleSet swv.content_link
            internal
        </SOC>     

        <SOC texts>
          "Texts"@en
          "Texto"@es
          hasGroupDomain swv:Text
          bindToRuleSet swv.text
          secondaryLevel
          groupInSearchResults
        </SOC>                  
   
         <SOC seals>
           "Seals"@en
           "Sellos"@es
           hasGroupDomain swv:Seal
           bindToRuleSet swv.seal
           secondaryLevel
           groupInSearchResults
         </SOC>  
   
        <SOC main_manifestation_links>
           "Main Manifestation Links"@en
           "Vículos a manifestaciones principales"@es
           hasGroupDomain swv:ManifestationLink
           bindToRuleSet swv.manifestation_link
           internal
        </SOC>
   
         <SOC photograph_manifestations>
           "Photograph Manifestations"@en
           "Manifestaciones de fotografías"@es
           hasGroupDomain swv:PhotographManifestation
           bindToRuleSet photograph_manifestation
           secondaryLevel
           groupInSearchResults
         </SOC>
   
                
        <SOC main_content_links>
          "Main Content Link"@en
          "Vínculos a contenidos principales"@es
          hasGroupDomain swv:ContentLink
          bindToRuleSet swv.content_link
          internal
        </SOC>          
                
        <SOC images_as_content>
            "Images (as content) in the Julio Michaud Collection"@en
            "Imágenes (como contenido) de la Colección Julio Michaud"@es
            hasGroupDomain swv:Image
            bindToRuleSet image_as_content
            secondaryLevel
            groupInSearchResults     
        </SOC>  

        <SOC authors>
            "Authors of the collection Julio Michaud"@en
            "Autores de la colección Julio Michaud"@es
            hasGroupDomain swv:Author
            bindToRuleSet swv.person  
            secondaryLevel
        </SOC>        

 		<SOC publishers>
 			"Publishers"@en
 			"Editoriales"@es
 			hasGroupDomain swv:Publisher
 			bindToRuleSet swv.thing
 			secondaryLevel
 		</SOC>
 
  		<SOC publications>
			"Publications"@en 
            "Publicaciones"@es
            hasGroupDomain swv:Publication
            bindToRuleSet swv.publication
            secondaryLevel
            # groupInSearchResults
  	    </SOC> 	           	    	
  	    
  	    <SOC content_component_links>
			"Content component links"@en 
            "Vínculos a componentes de contenido"@es
            hasGroupDomain swv:ContentComponentLink
            bindToRuleSet swv.content_component_link
            secondaryLevel
            groupInSearchResults
  	    </SOC> 	           	    	
  	    
  	    <SOC institutions>
			"Institutions"@en 
            "Instituciones"@es
            hasGroupDomain swv:Institution
            bindToRuleSet swv.thing
            secondaryLevel
  	    </SOC> 	           	    	

        <SOC exhibitions>
            "Exhibitions"@en
            "Exhibicioness"@es
            hasGroupDomain swv:Exhibition
            bindToRuleSet swv.exhibition
            secondaryLevel
        </SOC>      
    
        <SOC venues>
            "Venues"@en
            "Recintos"@es
            hasGroupDomain swv:Venue
            bindToRuleSet swv.venue
            secondaryLevel
        </SOC>  
    </RepositorySetup>    
</DefinitionSet>        
