<RESOURCE_PROFILE>
    <HEADER>
        <RESOURCE_IDENTIFIER value="3326c3d8-d330-4570-817a-d935a3563145_TURGb3JtYXREU1Jlc291cmNlcy9NREZvcm1hdERTUmVzb3VyY2VUeXBl"/>
        <RESOURCE_TYPE value="MDFormatDSResourceType"/>
        <RESOURCE_KIND value="MDFormatDSResources"/>
        <RESOURCE_URI value=""/>
        <DATE_OF_CREATION value="2017-04-04T11:27:16-03:00"/>
    </HEADER>
    <BODY>
        <CONFIGURATION>
            <NAME>CIDOC</NAME>
            <DESCRIPTION>CIDOC Metadata Format</DESCRIPTION>
            <INTERPRETATION>public</INTERPRETATION>
            <SCHEMA uri=""/>
        </CONFIGURATION>
        <STATUS>
            <LAYOUTS>
                <LAYOUT name="index">
                    <!-- UPDATING TO MATCH THE RDF COMING FROM VIRTUOSOREADAPI BY TYPE (via sparql query template) since in the RDF we get we may have multiple rdf:Resource, we must ensure our point of view is the rdf:Resource whose uri is the one in objIdentifier-->
                    <!-- in objIdentifier we have the resource URI but it is XML escaped, in some cases this may prevent the resource to be indexed. Hopefully it will affect a limited number of records and it may be a signal that a "wrong" URI has been generated -->
                    <FIELDS>
                        <!-- common -->
                        <FIELD indexable="false" name="entity" result="true" stat="false" tokenizable="true" xpath="//rdf:RDF"/>
                        <FIELD header="true" indexable="true" name="objidentifier" result="false" stat="false" tokenizable="false" xpath="//dri:objIdentifier"/>
                        <FIELD header="true" indexable="true" name="datasourcename" result="false" stat="false" xpath="//dri:datasourcename"/>
                        <FIELD header="true" indexable="true" name="datasourceapi" result="false" stat="false" tokenizable="false" xpath="//dri:datasourceapi"/>
                        <FIELD indexable="true" stored="true" name="url" result="false" stat="false" tokenizable="false" xpath="//dri:objIdentifier"/>

                        <FIELD indexable="true" name="title" stored="true" result="false" stat="false" xpath="//rdf:RDF/rdf:Description[./@rdf:about = //dri:objIdentifier]/rdfs:label | //rdf:RDF/rdf:Description[./@rdf:about = //dri:objIdentifier]/crm:P102_has_title"/>
                        <FIELD indexable="true" name="description" result="false" stat="false" xpath="//rdf:RDF/rdf:Description[./@rdf:about = //dri:objIdentifier]/crm:P3_has_note"/>
                        <FIELD indexable="true" name="type" result="false" stat="false" stored="true" tokenizable="false" value="tokenize(.,'/')[last()]" xpath="distinct-values(//rdf:Description[./@rdf:about = //dri:objIdentifier]/rdf:type/@rdf:resource)"/>
                        <FIELD indexable="true" name="type_e55type" result="false" stat="false" stored="true" tokenizable="false" xpath="distinct-values(//rdf:Description[./@rdf:about = //dri:objIdentifier]/crm:P2_has_type/text())"/>

                        <FIELD indexable="true" name="context_provider" result="false" stat="false" tokenizable="false" xpath="distinct-values(//rdf:Description[./@rdf:about = //dri:objIdentifier]/crmpe:PP2_provided_by/@rdf:resource)"/>
                        <!-- FIXME: No way to distinguish between provider (context_provider above) and RI_Consortium-->
                        <FIELD indexable="true" name="context_ri_consortium" result="false" stat="false" tokenizable="false" xpath="distinct-values(//rdf:Description[./@rdf:about = //dri:objIdentifier]/crmpe:PP2_provided_by/@rdf:resource)"/>
                        <FIELD indexable="true" name="context_project" result="false" stat="false" tokenizable="false" xpath="//rdf:Description[./@rdf:about = //dri:objIdentifier]/crmpe:PP1i_is_currently_offered_by/@rdf:about"/>
                        <FIELD indexable="true" name="context_collection" result="false" stat="false" tokenizable="false" xpath="//rdf:Description[./@rdf:about = //dri:objIdentifier]/crm:P106i_forms_part_of/@rdf:resource"/>

                        <!-- new field for generic declared time -->
                        <FIELD indexable="true" name="declaredtime" result="false" stat="false" tokenizable="false" xpath="//rdf:Description[./@rdf:about = //dri:objIdentifier]/crmpe:PP42_has_declarative_time"/>

                        <FIELD indexable="true" name="actor" result="false" stat="false" tokenizable="false" xpath="//rdf:Description[./rdf:type/@rdf:resource='http://www.cidoc-crm.org/cidoc-crm/E39_Actor']/@rdf:about"/>
                        <!-- new field -->
                        <FIELD indexable="true" name="curator" result="false" stat="false" tokenizable="false" xpath="//rdf:Description[./@rdf:about = //dri:objIdentifier]/crmpe:PP32i_is_curated_by/@rdf:resource"/>

                        <!-- PE35_Project -->
                        <FIELD indexable="true" name="currently_offers" result="false" stat="false" tokenizable="false" xpath="//rdf:Description[./@rdf:about = //dri:objIdentifier]/crmpe:PP1_currently_offers/@rdf:resource"/>

                        <FIELD indexable="true" name="language" result="false" stat="false" tokenizable="false" xpath="//rdf:Description[./@rdf:about = //dri:objIdentifier]/crm:P72_has_language"/>

                        <FIELD indexable="true" name="creationtime" result="false" stat="false" tokenizable="false" xpath="//rdf:Description/creationtime"/>
                        <FIELD indexable="true" name="curationactivitytime" result="false" stat="false" tokenizable="false" xpath="//rdf:Description/curationtime"/>
                        <!-- FIXME: how to sparql for this. what's the difference with custodytransfertime? -->
                        <FIELD indexable="true" name="acquisitiontime" result="false" stat="false" tokenizable="false" xpath="//rdf:Description/custodytime"/>
                        <!-- FIXME: how to sparql for this. It seems we have no Move Events -->
                        <FIELD indexable="true" name="movetime" result="false" stat="false" tokenizable="false" xpath="//rdf:Description/movetime"/>
                        <!-- new field for custodial history -->
                        <FIELD indexable="true" name="custodialhistory" result="false" stat="false" tokenizable="false" xpath="//rdf:Description/custodialhistorynote"/>
                       <!-- FIX ME: what's the difference with acquisitiontime -->
                        <FIELD indexable="true" name="custodytransfertime" result="false" stat="false" tokenizable="false" xpath="//rdf:Description/custodytime"/>
                        <FIELD indexable="true" name="modificationtime" result="false" stat="false" tokenizable="false" xpath="//rdf:Description/updatetime"/>

                        <!-- Browsing Fields -->
                        <FIELD browsingAliasFor="datasourcename" indexable="true" name="datasourcenameforbrowsing" result="false" stat="false" tokenizable="false" xpath="//dri:datasourcename"/>
                    </FIELDS>
                </LAYOUT>
            </LAYOUTS>
        </STATUS>
    </BODY>
</RESOURCE_PROFILE>