Project

General

Profile

« Previous | Next » 

Revision 62671

Added by Alessia Bardi over 1 year ago

Improved test

View differences:

modules/dnet-directindex-api/trunk/src/main/resources/eu/dnetlib/openaire/directindex/layoutToIndexNewSolrSchema.xsl
1

  
2
<?xml version="1.0" encoding="UTF-8"?>
3
<xsl:stylesheet version="1.0"
4
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:nxsl="http://www.w3.org/1999/XSL/TransformXX">
5

  
6
    <xsl:output omit-xml-declaration="yes" method="xml"/>
7
    <xsl:namespace-alias stylesheet-prefix="nxsl" result-prefix="xsl"/>
8

  
9
    <xsl:param name="format"/>
10

  
11
    <xsl:template match="/">
12
        <xsl:apply-templates select="//LAYOUT"/>
13
    </xsl:template>
14

  
15
    <xsl:template match="LAYOUT">
16
        <nxsl:stylesheet version="1.0"
17
                         xmlns:dnet="eu.dnetlib.miscutils.functional.xml.DnetXsltFunctions"
18
                         xmlns:dri="http://www.driver-repository.eu/namespace/dri"
19
                         exclude-result-prefixes="dnet">
20

  
21
            <nxsl:output version="1.0" omit-xml-declaration="yes"
22
                         method="xml"/>
23

  
24
            <nxsl:variable name="format">
25
                <xsl:value-of select="$format"/>
26
            </nxsl:variable>
27

  
28
            <nxsl:template match="/">
29
                <indexRecord>
30
                    <indexRecordIdentifier>
31
                        <nxsl:value-of select="//dri:objIdentifier"/>
32
                    </indexRecordIdentifier>
33
                    <targetFields>
34
                        <nxsl:if test="count(//*[local-name()='metadata']/*) &gt; 0">
35
                            <xsl:apply-templates select="FIELDS/FIELD[@indexable='true']"/>
36
                        </nxsl:if>
37
                    </targetFields>
38
                    <dnetResult>
39
                        <nxsl:copy-of select="/*[local-name()='record']/*[local-name()='result']/*[local-name()='header']"/>
40
                        <metadata>
41
                            <xsl:apply-templates select="FIELDS/FIELD"
42
                                                 mode="result"/>
43
                        </metadata>
44
                    </dnetResult>
45
                </indexRecord>
46
            </nxsl:template>
47
        </nxsl:stylesheet>
48
    </xsl:template>
49

  
50
    <xsl:template match="FIELD[@indexable='true']">
51
        <xsl:choose>
52
            <xsl:when test="@constant">
53
                <xsl:element name="{@name}">
54
                    <xsl:value-of select="@constant"/>
55
                </xsl:element>
56
            </xsl:when>
57
            <xsl:when test="@value and not(@xpath)">
58
                <xsl:choose>
59
                    <xsl:when test="contains(@type, 'date')">
60
                        <nxsl:variable name="{@name}" select="dnet:normalizeDate(normalize-space({normalize-space(@value)}), false())"/>
61
                        <nxsl:if test="string-length(${@name}) &gt; 0">
62
                            <nxsl:element name="{@name}">
63
                                <nxsl:value-of select="${@name}"/>
64
                            </nxsl:element>
65
                        </nxsl:if>
66
                    </xsl:when>
67
                    <xsl:otherwise>
68
                        <nxsl:element name="{@name}">
69
                            <nxsl:value-of select="{@value}"/>
70
                        </nxsl:element>
71
                    </xsl:otherwise>
72
                </xsl:choose>
73
            </xsl:when>
74
            <xsl:otherwise>
75
                <xsl:variable name="value">
76
                    <xsl:choose>
77
                        <xsl:when test="@value">
78
                            <xsl:value-of select="@value"/>
79
                        </xsl:when>
80
                        <xsl:otherwise>
81
                            .
82
                        </xsl:otherwise>
83
                    </xsl:choose>
84
                </xsl:variable>
85
                <nxsl:for-each select="{@xpath}">
86
                    <xsl:element name="{@name}">
87
                        <xsl:choose>
88
                            <xsl:when test="@tokenizable='false'">
89
                                <nxsl:value-of select="normalize-space({normalize-space($value)})"/>
90
                            </xsl:when>
91
                            <xsl:otherwise>
92
                                <nxsl:value-of select="{normalize-space($value)}"/>
93
                            </xsl:otherwise>
94
                        </xsl:choose>
95
                    </xsl:element>
96
                </nxsl:for-each>
97
            </xsl:otherwise>
98
        </xsl:choose>
99
    </xsl:template>
100

  
101

  
102
    <xsl:template match="FIELD" mode="result">
103
        <xsl:if test="@result='true'">
104
            <nxsl:copy-of select="{@xpath}"/>
105
        </xsl:if>
106
    </xsl:template>
107

  
108
    <xsl:template match="FIELD" mode="header">
109
        <xsl:if test="@header='true'">
110
            <nxsl:copy-of select="{@xpath}"/>
111
        </xsl:if>
112
    </xsl:template>
113

  
114
</xsl:stylesheet>
modules/dnet-directindex-api/trunk/src/test/resources/eu/dnetlib/openaire/directindex/utils/fields.xml
1
<LAYOUT name="index">
2
	<FIELDS>
3
		<FIELD indexable="false" name="oafentity" result="true" stat="false" tokenizable="true" xpath="//*[local-name() = 'entity']"/>
4
		<FIELD indexable="true" name="oaftype" result="false" stat="false" tokenizable="false" value="local-name(//*[local-name()='entity']/*)"/>
5
		<FIELD indexable="true" name="objIdentifier" result="false" stat="false" tokenizable="false" xpath="//header/dri:objIdentifier"/>
6

  
7
		<!-- DATASOURCE FIELDS -->
8
		<FIELD indexable="true" name="datasourceofficialname" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='datasource']/officialname"/>
9
		<FIELD indexable="true" name="datasourceenglishname" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='datasource']/englishname"/>
10
		<FIELD indexable="true" name="datasourcewebsiteurl" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='datasource']/websiteurl"/>
11
		<FIELD indexable="true" name="datasourcelogourl" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='datasource']/logourl"/>
12
		<FIELD indexable="true" name="datasourcecontactemail" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='datasource']/contactemail"/>
13
		<FIELD indexable="true" name="datasourceoddescription" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='datasource']/oddescription"/>
14
		<FIELD indexable="true" name="datasourceodnumberofitems" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='datasource']/odnumberofitems"/>
15
		<FIELD indexable="true" name="datasourceodnumberofitemsdate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='datasource']/odnumberofitemsdate"/>
16
		<FIELD indexable="true" name="datasourceodsubjects" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/odsubjects"/>
17
		<FIELD indexable="true" name="datasourceodlanguages" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/odlanguages"/>
18
		<FIELD indexable="true" name="datasourceodcontenttypes" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/odcontenttypes"/>
19
		<FIELD indexable="true" name="datasourcetypeid" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetype/@classid"/>
20
		<FIELD indexable="true" name="datasourcetypename" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetype/@classname"/>
21
		<FIELD indexable="true" name="datasourcetypeuiid" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetypeui/@classid"/>
22
		<FIELD indexable="true" name="datasourcetypeuiname" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetypeui/@classname"/>
23
		<FIELD indexable="true" name="datasourcecompatibilityid" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/openairecompatibility/@classid"/>
24
		<FIELD indexable="true" name="datasourcecompatibilityname" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='datasource']/openairecompatibility/@classname"/>
25

  
26
		<!-- ORGANIZATION FIELDS -->
27
		<FIELD indexable="true" name="organizationlegalshortname" result="false" stat="false" type="ngramtext" value="//*[local-name()='entity']/*[local-name()='organization']/legalshortname"/>
28
		<FIELD indexable="true" name="organizationlegalname" result="false" stat="false" type="ngramtext" value="//*[local-name()='entity']/*[local-name()='organization']/legalname"/>
29
		<FIELD indexable="true" name="organizationwebsiteurl" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/websiteurl"/>
30
		<FIELD indexable="true" name="organizationlogourl" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/logourl"/>
31
		<FIELD indexable="true" name="organizationeclegalbody" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/eclegalbody"/>
32
		<FIELD indexable="true" name="organizationeclegalperson" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/eclegalperson"/>
33
		<FIELD indexable="true" name="organizationecnonprofit" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/ecnonprofit"/>
34
		<FIELD indexable="true" name="organizationecresearchorganization" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/ecresearchorganization"/>
35
		<FIELD indexable="true" name="organizationecinternationalorganizationeurinterests" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/ecinternationalorganizationeurinterests"/>
36
		<FIELD indexable="true" name="organizationecinternationalorganization" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/ecinternationalorganization"/>
37
		<FIELD indexable="true" name="organizationecenterprise" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/ecenterprise"/>
38
		<FIELD indexable="true" name="organizationecsmevalidated" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/ecsmevalidated"/>
39
		<FIELD indexable="true" name="organizationecnutscode" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/ecnutscode"/>
40
		<FIELD indexable="true" name="organizationcollectedfrom" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='organization']/collectedfrom"/>
41
		<FIELD indexable="true" name="organizationcountryid" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='organization']/country/@classid"/>
42
		<FIELD indexable="true" name="organizationcountryname" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='organization']/country/@classname"/>
43

  
44
		<!-- PERSON FIELDS -->
45
		<FIELD indexable="true" name="personfirstname" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='person']/firstname"/>
46
		<FIELD indexable="true" name="personsecondnames" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='person']/secondnames"/>
47
		<FIELD indexable="true" name="personfullname" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='person']/fullname"/>
48
		<FIELD indexable="true" name="personfax" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='person']/fax"/>
49
		<FIELD indexable="true" name="personemail" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='person']/email"/>
50
		<FIELD indexable="true" name="personphone" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='person']/phone"/>
51
		<FIELD indexable="true" name="personcollectedfrom" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='person']/collectedfrom"/>
52
		<FIELD indexable="true" name="personcountryid" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='person']/nationality/@classid"/>
53
		<FIELD indexable="true" name="personcountryname" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='person']/nationality/@classname"/>
54

  
55
		<!-- PROJECT FIELDS -->
56
		<FIELD indexable="true" name="projectwebsiteurl" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/websiteurl"/>
57
		<FIELD indexable="true" name="projectcode" result="false" stat="false" type="ngramtext" value="//*[local-name()='entity']/*[local-name()='project']/code"/>
58
		<FIELD indexable="true" name="projectacronym" result="false" stat="false" type="ngramtext" value="//*[local-name()='entity']/*[local-name()='project']/acronym"/>
59
		<FIELD indexable="true" name="projecttitle" result="false" stat="false" type="ngramtext" value="//*[local-name()='entity']/*[local-name()='project']/title"/>
60
		<FIELD indexable="true" name="projectstartdate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='project']/startdate"/>
61
		<FIELD indexable="true" name="projectstartyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='project']/startdate)"/>
62
		<FIELD indexable="true" name="projectenddate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='project']/enddate"/>
63
		<FIELD indexable="true" name="projectendyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='project']/enddate)"/>
64
		<FIELD indexable="true" name="projectcallidentifier" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/callidentifier"/>
65
		<FIELD indexable="true" name="projectkeywords" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/keywords"/>
66
		<FIELD indexable="true" name="projectduration" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/duration"/>
67
		<FIELD indexable="true" name="projectecsc39" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/ecsc39"/>
68
		<FIELD indexable="true" name="projectcollectedfrom" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/collectedfrom"/>
69
		<FIELD indexable="true" name="projectcontracttypeid" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/contracttype/@classid"/>
70
		<FIELD indexable="true" name="projectcontracttypename" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/contracttype/@classname"/>
71
		<FIELD indexable="true" name="fundinglevel0_id" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/id"/>
72
		<FIELD indexable="true" name="fundinglevel0_name" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/name"/>
73
		<FIELD indexable="true" name="fundinglevel0_description" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/description"/>
74
		<FIELD indexable="true" name="fundinglevel1_id" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/id"/>
75
		<FIELD indexable="true" name="fundinglevel1_name" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/name"/>
76
		<FIELD indexable="true" name="fundinglevel1_description" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/description"/>
77
		<FIELD indexable="true" name="fundinglevel2_id" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/id"/>
78
		<FIELD indexable="true" name="fundinglevel2_name" result="false" stat="false" tokenizable="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/name"/>
79
		<FIELD indexable="true" name="fundinglevel2_description" result="false" stat="false" value="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/description"/>
80

  
81
		<!-- RESULT FIELDS -->
82
		<FIELD indexable="true" name="resulttitle" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='result']/title"/>
83
		<FIELD indexable="true" name="resulttitleclass" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/title/@classname"/>
84
		<FIELD indexable="true" name="resultsubject" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/subject"/>
85
		<FIELD indexable="true" name="resultsubjectclass" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/subject/@classname"/>
86
		<FIELD indexable="true" name="resultdate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='result']/relevantdate"/>
87
		<FIELD indexable="true" name="resultdateclass" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/relevantdate/@classname"/>
88
		<FIELD indexable="true" name="resultstoragedate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='result']/storagedate"/>
89
		<FIELD indexable="true" name="resultembargoenddate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='result']/embargoenddate"/>
90
		<FIELD indexable="true" name="resultembargoendyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='result']/embargoenddate)"/>
91
		<FIELD indexable="true" name="resulttypeid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/resulttype/@classid"/>
92
		<FIELD indexable="true" name="resulttypename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/resulttype/@classname"/>
93
		<FIELD indexable="true" name="resultlanguageid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/language/@classid"/>
94
		<FIELD indexable="true" name="resultlanguagename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/language/@classname"/>
95
		<FIELD indexable="true" name="resultpublisher" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='result']/*[local-name()='publisher']"/>
96
		<FIELD indexable="true" name="resultdescription" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='result']/*[local-name()='description']"/>
97
		<FIELD indexable="true" name="resultrights" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/licence/@classname"/>
98
		<FIELD indexable="true" name="resultrightsid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/licence/@classid"/>
99
		<FIELD indexable="true" name="resultbestlicense" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/bestlicense/@classname"/>
100
		<FIELD indexable="true" name="resultbestlicenseid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/bestlicense/@classid"/>
101
		<FIELD indexable="true" name="resultidentifier" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/webresource/*[local-name()='identifier']"/>
102
		<FIELD indexable="true" name="resultdateofacceptance" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='result']/dateofacceptance"/>
103
		<FIELD indexable="true" name="resultacceptanceyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='result']/dateofacceptance)"/>
104
		<FIELD indexable="true" name="resulthostingdatasourceid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='hostedby']/@id"/>
105
		<FIELD indexable="true" name="resulthostingdatasourcename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='hostedby']/@name"/>
106
		<FIELD indexable="true" name="resultcollectedfromdatasourceid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/*[local-name()='collectedfrom']/@id"/>
107
		<FIELD indexable="true" name="resultcollectedfromdatasourcename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/*[local-name()='collectedfrom']/@name"/>
108
		<FIELD indexable="true" name="instancetypename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='instancetype']/@classname"/>
109
		<FIELD indexable="true" name="instancetypenameid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='instancetype']/@classid"/>
110
		<FIELD indexable="true" name="resultdupid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//children/result/@objidentifier"/>
111
		<FIELD indexable="true" name="externalrefsite" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//children/externalreference/sitename"/>
112
		<FIELD indexable="true" name="externalreflabel" result="false" stat="false" tokenizable="true" xpath="//*[local-name()='entity']/*//children/externalreference/label"/>
113
		<FIELD indexable="true" name="externalrefclass" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//children/externalreference/qualifier/@classid"/>
114
		<FIELD indexable="true" name="externalrefid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//children/externalreference/refidentifier"/>
115

  
116

  
117
		<!--  REL FIELDS -->
118
		<FIELD indexable="true" name="relpersonid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//rel/to[@type='person']"/>
119
		<FIELD indexable="true" name="relperson" result="false" stat="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='person']/fullname"/>
120
		<FIELD indexable="true" name="relprojectid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//rel/to[@type='project']"/>
121
		<FIELD indexable="true" name="relprojectcode" result="false" stat="false" xpath="//*[local-name()='entity']/*//rel[to/@type='project']/code"/>
122
		<FIELD indexable="true" name="relprojectname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='project']/acronym"/>
123
		<FIELD indexable="true" name="relprojecttitle" result="false" stat="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='project']/title"/>
124
		<FIELD indexable="true" name="relcontracttypeid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='project']/contracttype/@classid"/>
125
		<FIELD indexable="true" name="relcontracttypename" result="false" stat="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='project']/contracttype/@classname"/>
126
		<FIELD indexable="true" name="relorganizationcountryid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classid"/>
127
		<FIELD indexable="true" name="relorganizationcountryname" result="false" stat="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classname"/>
128
		<FIELD indexable="true" name="relorganizationid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//rel/to[@type='organization']"/>
129
		<FIELD indexable="true" name="relorganizationname" result="false" stat="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='organization']/legalname"/>
130
		<FIELD indexable="true" name="relorganizationshortname" result="false" stat="false" xpath="//*[local-name()='entity']/*//rel[./to/@type='organization']/legalshortname"/>
131
		<FIELD indexable="true" name="relresultid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//rel/to[@type='result']"/>
132
		<FIELD indexable="true" name="relfundinglevel0_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_0"/>
133
		<FIELD indexable="true" name="relfundinglevel1_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_1"/>
134
		<FIELD indexable="true" name="relfundinglevel2_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_2"/>
135
		<FIELD indexable="true" name="relinferred" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/@inferred"/>
136
		<FIELD indexable="true" name="reltrust" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/@trust"/>
137
		<FIELD indexable="true" name="relinferenceprovenance" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/@inferenceprovenance"/>
138
		<FIELD indexable="true" name="relprovenanceactionclassid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/@provenanceaction"/>
139

  
140
		<!-- COMMON FIELDS -->
141
		<FIELD indexable="true" name="dateofcollection" result="false" stat="false" type="date" value="//header/*[local-name()='dateOfCollection']"/>
142
		<FIELD indexable="true" name="collectedfromdatasourceid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//*[local-name()='collectedfrom']/@id"/>
143
		<FIELD indexable="true" name="collectedfromdatasourcename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//*[local-name()='collectedfrom']/@name"/>
144
		<FIELD indexable="true" name="pid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//pid"/>
145
		<FIELD indexable="true" name="pidclassid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//pid/@classid"/>
146
		<FIELD indexable="true" name="pidclassname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//pid/@classname"/>
147
		<FIELD indexable="true" name="h1" result="false" stat="false" stored="false" tokenizable="false" value="dnet:randomInt(100)"/>
148
		<FIELD indexable="true" name="h2" result="false" stat="false" stored="false" tokenizable="false" value="dnet:randomInt(100)"/>
149
		<FIELD indexable="true" name="inferred" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//datainfo/inferred"/>
150
		<FIELD indexable="true" name="deletedbyinference" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//datainfo/deletedbyinference"/>
151
		<FIELD indexable="true" name="trust" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//datainfo/trust"/>
152
		<FIELD indexable="true" name="inferenceprovenance" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//datainfo/inferenceprovenance"/>
153
		<FIELD indexable="true" name="provenanceactionclassid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//datainfo/provenanceaction/@classid"/>
154
		<FIELD indexable="true" name="contextid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/context/@id"/>
155
		<FIELD indexable="true" name="contexttype" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/context/@type"/>
156
		<FIELD indexable="true" name="contextname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/context/@label"/>
157
		<FIELD indexable="true" name="categoryid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/context/category/@id"/>
158
		<FIELD indexable="true" name="categoryname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/context/category/@label"/>
159
		<FIELD indexable="true" name="conceptid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/context/category//concept/@id"/>
160
		<FIELD indexable="true" name="conceptname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/context/category//concept/@label"/>
161

  
162
		<!-- COUNTER FIELDS -->
163
		<FIELD name="counter_dedup" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_dedup/@value" type="int" indexable="true" header="true" stored="true"/>
164
		<FIELD name="counter_authorship" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_authorship/@value" type="int" indexable="true" header="true" stored="true"/>
165
		<FIELD name="counter_participation" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_participation/@value" type="int" indexable="true" header="true" stored="true"/>
166
		<FIELD name="counter_outcome" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_outcome/@value" type="int" indexable="true" header="true" stored="true"/>
167
		<FIELD name="counter_contactperson" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_contactperson/@value" type="int" indexable="true" header="true" stored="true"/>
168
		<FIELD name="counter_provision" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_provision/@value" type="int" indexable="true" header="true" stored="true"/>
169
		<FIELD name="counter_similarity" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_similarity/@value" type="int" indexable="true" header="true" stored="true"/>
170
		<FIELD name="counter_publicationdataset" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_publicationdataset/@value" type="int" indexable="true" header="true" stored="true"/>
171
	</FIELDS>
172
</LAYOUT>
modules/dnet-directindex-api/trunk/src/test/java/eu/dnetlib/openaire/directindex/utils/OpenaireLayoutToRecordStylesheetTest.java
6 6
import eu.dnetlib.functionality.index.solr.feed.StreamingInputDocumentFactory;
7 7
import eu.dnetlib.miscutils.datetime.DateUtils;
8 8
import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
9
import eu.dnetlib.miscutils.functional.xml.IndentXmlString;
10 9
import org.apache.commons.io.IOUtils;
11 10
import org.apache.solr.common.SolrInputDocument;
12
import org.dom4j.Document;
13
import org.dom4j.DocumentException;
14
import org.dom4j.Node;
15
import org.dom4j.io.SAXReader;
16 11
import org.junit.Test;
17 12
import org.springframework.core.io.ClassPathResource;
18 13

  
......
32 27
import static org.junit.Assert.assertFalse;
33 28
import static org.junit.Assert.assertNotNull;
34 29

  
30

  
35 31
public class OpenaireLayoutToRecordStylesheetTest {
36 32

  
37
	private static final String OPENAIRE_LAYOUT_TO_RECORD_STYLESHEET_XSL = "/eu/dnetlib/msro/openaireplus/workflows/index/openaireLayoutToRecordStylesheet.xsl";
33
	private static final String OPENAIRE_LAYOUT_TO_RECORD_STYLESHEET_XSL = "eu/dnetlib/openaire/directindex/utils/openaireLayoutToRecordStylesheet.xsl";
38 34

  
39 35
	private static final String MDFORMAT_FIELDS_PROFILE = "eu/dnetlib/openaire/directindex/utils/2-8b9503d9-8a86-4330-93ef-7e0cd9bc87c2.xml";
40 36

  
41 37
	private static final String OAF_RECORD = "eu/dnetlib/openaire/directindex/utils/oafRecord.xml";
42 38

  
43
	private final static String[] dateFormats = { "yyyy-MM-dd'T'hh:mm:ss", "yyyy-MM-dd", "dd-MM-yyyy", "dd/MM/yyyy", "yyyy" };
44 39

  
40

  
45 41
	@Test
46
	public void testConvertRecord() throws IOException, TransformerException, XMLStreamException, DocumentException {
47
		String xsl = prepareXslt("DMF");
48
		assertNotNull(xsl);
49
		assertFalse(xsl.isEmpty());
50

  
51
		System.out.println(xsl);
52

  
53
		ApplyXslt xslt = new ApplyXslt(xsl);
54

  
55
		String indexRecord = xslt.evaluate(readFromClasspath(OAF_RECORD));
56

  
57
		assertNotNull(indexRecord);
58
		assertFalse(indexRecord.isEmpty());
59

  
60
		System.out.println(IndentXmlString.apply(indexRecord));
61

  
42
	public void directIndexOafToIndexTest() throws IOException, TransformerException, XMLStreamException {
43
		final Transformer layoutTransformer = TransformerFactory.newInstance().newTransformer(streamSource(OPENAIRE_LAYOUT_TO_RECORD_STYLESHEET_XSL));
44
		final StreamResult layoutToXsltXslt = new StreamResult(new StringWriter());
45
		layoutTransformer.setParameter("format", "DMF");
46
		layoutTransformer.transform(new StreamSource(new StringReader(getLayoutSource("DMF"))), layoutToXsltXslt);
47
		ApplyXslt applyXslt = new ApplyXslt(layoutToXsltXslt.getWriter().toString());
48
		String indexRecord = applyXslt.evaluate(readFromClasspath(OAF_RECORD));
49
		//System.out.println(indexRecord);
62 50
		StreamingInputDocumentFactory factory = new StreamingInputDocumentFactory();
63 51

  
64 52
		SolrInputDocument doc = factory.parseDocument(DateUtils.now_ISO8601(), indexRecord, "dsId", "dnetResult");
65 53
		assertNotNull(doc);
66 54
		assertFalse(doc.isEmpty());
55
		assertFalse(doc.containsKey("__dsid"));
56
		assertFalse(doc.containsKey("__dsversion"));
57
		assertFalse(doc.containsKey("__deleted"));
67 58

  
68
		System.out.println("SolrDocument");
69

  
70
		System.out.println(doc.values());
71

  
72
		System.out.println("SolrDocument fields");
73

  
74
		Map<String, Object> fields = Maps.newHashMap();
75

  
76
		doc.entrySet().stream()
77
				.forEach(e -> {
78
					Object value = e.getValue().getValueCount() == 1 ? e.getValue().getFirstValue() : e.getValue().getValues();
79
					fields.put(e.getKey(), value);
80
				});
81

  
82
		//new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(fields);
83

  
84
		final ObjectWriter objectWriter = new ObjectMapper()
85
				.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"))
86
				.writerWithDefaultPrettyPrinter();
87

  
88
		System.out.println(objectWriter.writeValueAsString(fields));
59
//		System.out.println("SolrDocument");
60
//
61
//		System.out.println(doc.values());
62
//
63
//		System.out.println("SolrDocument fields");
64
//
65
//		Map<String, Object> fields = Maps.newHashMap();
66
//
67
//		doc.entrySet().stream()
68
//				.forEach(e -> {
69
//					Object value = e.getValue().getValueCount() == 1 ? e.getValue().getFirstValue() : e.getValue().getValues();
70
//					fields.put(e.getKey(), value);
71
//				});
72
//
73
//		final ObjectWriter objectWriter = new ObjectMapper()
74
//				.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"))
75
//				.writerWithDefaultPrettyPrinter();
76
//
77
//		System.out.println(objectWriter.writeValueAsString(fields));
89 78
	}
90 79

  
91
	protected String prepareXslt(final String format) throws IOException, TransformerException, DocumentException {
92

  
93
		final Transformer layoutTransformer = TransformerFactory.newInstance().newTransformer(streamSource(OPENAIRE_LAYOUT_TO_RECORD_STYLESHEET_XSL));
94

  
95
		final StreamResult result = new StreamResult(new StringWriter());
96

  
97
		layoutTransformer.setParameter("format", format);
98

  
99
		final StreamSource fields = indexFieldsFromProfile(MDFORMAT_FIELDS_PROFILE);
100

  
101
		layoutTransformer.transform(fields , result);
102

  
103
		return result.getWriter().toString();
80
	private String getLayoutSource(final String format) throws IOException {
81
		return readFromClasspath(MDFORMAT_FIELDS_PROFILE);
104 82
	}
105 83

  
106 84
	private StreamSource streamSource(final String s) throws IOException {
......
113 91
		return IOUtils.toString(inputStream);
114 92
	}
115 93

  
116
	private StreamSource indexFieldsFromProfile(final String path) throws IOException, DocumentException {
117
		final Document doc = new SAXReader().read(new StringReader(readFromClasspath(path)));
118
		final Node layout = doc.selectSingleNode("//LAYOUT[@name='index']");
119
		return new StreamSource(new StringReader(layout.asXML()));
120
	}
121 94

  
95

  
122 96
}
123 97

  
124 98

  
modules/dnet-directindex-api/trunk/src/test/resources/eu/dnetlib/openaire/directindex/utils/2-8b9503d9-8a86-4330-93ef-7e0cd9bc87c2.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="2-8b9503d9-8a86-4330-93ef-7e0cd9bc87c2_TURGb3JtYXREU1Jlc291cmNlcy9NREZvcm1hdERTUmVzb3VyY2VUeXBl"/>
4
        <RESOURCE_TYPE value="MDFormatDSResourceType"/>
5
        <RESOURCE_KIND value="MDFormatDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2008-05-22T14:40:04+02:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <NAME>DMF</NAME>
12
            <DESCRIPTION>Openaire Metadata Format</DESCRIPTION>
13
            <INTERPRETATION>openaire</INTERPRETATION>
14
            <SCHEMA uri=""/>
15
        </CONFIGURATION>
16
        <STATUS>
17
            <LAYOUTS>
18
                <LAYOUT name="index">
19
	                <FIELDS>
20
		                <FIELD name="oafentity" xpath="//*[local-name() = 'entity']" indexable="false" tokenizable="false" result="true" stat="false"/>
21
		                <FIELD name="oaftype" value="local-name(//*[local-name()='entity']/*)" tokenizable="false" result="false" indexable="true"
22
		                       stat="false"/>
23
		                <FIELD name="objIdentifier" indexable="true" tokenizable="false" xpath="//header/dri:objIdentifier" stat="false" result="false"/>
24 1

  
25
		                <!-- DATASOURCE FIELDS -->
26
		                <FIELD name="datasourceofficialname" xpath="//*[local-name()='entity']/*[local-name()='datasource']/officialname" stat="false"
27
		                       indexable="true" result="false"/>
28
		                <FIELD name="datasourceenglishname" xpath="//*[local-name()='entity']/*[local-name()='datasource']/englishname" stat="false"
29
		                       indexable="true" result="false"/>
30

  
31
		                <FIELD name="datasourceoddescription" xpath="//*[local-name()='entity']/*[local-name()='datasource']/oddescription" stat="false"
32
		                       indexable="true" result="false"/>
33
		                <FIELD name="datasourceodsubjects" xpath="//*[local-name()='entity']/*[local-name()='datasource']/odsubjects" stat="false"
34
		                       tokenizable="false" indexable="true" result="false"/>
35
		                <FIELD name="datasourceodlanguages" xpath="//*[local-name()='entity']/*[local-name()='datasource']/odlanguages" stat="false"
36
		                       tokenizable="false" indexable="true" result="false"/>
37
		                <FIELD name="datasourceodcontenttypes" xpath="//*[local-name()='entity']/*[local-name()='datasource']/odcontenttypes" stat="false"
38
		                       tokenizable="false" indexable="true" result="false"/>
39

  
40
		                <FIELD name="datasourcetypename" xpath="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetype/@classname"
41
		                       tokenizable="false" stat="false" indexable="true" result="false" multivalued="false"/>
42

  
43
		                <FIELD name="datasourcetypeuiid" xpath="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetypeui/@classid"
44
		                       tokenizable="false" stat="false" indexable="true" result="false" multivalued="false"/>
45
		                <FIELD name="datasourcetypeuiname" xpath="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetypeui/@classname"
46
		                       tokenizable="false" stat="false" indexable="true" result="false" multivalued="false"/>
47

  
48
		                <FIELD name="datasourcecompatibilityid"
49
		                       xpath="//*[local-name()='entity']/*[local-name()='datasource']/openairecompatibility/@classid" tokenizable="false" stat="false"
50
		                       indexable="true" result="false" multivalued="false"/>
51
		                <FIELD name="datasourcecompatibilityname"
52
		                       xpath="//*[local-name()='entity']/*[local-name()='datasource']/openairecompatibility/@classname" tokenizable="false" stat="false"
53
		                       indexable="true" result="false" multivalued="false"/>
54

  
55
		                <FIELD name="datasourcesubject" xpath="//*[local-name()='entity']/*[local-name()='datasource']/subjects" type="ngramtext" stat="false" result="false" indexable="true" multivalued="true"/>
56
						<FIELD name="versioning" xpath="//*[local-name()='entity']/*[local-name()='datasource']/versioning" stat="false"  tokenizable="false" indexable="true" result="false"/>
57

  
58
						<!-- datasource fields for EOSC -->
59
						<FIELD name="datasourcejurisdiction" xpath="//*[local-name()='entity']/*[local-name()='datasource']/jurisdiction" stat="false"  tokenizable="false" indexable="true" result="false"/>
60
						<FIELD name="datasourcethematic" xpath="//*[local-name()='entity']/*[local-name()='datasource']/thematic" stat="false"  tokenizable="false" indexable="true" result="false"/>
61
						<FIELD name="datasourceknowledge_graph" xpath="//*[local-name()='entity']/*[local-name()='datasource']/knowledgegraph" stat="false"  tokenizable="false" indexable="true" result="false"/>
62
						<FIELD name="datasourcecontentpolicy" xpath="//*[local-name()='entity']/*[local-name()='datasource']/contentpolicy" stat="false"  tokenizable="false" indexable="true" result="false"/>
63

  
64
		                <!-- ORGANIZATION FIELDS -->
65
		                <FIELD name="organizationlegalshortname" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='organization']//legalshortname)"
66
		                       type="ngramtext" stat="false" indexable="true" result="false"/>
67
		                <FIELD name="organizationlegalname" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='organization']//legalname)" type="ngramtext"
68
		                       stat="false" indexable="true" result="false"/>
69
						<FIELD name="organizationalternativenames" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='organization']//alternativeNames)"
70
							   indexable="true" type="ngramtext" stat="false" result="false"/>
71
						<FIELD name="organizationeclegalbody" xpath="//*[local-name()='entity']/*[local-name()='organization']/eclegalbody" stat="false"
72
		                       indexable="true" result="false"/>
73
		                <FIELD name="organizationeclegalperson" xpath="//*[local-name()='entity']/*[local-name()='organization']/eclegalperson" stat="false"
74
		                       indexable="true" result="false"/>
75
		                <FIELD name="organizationecnonprofit" xpath="//*[local-name()='entity']/*[local-name()='organization']/ecnonprofit" stat="false"
76
		                       indexable="true" result="false"/>
77
		                <FIELD name="organizationecresearchorganization"
78
		                       xpath="//*[local-name()='entity']/*[local-name()='organization']/ecresearchorganization" stat="false" indexable="true"
79
		                       result="false"/>
80
		                <FIELD name="organizationecinternationalorganizationeurinterests"
81
		                       xpath="//*[local-name()='entity']/*[local-name()='organization']/ecinternationalorganizationeurinterests" stat="false"
82
		                       indexable="true" result="false"/>
83
		                <FIELD name="organizationecinternationalorganization"
84
		                       xpath="//*[local-name()='entity']/*[local-name()='organization']/ecinternationalorganization" stat="false" indexable="true"
85
		                       result="false"/>
86
		                <FIELD name="organizationecenterprise" xpath="//*[local-name()='entity']/*[local-name()='organization']/ecenterprise" stat="false"
87
		                       indexable="true" result="false"/>
88
		                <FIELD name="organizationecsmevalidated" xpath="//*[local-name()='entity']/*[local-name()='organization']/ecsmevalidated" stat="false"
89
		                       indexable="true" result="false"/>
90
		                <FIELD name="organizationecnutscode" xpath="//*[local-name()='entity']/*[local-name()='organization']/ecnutscode" stat="false"
91
		                       indexable="true" result="false"/>
92

  
93
		                <FIELD name="organizationcountryname" xpath="//*[local-name()='entity']/*[local-name()='organization']/country/@classname"
94
		                       tokenizable="false" stat="false" indexable="true" result="false" multivalued="false"/>
95

  
96
		                <!-- PROJECT FIELDS -->
97
		                <FIELD name="projectcode" xpath="//*[local-name()='entity']/*[local-name()='project']/code" type="ngramtext" stat="false"
98
		                       indexable="true" result="false"/>
99
		                <FIELD name="projectcode_nt" xpath="//*[local-name()='entity']/*[local-name()='project']/code" stat="false" tokenizable="false"
100
		                       indexable="true" result="false"/>
101
		                <FIELD name="projectacronym" xpath="//*[local-name()='entity']/*[local-name()='project']/acronym" type="ngramtext" stat="false"
102
		                       indexable="true" result="false"/>
103
		                <FIELD name="projecttitle" xpath="//*[local-name()='entity']/*[local-name()='project']/title" type="ngramtext" stat="false"
104
		                       indexable="true" result="false"/>
105
		                <FIELD name="projectstartdate" value="//*[local-name()='entity']/*[local-name()='project']/startdate" type="pdate" stat="false"
106
		                       indexable="true" result="false" multivalued="false"/>
107
		                <FIELD name="projectstartyear" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='project']/startdate)"
108
		                       tokenizable="false" stat="false" indexable="true" result="false" multivalued="false"/>
109
		                <FIELD name="projectenddate" value="//*[local-name()='entity']/*[local-name()='project']/enddate" type="pdate" stat="false"
110
		                       indexable="true" result="false" multivalued="false"/>
111
		                <FIELD name="projectendyear" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='project']/enddate)" tokenizable="false"
112
		                       stat="false" indexable="true" result="false" multivalued="false"/>
113
		                <FIELD name="projectcallidentifier" xpath="//*[local-name()='entity']/*[local-name()='project']/callidentifier" tokenizable="false"
114
		                       stat="false" indexable="true" result="false" multivalued="false"/>
115
		                <FIELD name="projectkeywords" xpath="//*[local-name()='entity']/*[local-name()='project']/keywords" stat="false" indexable="true"
116
		                       result="false"/>
117
		                <FIELD name="projectduration" xpath="//*[local-name()='entity']/*[local-name()='project']/duration" tokenizable="false" stat="false"
118
		                       indexable="true" result="false" multivalued="false"/>
119
		                <FIELD name="projectecsc39" xpath="//*[local-name()='entity']/*[local-name()='project']/ecsc39" tokenizable="false" stat="false"
120
		                       indexable="true" result="false" multivalued="false"/>
121
		                <FIELD name="projectoamandatepublications" xpath="//*[local-name()='entity']/*[local-name()='project']/oamandatepublications"
122
		                       tokenizable="false" stat="false" indexable="true" result="false" multivalued="false"/>
123
		                <FIELD name="projectecarticle29_3" xpath="//*[local-name()='entity']/*[local-name()='project']/ecarticle29_3" tokenizable="false"
124
		                       stat="false" indexable="true" result="false" multivalued="false"/>
125
		                <FIELD name="projectsubject" xpath="//*[local-name()='entity']/*[local-name()='project']/subjects" stat="false" tokenizable="false"
126
		                       indexable="true" result="false"/>
127

  
128
		                <FIELD name="projectcontracttypename" xpath="//*[local-name()='entity']/*[local-name()='project']/contracttype/@classname"
129
		                       tokenizable="false" stat="false" indexable="true" result="false" multivalued="false"/>
130
		                <FIELD name="fundinglevel0_id" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/id"
131
		                       tokenizable="false" stat="false" indexable="true" result="false"/>
132
		                <FIELD name="fundinglevel0_name" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/name"
133
		                       tokenizable="false" stat="false" indexable="true" result="false"/>
134
		                <FIELD name="fundinglevel0_description"
135
		                       xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/description" stat="false"
136
		                       indexable="true" result="false"/>
137
		                <FIELD name="fundinglevel1_id" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/id"
138
		                       tokenizable="false" stat="false" indexable="true" result="false"/>
139
		                <FIELD name="fundinglevel1_name" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/name"
140
		                       tokenizable="false" stat="false" indexable="true" result="false"/>
141
		                <FIELD name="fundinglevel1_description"
142
		                       xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/description" stat="false"
143
		                       indexable="true" result="false"/>
144
		                <FIELD name="fundinglevel2_id" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/id"
145
		                       tokenizable="false" stat="false" indexable="true" result="false"/>
146
		                <FIELD name="fundinglevel2_name" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/name"
147
		                       tokenizable="false" stat="false" indexable="true" result="false"/>
148
		                <FIELD name="fundinglevel2_description"
149
		                       xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/description" stat="false"
150
		                       indexable="true" result="false"/>
151
		                <!--  PROJECTS' FUNDER FIELDS: indexable only with the new funding path/context handling -->
152

  
153
		                <FIELD name="funder" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder"
154
		                       value="dnet:join(./id/text(), '||', dnet:join(./name/text(), '||', ./shortname/text()))"
155
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
156

  
157
		                <FIELD name="fundershortname" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder/shortname"
158
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
159
		                <FIELD name="funderid" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder/id" tokenizable="false"
160
		                       indexable="true" result="false" stat="false"/>
161
		                <FIELD name="fundername" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder/name" tokenizable="false"
162
		                       indexable="true" result="false" stat="false"/>
163
		                <FIELD indexable="true" name="funderoriginalname" result="false" stat="false" tokenizable="false"
164
		                       xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder/originalname"/>
165
		                <FIELD name="funderjurisdiction" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder/jurisdiction"
166
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
167

  
168
		                <!-- RESULT FIELDS -->
169
		                <FIELD name="resulttitle"
170
		                       xpath="//*[local-name() = 'entity']/*[local-name() ='result']/title | //*[local-name()='entity']/*[local-name()='result']/children/result/title"
171
		                       stat="false" result="false" indexable="true"/>
2
				<LAYOUT name="index">
3
					<FIELDS>
4
						<FIELD indexable="true" name="oaftype" result="false" stat="false" tokenizable="false" value="local-name(//*[local-name()='entity']/*[local-name() != 'extraInfo'])"/>
5
						<FIELD indexable="true" name="objidentifier" result="false" stat="false" tokenizable="false" xpath="//header/dri:objIdentifier"/><!-- DATASOURCE FIELDS -->
6
						<FIELD copy="true" indexable="true" name="datasourceofficialname" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/officialname"/>
7
						<FIELD copy="true" indexable="true" name="datasourceenglishname" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/englishname"/>
8
						<FIELD copy="true" indexable="false" name="datasourceoddescription" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/oddescription"/>
9
						<FIELD copy="true" indexable="true" name="datasourceodsubjects" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/odsubjects"/>
10
						<FIELD indexable="true" name="datasourceodlanguages" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/odlanguages"/>
11
						<FIELD indexable="true" name="datasourceodcontenttypes" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/odcontenttypes"/>
12
						<FIELD indexable="true" multivalued="false" name="datasourcetypename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetype/@classname"/>
13
						<FIELD indexable="true" multivalued="false" name="datasourcetypeuiid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetypeui/@classid"/>
14
						<FIELD indexable="true" multivalued="false" name="datasourcetypeuiname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/datasourcetypeui/@classname"/>
15
						<FIELD indexable="true" multivalued="false" name="datasourcecompatibilityid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/openairecompatibility/@classid"/>
16
						<FIELD indexable="true" multivalued="false" name="datasourcecompatibilityname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/openairecompatibility/@classname"/>
17
						<FIELD copy="true" indexable="true" multivalued="true" name="datasourcesubject" result="false" stat="false" type="ngramtext" xpath="//*[local-name()='entity']/*[local-name()='datasource']/subjects"/><!-- datasource fields for EOSC -->
18
						<FIELD indexable="true" name="datasourcejurisdiction" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/jurisdiction/@classname"/>
19
						<FIELD indexable="true" name="datasourcethematic" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/thematic"/>
20
						<FIELD indexable="true" name="eosctype" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/eosctype/@classname"/>
21
						<FIELD indexable="true" name="eoscdatasourcetype" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='datasource']/eoscdatasourcetype/@classname"/><!-- ORGANIZATION FIELDS -->
22
						<FIELD copy="true" indexable="true" name="organizationlegalshortname" result="false" stat="false" type="ngramtext" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='organization']//legalshortname)"/>
23
						<FIELD copy="true" indexable="true" name="organizationlegalname" result="false" stat="false" type="ngramtext" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='organization']//legalname)"/>
24
						<FIELD copy="true" indexable="false" name="organizationalternativenames" result="false" stat="false" type="ngramtext" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='organization']//alternativeNames)"/><!-- PROJECT FIELDS -->
25
						<FIELD copy="true" indexable="false" name="projectcode" result="false" stat="false" type="ngramtext" xpath="//*[local-name()='entity']/*[local-name()='project']/code"/>
26
						<FIELD indexable="true" name="projectcode_nt" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/code"/>
27
						<FIELD copy="true" indexable="true" name="projectacronym" result="false" stat="false" type="ngramtext" xpath="//*[local-name()='entity']/*[local-name()='project']/acronym"/>
28
						<FIELD copy="true" indexable="true" name="projecttitle" result="false" stat="false" type="ngramtext" xpath="//*[local-name()='entity']/*[local-name()='project']/title"/>
29
						<FIELD indexable="true" multivalued="false" name="projectstartdate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='project']/startdate"/>
30
						<FIELD indexable="true" multivalued="false" name="projectstartyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='project']/startdate)"/>
31
						<FIELD indexable="true" multivalued="false" name="projectenddate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='project']/enddate"/>
32
						<FIELD indexable="true" multivalued="false" name="projectendyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='project']/enddate)"/>
33
						<FIELD indexable="true" multivalued="false" name="projectcallidentifier" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/callidentifier"/>
34
						<FIELD copy="true" indexable="false" name="projectkeywords" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='project']/keywords"/>
35
						<FIELD indexable="true" multivalued="false" name="projectduration" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/duration"/>
36
						<FIELD indexable="true" multivalued="false" name="projectecsc39" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='project']/ecsc39)"/>
37
						<FIELD indexable="true" multivalued="false" name="projectoamandatepublications" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/oamandatepublications"/>
38
						<FIELD indexable="true" name="fundinglevel0_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/id"/>
39
						<FIELD indexable="true" name="fundinglevel0_name" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/name"/>
40
						<FIELD copy="true" indexable="false" name="fundinglevel0_description" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_0/description"/>
41
						<FIELD indexable="true" name="fundinglevel1_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/id"/>
42
						<FIELD indexable="true" name="fundinglevel1_name" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/name"/>
43
						<FIELD copy="true" indexable="false" name="fundinglevel1_description" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_1/description"/>
44
						<FIELD indexable="true" name="fundinglevel2_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/id"/>
45
						<FIELD indexable="true" name="fundinglevel2_name" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/name"/>
46
						<FIELD copy="true" indexable="false" name="fundinglevel2_description" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree//funding_level_2/description"/><!--  PROJECTS' FUNDER FIELDS: indexable only with the new funding path/context handling -->
47
						<FIELD indexable="true" name="funder" result="false" stat="false" tokenizable="false" value="concat(./id/text(), '||', ./name/text(), '||', ./shortname/text())" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder"/>
48
						<FIELD indexable="true" name="fundershortname" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder/shortname"/>
49
						<FIELD indexable="true" name="funderid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='project']/fundingtree/funder/id"/><!-- RESULT FIELDS -->
50
						<FIELD copy="true" indexable="true" name="resulttitle" result="false" stat="false" type="text_en" xpath="//*[local-name() = 'entity']/*[local-name() ='result']/title | //*[local-name()='entity']/*[local-name()='result']/children/result/title"/>
172 51
						<FIELD indexable="true" name="resultsubject" result="false" stat="false" type="text_en" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/subject)"/>
173
						<FIELD indexable="true" name="resultsubjectclass" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/subject/@classname)"/>
174
		                <FIELD name="resultembargoenddate" value="//*[local-name()='entity']/*[local-name()='result']/embargoenddate" type="pdate" stat="false"
175
		                       result="false" indexable="true" multivalued="false"/>
176
		                <FIELD name="resultembargoendyear" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='result']/embargoenddate)"
177
		                       tokenizable="false" stat="false" result="false" indexable="true" multivalued="false"/>
178
		                <FIELD name="resulttypeid" xpath="//*[local-name()='entity']/*[local-name()='result']/resulttype/@classid" tokenizable="false"
179
		                       stat="false" result="false" indexable="true" multivalued="false"/>
180
		                <FIELD name="resulttypename" xpath="//*[local-name()='entity']/*[local-name()='result']/resulttype/@classname" tokenizable="false"
181
		                       stat="false" result="false" indexable="true" multivalued="false"/>
182
		                <FIELD name="resultlanguagename" xpath="//*[local-name()='entity']/*[local-name()='result']/language/@classname" tokenizable="false"
183
		                       indexable="true" result="false" stat="false" multivalued="false"/>
184
		                <FIELD name="resultpublisher" xpath="//*[local-name()='entity']/*[local-name()='result']/*[local-name()='publisher']" indexable="true"
185
		                       result="false" stat="false"/>
186
		                <FIELD name="resultdescription" xpath="//*[local-name()='entity']/*[local-name()='result']//*[local-name()='description']"
187
		                       result="false" indexable="true" stat="false"/>
188
		                <FIELD name="resultlicense" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/license"
189
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
190
		                <FIELD name="resultaccessright" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/accessright/@classname"
191
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
192
		                <FIELD name="resultbestaccessright" xpath="//*[local-name()='entity']/*[local-name()='result']/bestaccessright/@classname" tokenizable="false"
193
		                       indexable="true" result="false" stat="false" multivalued="false"/>
194
		                <FIELD name="resultdateofacceptance" value="//*[local-name()='entity']/*[local-name()='result']/dateofacceptance" type="pdate"
195
		                       stat="false" result="false" indexable="true" multivalued="false"/>
196
		                <FIELD name="resultacceptanceyear" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='result']/dateofacceptance)"
197
		                       tokenizable="false" stat="false" result="false" indexable="true" multivalued="false"/>
198
		                <FIELD name="resultauthor" xpath="//*[local-name()='entity']/*[local-name()='result']/creator"
199
		                       stat="false" result="false" indexable="true" multivalued="true" />
200
		                <FIELD name="resultauthor_nt" xpath="//*[local-name()='entity']/*[local-name()='result']/creator"
201
		                       type="string_ci" stat="false" result="false" indexable="true" multivalued="true" />
202
						<FIELD name="authorid" xpath="//*[local-name()='entity']/*[local-name()='result']/creator/@*[local-name() != 'rank' and local-name() != 'name' and local-name() != 'surname']"
203
							   type="string_ci" stat="false" result="false" indexable="true" multivalued="true" />
204
						<FIELD name="authoridtype" xpath="//*[local-name()='entity']/*[local-name()='result']/creator/@*[local-name() != 'rank' and local-name() != 'name' and local-name() != 'surname']/local-name()"
205
							   type="string_ci" stat="false" result="false" indexable="true" multivalued="true" />
206
						<FIELD name="resulthostingdatasource"
207
		                       xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='hostedby']"
208
		                       value="distinct-values(dnet:join(./@id, '||', ./@name))" tokenizable="false" stat="false" result="false" indexable="true"/>
209
		                <FIELD name="resulthostingdatasourceid"
210
		                       xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='hostedby']/@id)" tokenizable="false"
211
		                       stat="false" result="false" indexable="true"/>
212
		                <FIELD name="resulthostingdatasourcename"
213
		                       xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='hostedby']/@name)"
214
		                       tokenizable="false" stat="false" result="false" indexable="true"/>
215

  
216
		                <FIELD name="instancetypename"
217
		                       xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='instancetype']/@classname)"
218
		                       tokenizable="false" stat="false" result="false" indexable="true"/>
219
		                <FIELD name="resultdupid" xpath="//*[local-name()='entity']/*//children/result/@objidentifier" tokenizable="false" stat="false"
220
		                       result="false" indexable="true"/>
221
						<FIELD name="organizationdupid" xpath="//*[local-name()='entity']/*//children/organization/@objidentifier" tokenizable="false" stat="false"
222
							   result="false" indexable="true"/>
223
		                <FIELD name="externalrefsite" xpath="distinct-values(//*[local-name()='entity']/*//children/externalreference/sitename)" tokenizable="false" stat="false"
224
		                       result="false" indexable="true"/>
225
		                <FIELD name="externalreflabel" xpath="distinct-values(//*[local-name()='entity']/*//children/externalreference/label)" tokenizable="true" stat="false"
226
		                       result="false" indexable="true"/>
227
		                <FIELD name="externalrefclass" xpath="distinct-values(//*[local-name()='entity']/*//children/externalreference/qualifier/@classid)" tokenizable="false"
228
		                       stat="false" result="false" indexable="true"/>
229
		                <FIELD name="externalrefid" xpath="(//*[local-name()='entity']/*//children/externalreference/refidentifier)" tokenizable="false"
230
		                       stat="false" result="false" indexable="true"/>
231

  
232
		                <FIELD indexable="true" name="resultidentifier" result="false" stat="false"
233
		                       xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/children/instance/webresource/*[local-name()='url'])"/>
234
		                <FIELD indexable="true" name="resultsource" result="false" stat="false"
235
		                       xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/source)"/>
236

  
237
						<!-- FOS and SDGs non tokenizable for faceted search-->
238
						<FIELD name="fos" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/subject[@classid='FOS'])" tokenizable="false" stat="false"
239
							   result="false" indexable="true"/>
240
						<FIELD name="sdg" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/subject[@classid='SDG'])" tokenizable="false" stat="false"
241
							   result="false" indexable="true"/>
242

  
243
		                <!--  REL FIELDS -->
244
		                <FIELD name="reldatasourcecompatibilityid"
245
		                       xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='datasource']/openairecompatibility/@classid)" tokenizable="false"
246
		                       indexable="true" stat="false" result="false"/>
247

  
248
		                <FIELD name="relproject" xpath="//*[local-name()='entity']/*//rel/to[@type='project']"
249
		                       value="distinct-values(dnet:join(./text(), '||', dnet:pickFirst(../acronym/text(), ../title/text())))"
250
		                       tokenizable="false" stat="false" result="false" indexable="true" />
251

  
252
		                <FIELD name="relprojectid" xpath="distinct-values(//*[local-name()='entity']/*//rel/to[@type='project'])" stat="false" result="false"
253
		                       indexable="true" tokenizable="false"/>
254
		                <FIELD name="relprojectcode" xpath="distinct-values(//*[local-name()='entity']/*//rel[to/@type='project']/code)" stat="false" result="false"
255
							   tokenizable="false" indexable="true"/>
256
		                <FIELD name="relprojectname" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/acronym)" tokenizable="false" stat="false"
257
		                       result="false" indexable="true"/>
258
		                <FIELD name="relprojecttitle" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/title)" stat="false" result="false"
259
		                       indexable="true"/>
260
		                <FIELD name="relcontracttypeid" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/contracttype/@classid)"
261
		                       tokenizable="false" indexable="true" stat="false" result="false"/>
262
		                <FIELD name="relcontracttypename" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/contracttype/@classname)"
263
		                       indexable="true" stat="false" result="false"/>
264
		                <FIELD name="relorganizationcountryid" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classid)"
265
		                       tokenizable="false" indexable="true" stat="false" result="false"/>
266
		                <FIELD name="relorganizationcountryname" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classname)"
267
		                       indexable="true" stat="false" result="false"/>
268
		                <FIELD name="relorganizationid" xpath="distinct-values(//*[local-name()='entity']/*//rel/to[@type='organization'])" tokenizable="false" stat="false"
269
		                       result="false" indexable="true"/>
270
		                <FIELD name="relorganizationname" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/legalname)" stat="false"
271
		                       result="false" indexable="true"/>
272
		                <FIELD name="relorganizationshortname" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/legalshortname)" stat="false"
273
		                       result="false" indexable="true"/>
274
		                <FIELD name="relresultid" xpath="distinct-values(//*[local-name()='entity']/*//rel/to[@type='result'])" tokenizable="false" stat="false" result="false"
275
		                       indexable="true"/>
276
						<FIELD name="relresulttype" xpath="distinct-values(//*[local-name()='entity']/*//rel/resulttype/@classid)" tokenizable="false" stat="false" result="false"
277
							   indexable="true"/>
278
						<FIELD name="relclass" xpath="distinct-values(//*[local-name()='entity']/*//rel/to/@class)" tokenizable="false" stat="false" result="false"
279
							   indexable="true"/>
280
		                <FIELD name="relfundinglevel0_id" xpath="//*[local-name()='entity']//rel/funding/funding_level_0" tokenizable="false" stat="false"
281
		                       result="false" indexable="true"/>
282
						<FIELD name="relfundinglevel0_name" xpath="//*[local-name()='entity']//rel/funding/funding_level_0/@name/string()" tokenizable="false" stat="false"
283
							   result="false" indexable="true"/>
284
		                <FIELD name="relfundinglevel1_id" xpath="//*[local-name()='entity']//rel/funding/funding_level_1" tokenizable="false" stat="false"
285
		                       result="false" indexable="true"/>
286
						<FIELD name="relfundinglevel1_name" xpath="//*[local-name()='entity']//rel/funding/funding_level_1/@name/string()" tokenizable="false" stat="false"
287
							   result="false" indexable="true"/>
288
		                <FIELD name="relfundinglevel2_id" xpath="//*[local-name()='entity']//rel/funding/funding_level_2" tokenizable="false" stat="false"
289
		                       result="false" indexable="true"/>
290
						<FIELD name="relfundinglevel2_name" xpath="//*[local-name()='entity']//rel/funding/funding_level_2/@name/string()" tokenizable="false" stat="false"
291
							   result="false" indexable="true"/>
292

  
293
		                <FIELD name="relinferred" xpath="distinct-values(//*[local-name()='entity']//rel/@inferred)" tokenizable="false" stat="false" result="false"
294
		                       indexable="true"/>
295
		                <FIELD name="reltrust" xpath="distinct-values(//*[local-name()='entity']//rel/@trust)" tokenizable="false" stat="false" result="false" indexable="true"/>
296
		                <FIELD name="relinferenceprovenance" xpath="distinct-values(//*[local-name()='entity']//rel/@inferenceprovenance)" tokenizable="false" stat="false"
297
		                       result="false" indexable="true"/>
298
		                <FIELD name="relprovenanceactionclassid" xpath="distinct-values(//*[local-name()='entity']//rel/@provenanceaction)" tokenizable="false" stat="false"
299
		                       result="false" indexable="true"/>
300

  
301
		                <!--  PROJECTS' FUNDER FIELDS: indexable only with the new funding path/context handling -->
302

  
303
		                <FIELD name="relfunder" xpath="//*[local-name()='entity']//rel/funding/funder" value="distinct-values(dnet:join(@id, '||', dnet:join(@name, '||', @shortname)))"
304
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
305

  
306
		                <FIELD name="relfunderid" xpath="distinct-values(//*[local-name()='entity']//rel/funding/funder/@id)" tokenizable="false" indexable="true"
307
		                       result="false" stat="false"/>
308
		                <FIELD name="relfundershortname" xpath="distinct-values(//*[local-name()='entity']//rel/funding/funder/@shortname)" tokenizable="false" indexable="true"
309
		                       result="false" stat="false"/>
310
		                <FIELD name="relfundername" xpath="distinct-values(//*[local-name()='entity']//rel/funding/funder/@name)" tokenizable="false" indexable="true"
311
		                       result="false" stat="false"/>
312
		                <FIELD name="relfunderjurisdiction" xpath="distinct-values(//*[local-name()='entity']//rel/funding/funder/@jurisdiction)" tokenizable="false"
313
		                       indexable="true" result="false" stat="false"/>
314

  
315
		                <!-- Collected from of the related entity. Available for result-result relationships -->
316
		                <FIELD name="relcollectedfromid" xpath="distinct-values(//*[local-name()='entity']/*//rel/collectedfrom/@id)" tokenizable="false" stat="false" result="false"
317
		                       indexable="true"/>
318
		                <FIELD name="relcollectedfromname" xpath="distinct-values(//*[local-name()='entity']/*//rel/collectedfrom/@name)" tokenizable="false" stat="false" result="false"
319
		                       indexable="true"/>
320

  
321

  
322
		                <!-- COMMON FIELDS -->
323

  
324
		                <FIELD name="dateofcollection" value="//header/*[local-name()='dateOfCollection']" type="pdate" stat="false" result="false"
325
		                       indexable="true" multivalued="false"/>
326

  
327
		                <FIELD name="collectedfrom" xpath="//*[local-name()='entity']/*/*[local-name()='collectedfrom'] | //*[local-name()='entity']/*//*[local-name() = 'instance']/*[local-name()='collectedfrom']"
328
		                       value="distinct-values(dnet:join(./@id, '||', ./@name))" tokenizable="false" stat="false" result="false" indexable="true" />
329

  
330
		                <FIELD name="collectedfromdatasourceid" xpath="distinct-values(//*[local-name()='entity']/*/*[local-name()='collectedfrom']/@id | //*[local-name()='entity']/*//*[local-name() = 'instance']/*[local-name()='collectedfrom']/@id)"
331
							   tokenizable="false" indexable="true" result="false" stat="false"/>
332
		                <FIELD name="collectedfromname" xpath="distinct-values(//*[local-name()='entity']/*/*[local-name()='collectedfrom']/@name | //*[local-name()='entity']/*//*[local-name() = 'instance']/*[local-name()='collectedfrom']/@name)"
333
							   tokenizable="false" indexable="true" result="false" stat="false"/>
334

  
335
						<FIELD name="originalid" xpath="//*[local-name()='entity']/*/*[local-name()='originalId']"
336
							   type="string_ci" tokenizable="false" stat="false" result="false" indexable="true" />
337

  
338
		                <FIELD name="pid" xpath="//*[local-name()='entity']/*[local-name()='result']/pid/text()" type="string_ci" tokenizable="false" stat="false" result="false" indexable="true"/>
339
		                <FIELD name="pidclassid" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/pid/@classid)" tokenizable="false" stat="false" result="false"
340
		                       indexable="true"/>
341
		                <FIELD name="pidclassname" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/pid/@classname)" tokenizable="false" stat="false" result="false"
342
		                       indexable="true"/>
343

  
344
		                <FIELD name="inferred" xpath="//*[local-name()='entity']//datainfo/inferred" tokenizable="false" stat="false" result="false"
345
		                       indexable="true"/>
346
		                <FIELD name="deletedbyinference" xpath="//*[local-name()='entity']//datainfo/deletedbyinference" tokenizable="false" stat="false"
347
		                       result="false" indexable="true"/>
348
		                <FIELD name="trust" xpath="//*[local-name()='entity']//datainfo/trust" tokenizable="false" stat="false" result="false"
349
		                       indexable="true"/>
350
		                <FIELD name="inferenceprovenance" xpath="//*[local-name()='entity']//datainfo/inferenceprovenance" tokenizable="false" stat="false"
351
		                       result="false" indexable="true"/>
352
		                <FIELD name="provenanceactionclassid" xpath="//*[local-name()='entity']//datainfo/provenanceaction/@classid" tokenizable="false"
353
		                       stat="false" result="false" indexable="true"/>
354

  
355
		                <FIELD name="contextid" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/@id)" tokenizable="false" indexable="true"
356
		                       result="false" stat="false"/>
357
		                <FIELD name="contexttype" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/@type)" tokenizable="false" indexable="true"
358
		                       result="false" stat="false"/>
359
		                <FIELD name="contextname" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/@label)" tokenizable="false"
360
		                       indexable="true" result="false" stat="false"/>
361
		                <!-- Need special fields for community (research initiative) context in order to exclude funders from the context browse -->
362
		                <FIELD name="community"
363
		                       xpath="//*[local-name()='entity']/*[local-name()='result']/context[@type='community' or @type='ri']" value="distinct-values(dnet:join(@id, '||', @label))"
364
		                       tokenizable="false" indexable="true" result="false" stat="false" />
365

  
366
		                <FIELD name="communityname" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context[@type='community' or @type='ri']/@label)"
367
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
368

  
369
		                <FIELD name="communityid" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context[@type='community' or @type='ri']/@id)" tokenizable="false"
370
		                       indexable="true" result="false" stat="false"/>
371

  
372
		                <FIELD name="categoryid" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/category/@id)" tokenizable="false"
373
		                       indexable="true" result="false" stat="false"/>
374
		                <FIELD name="categoryname" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/category/@label)" tokenizable="false"
375
		                       indexable="true" result="false" stat="false"/>
376
		                <FIELD name="conceptid" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/category//concept/@id)" tokenizable="false"
377
		                       indexable="true" result="false" stat="false"/>
378
		                <FIELD name="conceptname" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/category//concept/@label)"
379
		                       tokenizable="false" indexable="true" result="false" stat="false"/>
380
		                <!-- new index field for country info from different xpaths for any type of entity -->
381
		                <FIELD name="country" xpath="distinct-values(//*[local-name()='entity']/*/country/@classid | //*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classid | //*[local-name()='entity']//funder/@jurisdiction)"
382
		                       tokenizable="false" indexable="true" stat="false" result="false"/>
383

  
384
		                <!-- COUNTER FIELDS -->
385
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_dedup" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_dedup/@value"/>
386
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_authorship" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_authorship/@value"/>
387
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_participation" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_participation/@value"/>
388
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_similarity" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_similarity/@value"/>
389

  
390
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_publicationdataset" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_publicationDataset/@value"/>
391
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_publicationdataset_claimed" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_publicationDataset_claimed/@value"/>
392
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_publicationdataset_collected" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_publicationDataset_collected/@value"/>
393
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_publicationdataset_inferred" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_publicationDataset_inferred/@value"/>
394

  
395
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_outcome" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_outcome/@value"/>
396
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_outcome_claimed" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_outcome_claimed/@value"/>
397
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_outcome_collected" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_outcome_collected/@value"/>
398
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_outcome_inferred" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_outcome_inferred/@value"/>
399

  
400
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_affiliation" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_affiliation/@value"/>
401

  
402
		                <FIELD header="true" multivalued="false" indexable="true" name="counter_doi" result="false" stored="true" type="pint" xpath="/record/result/*[local-name()='header']/*[local-name()='counters']/counter_doi/@value"/>
403
	                </FIELDS>
404
                </LAYOUT>
405
                <LAYOUT name="store">
406
                    <FIELDS>
407
                        <FIELD xpath="//dc:language" stat="true" indexable="false" name="language" result="false"/>
408
                        <FIELD xpath="//dr:repositoryCountry" name="repositoryCountry" stat="true" result="false" indexable="false"/>
409
                    </FIELDS>
410
                </LAYOUT>
411
            </LAYOUTS>
412
        </STATUS>
413
    </BODY>
414
</RESOURCE_PROFILE>
52
						<FIELD indexable="true" multivalued="false" name="resultembargoenddate" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='result']/embargoenddate"/>
53
						<FIELD indexable="true" multivalued="false" name="resultembargoendyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='result']/embargoenddate)"/>
54
						<FIELD indexable="true" multivalued="false" name="resulttypeid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/resulttype/@classid"/>
55
						<FIELD indexable="true" multivalued="false" name="resultlanguagename" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*[local-name()='result']/language/@classname"/>
56
						<FIELD copy="true" indexable="true" name="resultpublisher" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='result']/*[local-name()='publisher']"/>
57
						<FIELD copy="true" indexable="true" name="resultdescription" result="false" stat="false" type="text_en" xpath="//*[local-name()='entity']/*[local-name()='result']//*[local-name()='description']"/>
58
						<FIELD indexable="true" multivalued="false" name="resultbestaccessright" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/bestaccessright/@classname)"/>
59
						<FIELD indexable="true" multivalued="false" name="resultdateofacceptance" result="false" stat="false" type="date" value="//*[local-name()='entity']/*[local-name()='result']/dateofacceptance"/>
60
						<FIELD copy="true" indexable="true" multivalued="false" name="resultacceptanceyear" result="false" stat="false" tokenizable="false" value="dnet:extractYear(//*[local-name()='entity']/*[local-name()='result']/dateofacceptance)"/>
61
						<FIELD copy="true" indexable="true" multivalued="true" name="resultauthor" result="false" stat="false" xpath="//*[local-name()='entity']/*[local-name()='result']/creator"/>
62
						<FIELD indexable="true" multivalued="true" name="authorid" result="false" stat="false" type="string_ci" xpath="//*[local-name()='entity']/*[local-name()='result']/creator/@*[local-name() != 'rank' and local-name() != 'name' and local-name() != 'surname']"/>
63
						<FIELD indexable="true" multivalued="true" name="orcidtypevalue" result="false" stat="false" type="string_ci" value="string-join((./@*[local-name() = 'orcid' or local-name() = 'orcid_pending'], ./@*[local-name() = 'orcid' or local-name() = 'orcid_pending']/local-name()), '||' )" xpath="//*[local-name()='entity']/*[local-name()='result']/creator"/>
64
						<FIELD indexable="true" name="resulthostingdatasource" result="false" stat="false" tokenizable="false" value="distinct-values(concat(./@id, '||', ./@name))" xpath="//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='hostedby']"/>
65
						<FIELD indexable="true" name="resulthostingdatasourceid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='hostedby']/@id)"/>
66
						<FIELD indexable="true" name="instancetypename" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/children/instance/*[local-name()='instancetype']/@classname)"/>
67
						<FIELD indexable="true" name="resultdupid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//children/result/@objidentifier"/>
68
						<FIELD indexable="true" name="organizationdupid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']/*//children/organization/@objidentifier"/>
69
						<FIELD copy="true" indexable="false" name="externalreflabel" result="false" stat="false" tokenizable="true" xpath="distinct-values(//*[local-name()='entity']/*//children/externalreference/label)"/>
70
						<FIELD copy="true" indexable="true" name="resultidentifier" result="false" stat="false" type="string_ci" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/children/instance/webresource/*[local-name()='url'])"/>
71
						<FIELD copy="true" indexable="false" name="resultsource" result="false" stat="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/source)"/>
72
						<FIELD indexable="true" name="eoscifguidelines" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name() = 'result']/eoscifguidelines/@code)"/><!-- FOS and SDGs non tokenizable for faceted search-->
73
						<FIELD indexable="true" name="fos" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/subject[@classid='FOS'])"/>
74
						<FIELD indexable="true" name="sdg" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/subject[@classid='SDG'])"/><!--  REL FIELDS -->
75
						<FIELD indexable="true" name="reldatasourcecompatibilityid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='datasource']/openairecompatibility/@classid)"/>
76
						<FIELD indexable="true" name="relproject" result="false" stat="false" tokenizable="false" value="distinct-values(concat(./text(), '||', dnet:pickFirst(../acronym/text(), ../title/text())))" xpath="//*[local-name()='entity']/*//rel/to[@type='project']"/>
77
						<FIELD indexable="true" name="relprojectid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel/to[@type='project'])"/>
78
						<FIELD indexable="true" name="relprojectcode" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/code)"/>
79
						<FIELD copy="true" indexable="true" name="relprojectname" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/acronym)"/>
80
						<FIELD copy="true" indexable="false" name="relprojecttitle" result="false" stat="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/title)"/>
81
						<FIELD copy="true" indexable="false" name="relcontracttypename" result="false" stat="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='project']/contracttype/@classname)"/>
82
						<FIELD indexable="true" name="relorganizationcountryid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classid)"/>
83
						<FIELD copy="true" indexable="false" name="relorganizationcountryname" result="false" stat="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classname)"/>
84
						<FIELD indexable="true" name="relorganizationid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel/to[@type='organization'])"/>
85
						<FIELD copy="true" indexable="true" name="relorganizationname" result="false" stat="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/legalname)"/>
86
						<FIELD copy="true" indexable="true" name="relorganizationshortname" result="false" stat="false" xpath="distinct-values(//*[local-name()='entity']/*//rel[./to/@type='organization']/legalshortname)"/>
87
						<FIELD indexable="true" name="relresulttype" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel/to/@type)"/>
88
						<FIELD indexable="true" name="relclass" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*//rel/to/@class)"/>
89
						<FIELD indexable="true" name="relfundinglevel0_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_0"/>
90
						<FIELD indexable="true" name="relfundinglevel0_name" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_0/@name/string()"/>
91
						<FIELD indexable="true" name="relfundinglevel1_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_1"/>
92
						<FIELD indexable="true" name="relfundinglevel1_name" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_1/@name/string()"/>
93
						<FIELD indexable="true" name="relfundinglevel2_id" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_2"/>
94
						<FIELD indexable="true" name="relfundinglevel2_name" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//rel/funding/funding_level_2/@name/string()"/><!--  PROJECTS' FUNDER FIELDS: indexable only with the new funding path/context handling -->
95
						<FIELD indexable="true" name="relfunder" result="false" stat="false" tokenizable="false" value="distinct-values(concat(@id, '||', @name, '||', @shortname))" xpath="//*[local-name()='entity']//rel/funding/funder"/>
96
						<FIELD indexable="true" name="relfunderid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']//rel/funding/funder/@id)"/>
97
						<FIELD indexable="true" name="relfundershortname" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']//rel/funding/funder/@shortname)"/>
98
						<FIELD indexable="true" name="semrelid" result="false" stat="false" tokenizable="false" value="concat(./to/text(), '||', ./to/@class/string())" xpath="//*[local-name()='entity']//rel"/><!-- COMMON FIELDS -->
99
						<FIELD indexable="true" multivalued="false" name="dateofcollection" result="false" stat="false" type="date" value="//header/*[local-name()='dateOfCollection']"/>
100
						<FIELD indexable="true" name="status" result="false" stat="false" tokenizable="false" type="string_ci" xpath="//header/*[local-name()='status']"/>
101
						<FIELD indexable="true" name="collectedfromdatasourceid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*/*[local-name()='collectedfrom']/@id | //*[local-name()='entity']/*//*[local-name() = 'instance']/*[local-name()='collectedfrom']/@id)"/>
102
						<FIELD indexable="true" name="collectedfromname" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*/*[local-name()='collectedfrom']/@name | //*[local-name()='entity']/*//*[local-name() = 'instance']/*[local-name()='collectedfrom']/@name)"/>
103
						<FIELD indexable="true" name="originalid" result="false" stat="false" tokenizable="false" type="string_ci" xpath="//*[local-name()='entity']/*/*[local-name()='originalId']"/>
104
						<FIELD indexable="true" name="pid" result="false" stat="false" tokenizable="false" type="string_ci" xpath="//*[local-name()='entity']/*/pid/text()"/>
105
						<FIELD indexable="true" name="pidclassid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*/pid/@classid)"/>
106
						<FIELD indexable="true" name="deletedbyinference" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//datainfo/deletedbyinference"/>
107
						<FIELD indexable="true" name="provenanceactionclassid" result="false" stat="false" tokenizable="false" xpath="//*[local-name()='entity']//datainfo/provenanceaction/@classid"/>
108
						<FIELD indexable="true" name="contextid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/@id)"/>
109
						<FIELD indexable="true" name="contextname" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/@label)"/><!-- Need special fields for community (research initiative) context in order to exclude funders from the context browse -->
110
						<FIELD indexable="true" name="community" result="false" stat="false" tokenizable="false" value="distinct-values(concat(@id, '||', @label))" xpath="//*[local-name()='entity']/*[local-name()='result']/context[@type='community' or @type='ri']"/>
111
						<FIELD indexable="true" name="communityid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context[@type='community' or @type='ri']/@id)"/>
112
						<FIELD indexable="true" name="categoryid" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/category/@id)"/>
113
						<FIELD indexable="true" name="conceptname" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*[local-name()='result']/context/category//concept/@label)"/><!-- new index field for country info from different xpaths for any type of entity -->
114
						<FIELD indexable="true" name="country" result="false" stat="false" tokenizable="false" xpath="distinct-values(//*[local-name()='entity']/*/country/@classid | //*[local-name()='entity']/*//rel[./to/@type='organization']/country/@classid | //*[local-name()='entity']//funder/@jurisdiction)"/>
115
						<FIELD indexable="false" name="oafentity" result="true" stat="false" tokenizable="false" xpath="//*[local-name() = 'entity']"/>
116
					</FIELDS>
117
				</LAYOUT>
modules/dnet-directindex-api/trunk/src/test/resources/eu/dnetlib/openaire/directindex/utils/oafRecord.xml
1
<record rank="null">
2
	<result>
3
		<header>
4
			<objIdentifier>lareferencia::29c95f5ef62c8bad9db1f4a6fdfd0a3a</objIdentifier>
5
			<dateOfCollection>2018-03-09T15:22:59.538Z</dateOfCollection>
6
			<dateOfTransformation>2018-09-19T09:51:37.481Z</dateOfTransformation>
7
			<counters></counters>
8
		</header>
9
		<metadata>
10
			<entity schemaLocation="http://namespace.openaire.eu/oaf https://www.openaire.eu/schema/1.0/oaf-1.0.xsd">
11
				<result>
12
					<source>Organizações &amp; Sociedade v.20 n.67 2013</source>
13
					<source>reponame:Escola de Administração da Universidade Federal da Bahia</source>
14
					<source>instname:UFBA</source>
15
					<format>text/html</format>
16
					<creator rank="1" name="Mônica Aguiar Mac-Allister Da" surname="Silva">Silva,Mônica de Aguiar Mac-Allister da</creator>
17
					<creator rank="2" name="José Célio Silveira" surname="Andrade">Andrade,José Célio Silveira</creator>
18
					<title classid="main title" classname="main title" schemeid="dnet:dataCite_title" schemename="dnet:dataCite_title">Editorial</title>
19
					<dateofacceptance>2013-12-01</dateofacceptance>
20
					<journal issn="" eissn="" lissn="" ep="" iss="" sp="" vol="" />
21
					<publisher>Escola de Administração da Universidade Federal da Bahia</publisher>
22
					<resulttype classid="publication" classname="publication" schemeid="dnet:result_typologies" schemename="dnet:result_typologies" />
23
					<language classid="por" classname="Portuguese" schemeid="dnet:languages" schemename="dnet:languages" />
24
					<country classid="" classname="" schemeid="" schemename="" />
25
					<subject classid="" classname="" schemeid="" schemename="" />
26
					<relevantdate classid="" classname="" schemeid="" schemename="" />
27
					<description />
28
					<embargoenddate />
29
					<fulltext />
30
					<contributor />
31
					<resourcetype classid="" classname="" schemeid="" schemename="" />
32
					<coverage />
33
					<storagedate />
34
					<device />
35
					<size />
36
					<version />
37
					<lastmetadataupdate />
38
					<metadataversionnumber />
39
					<documentationUrl />
40
					<codeRepositoryUrl />
41
					<programmingLanguage classid="" classname="" schemeid="" schemename="" />
42
					<contactperson />
43
					<contactgroup />
44
					<tool />
45
					<originalId>oai:periodicos.ibict.br.OrganizacoesESociedade:oai:scielo:S1984-92302013000400001</originalId>
46
					<collectedfrom name="LA Referencia" id="openaire____::dc6e224a8d74ce03bf301152d6e33e97" />
47
					<pid classid="" classname="" schemeid="" schemename="" />
48
					<bestaccessright classid="OPEN" classname="Open Access" schemeid="dnet:access_modes" schemename="dnet:access_modes" />
49
					<datainfo>
50
						<inferred>false</inferred>
51
						<deletedbyinference>false</deletedbyinference>
52
						<trust>0.9</trust>
53
						<inferenceprovenance />
54
						<provenanceaction classid="sysimport:crosswalk:repository" classname="sysimport:crosswalk:repository" schemeid="dnet:provenanceActions" schemename="dnet:provenanceActions" />
55
					</datainfo>
56
					<rels></rels>
57
					<children>
58
						<instance id="openaire____::dc6e224a8d74ce03bf301152d6e33e97">
59
							<collectedfrom name="LA Referencia" id="openaire____::dc6e224a8d74ce03bf301152d6e33e97" />
60
							<instancetype classid="0001" classname="Article" schemeid="dnet:publication_resource" schemename="dnet:publication_resource" />
61
							<dateofacceptance>2013-12-01</dateofacceptance>
62
							<accessright classid="OPEN" classname="Open Access" schemeid="dnet:access_modes" schemename="dnet:access_modes" />
63
							<hostedby name="LA Referencia" id="openaire____::dc6e224a8d74ce03bf301152d6e33e97" />
64
							<webresource>
65
								<url>http://www.scielo.br/scielo.php?script=sci_arttext&amp;pid=S1984-92302013000400001</url>
66
							</webresource>
67
						</instance>
68
					</children>
69
				</result>
70
			</entity>
71
		</metadata>
72
	</result>
1
<record rank="null" xmlns:dri="http://www.driver-repository.eu/namespace/dri"
2
        xmlns:oaf="http://namespace.openaire.eu/oaf">
3
    <result>
4
        <header>
5
            <dri:objIdentifier>xxxx________::7ce207ded3c574227184dd92d3baa39e</dri:objIdentifier>
6
            <dri:dateOfCollection>2023-04-20T04:37:10Z</dri:dateOfCollection>
7
            <dri:status>under curation</dri:status>
8
            <counters/>
9
        </header>
10
        <metadata>
11
            <oaf:entity schemaLocation="http://namespace.openaire.eu/oaf http://oaf/oaf.xsd">
12
                <oaf:result>
13
                    <title classid="main title" classname="main title" schemeid="dnet:dataCite_title"
14
                           schemename="dnet:dataCite_title">sardinia_tasmax_MIROC-ESM-CHEM_rcp4p5_2006-2099_daily.nc4
15
                        &amp; the title has &amp;&amp; in it
16
                    </title>
17
                    <creator rank="1" name="" surname="">Conradt, Tobias</creator>
18
                    <creator rank="2" name="" surname="">&amp; members of the ISIMIP project (original data provision),
19
                        cf. Hempel et al. 2013, https://doi.org/10.5194/esd-4-219-2013
20
                    </creator>
21
                    <dateofacceptance/>
22
                    <resulttype classid="dataset" classname="dataset" schemeid="dnet:result_typologies"
23
                                schemename="dnet:result_typologies"/>
24
                    <language classid="" classname="" schemeid="dnet:languages" schemename="dnet:languages"/>
25
                    <description>&lt;p&gt;ISIMIP-2a climate data cutout provided for Sardinia in the framework of
26
                        SIM4NEXUS &amp; X&lt;/p&gt;
27
                    </description>
28
                    <country classid="" classname="" schemeid="" schemename=""/>
29
                    <subject classid="" classname="" schemeid="" schemename=""/>
30
                    <relevantdate classid="" classname="" schemeid="" schemename=""/>
31
                    <publisher>Zenodo &amp; Zenodo</publisher>
32
                    <embargoenddate/>
33
                    <journal issn="" eissn="" lissn="" ep="" iss="" sp="" vol=""/>
34
                    <source/>
35
                    <fulltext/>
36
                    <format/>
37
                    <storagedate/>
38
                    <resourcetype classid="" classname="" schemeid="" schemename=""/>
39
                    <device/>
40
                    <size/>
41
                    <version/>
42
                    <lastmetadataupdate/>
43
                    <metadataversionnumber/>
44
                    <documentationUrl/>
45
                    <codeRepositoryUrl/>
46
                    <programmingLanguage classid="" classname="" schemeid="" schemename=""/>
47
                    <contactperson/>
48
                    <contactgroup/>
49
                    <tool/>
50
                    <originalId>10.5281/zenodo.1460665</originalId>
51
                    <collectedfrom name="XXX" id="test________::bc9189406be84ec297464a514221406d"/>
52
                    <pid classid="oai" classname="Open Archive Initiative" schemeid="dnet:pid_types"
53
                         schemename="dnet:pid_types">oai:zenodo.org:1460665
54
                    </pid>
55
                    <pid classid="doi" classname="Digital object identifier" schemeid="dnet:pid_types"
56
                         schemename="dnet:pid_types">10.5281/zenodo.1460665
57
                    </pid>
58
                    <bestaccessright classid="OPEN" classname="Open Access" schemeid="dnet:access_modes"
59
                                     schemename="dnet:access_modes"/>
60
                    <datainfo>
61
                        <inferred>false</inferred>
62
                        <deletedbyinference>false</deletedbyinference>
63
                        <trust>0.9</trust>
64
                        <inferenceprovenance/>
65
                        <provenanceaction classid="user:insert" classname="user:insert"
66
                                          schemeid="dnet:provenanceActions" schemename="dnet:provenanceActions"/>
67
                    </datainfo>
68
                    <rels>
69
                        <rel inferred="false" trust="0.9" inferenceprovenance="" provenanceaction="user:claim">
70
                            <to class="isProducedBy" scheme="dnet:result_project_relations" type="project">
71
                                corda__h2020::958f803dd3f47428ba50d394c17f8446
72
                            </to>
73
                            <code>689150</code>
74
                            <acronym>SIM4NEXUS</acronym>
75
                            <title>Sustainable Integrated Management FOR the NEXUS of water-land-food-energy-climate for
76
                                a resource-efficient Europe &amp; beyond
77
                            </title>
78
                            <contracttype classid="" classname="" schemeid="" schemename=""/>
79
                            <funding>
80
                                <funder id="ec__________::EC" shortname="EC" name="European Commission"
81
                                        jurisdiction=""/>
82
                                <funding_level_0 name="H2020">ec__________::EC::H2020</funding_level_0>
83
                            </funding>
84
                            <websiteurl/>
85
                        </rel>
86
                    </rels>
87
                    <children>
88
                        <instance id="xxxx________::7ce207ded3c574227184dd92d3baa39e">
89
                            <instancetype classid="0021" classname="" schemeid="dnet:publication_resource"
90
                                          schemename="dnet:publication_resource"/>
91
                            <collectedfrom name="XXX" id="test________::bc9189406be84ec297464a514221406d"/>
92
                            <hostedby name="XXX" id="test________::bc9189406be84ec297464a514221406d"/>
93
                            <accessright classid="OPEN" classname="Open Access" schemeid="dnet:access_modes"
94
                                         schemename="dnet:access_modes"/>
95
                            <dateofacceptance/>
96
                            <webresource>
97
                                <url>https://zenodo.org/record/1460665</url>
98
                            </webresource>
99
                        </instance>
100
                    </children>
101
                </oaf:result>
102
            </oaf:entity>
103
        </metadata>
104
    </result>
73 105
</record>
modules/dnet-directindex-api/trunk/src/test/resources/log4j.properties
8 8
### Application Level ###
9 9
log4j.logger.eu.dnetlib=INFO
10 10
log4j.logger.eu.dnetlib.msro.openaireplus.workflows.nodes.contexts=DEBUG
11
log4j.logger.eu.dnetlib.openaire.directindex.api=DEBUG

Also available in: Unified diff