Project

General

Profile

« Previous | Next » 

Revision 57758

#4961: ensure we properly build XML records of projects and orgs with summary and budget information

View differences:

modules/dnet-mapreduce-jobs/trunk/src/test/java/eu/dnetlib/data/mapreduce/hbase/index/config/IndexConfigTest.java
26 26
					+ "{ relType = datasourceOrganization_provision_provides, targetEntity = organization, expandAs = rel, symmetric = true, fields = [officialname,websiteurl,datasourcetype,aggregatortype] } "
27 27
					+ "]}, "
28 28
					+ "organization { dups = false, links = ["
29
					+ "{ relType = projectOrganization_participation_isParticipant, targetEntity = project, expandAs = rel, symmetric = true, fields = [legalname,legalshortname,websiteurl,country] }, "
29
					+ "{ relType = projectOrganization_participation_isParticipant, targetEntity = project, expandAs = rel, symmetric = true, fields = [legalname,legalshortname,websiteurl,country,contribution] }, "
30 30
					+ "{ relType = datasourceOrganization_provision_isProvidedBy, targetEntity = datasource, expandAs = rel, symmetric = true, fields = [legalname,legalshortname,websiteurl,country] }, "
31 31
					+ "{ relType = organizationOrganization_dedup_merges, targetEntity = organization, expandAs = child, symmetric = true, fields = [legalname,legalshortname,websiteurl,country] }, "
32 32
					+ "{ relType = organizationOrganization_dedup_isMergedIn, targetEntity = organization, expandAs = child, symmetric = true, fields = [legalname,legalshortname,websiteurl,country] }, "
33 33
					+ "{ relType = resultOrganization_affiliation_isAuthorInstitutionOf, targetEntity = result, expandAs = rel, symmetric = true, fields = [legalname,legalshortname,websiteurl,country] }"
34 34
					+ "]}, "
35 35
					+ "project { dups = false, links = ["
36
					+ "{ relType = projectOrganization_participation_hasParticipant, targetEntity = organization, expandAs = rel, symmetric = true, fields = [code,acronym,title,websiteurl,contracttype,fundingtree] }, "
36
					+ "{ relType = projectOrganization_participation_hasParticipant, targetEntity = organization, expandAs = rel, symmetric = true, fields = [code,acronym,title,websiteurl,contracttype,fundingtree,contribution,currency] }, "
37 37
					+ "{ relType = resultProject_outcome_produces, targetEntity = result, expandAs = rel, symmetric = true, fields = [code,acronym,title,websiteurl,contracttype,fundingtree] } "
38 38
					+ "], excludeFields = [jsonextrainfo,optional1,optional2]}} ";
39 39

  
modules/dnet-mapreduce-jobs/trunk/src/test/java/eu/dnetlib/data/transform/XsltRowTransformerFactoryTest.java
208 208
	}
209 209

  
210 210
	@Test
211
	public void testParseProjectWithSummaryAndAmount() throws Exception {
212

  
213
		doTest(loadFromTransformationProfile("projects_2_hbase.xsl"), load("projectWithSummaryAndAmount.xml"));
214
	}
215

  
216
	@Test
217
	public void testLinkOrganizationWithBudget() throws Exception {
218

  
219
		final List<Row> rows = Lists.newArrayList();
220
		rows.addAll(asRows(loadFromTransformationProfile("organizations_2_hbase.xsl"), load("organization.xml")));
221
		rows.addAll(asRows(loadFromTransformationProfile("projectorganization_2_hbase.xsl"), load("project_org_budget.xml")));
222
		rows.addAll(asRows(loadFromTransformationProfile("projects_2_hbase.xsl"), load("projectWithSummaryAndAmount.xml")));
223

  
224
		printAll(mapAll(buildTable(rows)));
225
	}
226

  
227

  
228
	@Test
211 229
	public void testParseOaf() throws Exception {
212 230

  
213 231
		doTest(loadFromTransformationProfile("oaf2hbase.xml"), load("record.xml"));
modules/dnet-mapreduce-jobs/trunk/src/test/resources/eu/dnetlib/data/transform/project_org_budget.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ROW>
3
    <FIELD name="trust">0.9</FIELD>
4
    <FIELD name="contribution">190910</FIELD>
5
    <FIELD name="participantnumber">9</FIELD>
6
    <FIELD name="project">corda__h2020::115797</FIELD>
7
    <FIELD name="_dnet_resource_identifier_">corda__h2020::115797::777513@@corda__h2020::937348734</FIELD>
8
    <FIELD name="currency">EUR</FIELD>
9
    <FIELD name="semanticclass">participant</FIELD>
10
    <FIELD name="resporganization">corda__h2020::937348734</FIELD>
11
</ROW>
modules/dnet-mapreduce-jobs/trunk/src/test/resources/eu/dnetlib/data/transform/projectWithSummaryAndAmount.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ROW>
3
    <FIELD name="trust">0.9</FIELD>
4
    <FIELD name="contactemail">elke.lammertyn@kuleuven.be</FIELD>
5
    <FIELD name="code">115797</FIELD>
6
    <FIELD name="keywords" isNull="true"/>
7
    <FIELD name="oamandatepublications">true</FIELD>
8
    <FIELD name="dateofcollection">2018-03-09</FIELD>
9
    <FIELD name="fundingtree">
10
        <ITEM>&lt;fundingtree&gt;&lt;funder&gt;&lt;id&gt;ec__________::EC&lt;/id&gt;&lt;shortname&gt;EC&lt;/shortname&gt;&lt;name&gt;European Commission&lt;/name&gt;&lt;jurisdiction&gt;EU&lt;/jurisdiction&gt;&lt;/funder&gt;&lt;funding_level_1&gt;&lt;id&gt;ec__________::EC::H2020::IMI2-RIA&lt;/id&gt;&lt;description&gt;Research and Innovation action&lt;/description&gt;&lt;name&gt;IMI2-RIA&lt;/name&gt;&lt;class&gt;ec:h2020toas&lt;/class&gt;&lt;parent&gt;&lt;funding_level_0&gt;&lt;id&gt;ec__________::EC::H2020&lt;/id&gt;&lt;name&gt;H2020&lt;/name&gt;&lt;description&gt;Horizon 2020 Framework Programme&lt;/description&gt;&lt;parent/&gt;&lt;class&gt;ec:h2020fundings&lt;/class&gt;&lt;/funding_level_0&gt;&lt;/parent&gt;&lt;/funding_level_1&gt;&lt;/fundingtree&gt;
11
        </ITEM>
12
    </FIELD>
13
    <FIELD name="ecarticle29_3">false</FIELD>
14
    <FIELD name="pid">
15
        <ITEM isNull="true"/>
16
    </FIELD>
17
    <FIELD name="title">Translational approaches to disease modifying therapy of type 1 diabetes: an innovative approach
18
        towards understanding and arresting type 1 diabetes – Sofia ref.: 115797
19
    </FIELD>
20
    <FIELD name="startdate">2015-11-01</FIELD>
21
    <FIELD name="totalcost">36563700</FIELD>
22
    <FIELD name="duration" isNull="true"/>
23
    <FIELD name="provenanceaction">
24
        sysimport:crosswalk:entityregistry@@@Harvested@@@dnet:provenanceActions@@@dnet:provenanceActions
25
    </FIELD>
26
    <FIELD name="inferenceprovenance" isNull="true"/>
27
    <FIELD name="ecsc39" isNull="true"/>
28
    <FIELD name="collectedfromname">CORDA - COmmon Research DAta Warehouse - Horizon 2020</FIELD>
29
    <FIELD name="inferred">false</FIELD>
30
    <FIELD name="currency">EUR</FIELD>
31
    <FIELD name="contactphone" isNull="true"/>
32
    <FIELD name="projectid">corda__h2020::115797</FIELD>
33
    <FIELD name="jsonextrainfo">{}</FIELD>
34
    <FIELD name="summary">Preclinical type 1 diabetes (T1D) research has made important advances in recent years, but
35
        less progress has been made in translating findings from in vitro and animal models into effective clinical
36
        interventions. INNODIA aims to achieve a breakthrough in the way in which we study T1D to enable us to move
37
        closer towards prevention and cure of T1D. To this end, INNODIA joins together the leading European experts from
38
        the fields of basic and clinical T1D research, four leading pharmaceutical companies with strong expertise in
39
        the discovery and development of diabetes medicines and the two leading public organizations involved in T1D
40
        research into one comprehensive collaborative consortium. The clinicians in INNODIA oversee T1D registries and
41
        have access to large populations of children and adults with T1D and family members at increased risk of
42
        developing the disease. The basic science researchers are experts in beta-cell pathophysiology, immunology,
43
        biomarker discovery, bioinformatics, systems biology and clinical trial design. INNODIA will accelerate
44
        understanding of T1D through coordinated studies of unique clinical samples and translation-oriented preclinical
45
        models. This should deliver novel biomarkers and interventions for testing in appropriately designed trials, to
46
        be developed in active collaboration with regulators and patients. INNODIA provides access to unique historical
47
        biorepositories and will create the Clinical Sample Network, a clinical EU infrastructure to recruit T1D
48
        subjects at diagnosis and at-risk relatives. These individuals will be deep-phenotyped and will provide
49
        biosamples, allowing the establishment of a ‘living biobank’ of subjects consented for recall. They will be
50
        characterized using standardized clinical, genetic and metabolic phenotyping procedures, including prospective,
51
        longitudinal sample collection to facilitate novel biomarker discovery. Diverse biological samples (blood,
52
        plasma, serum, urine, stools, etc.) will be collected at
53
    </FIELD>
54
    <FIELD name="collectedfromid">openaire____::corda_h2020</FIELD>
55
    <FIELD name="acronym">INNODIA</FIELD>
56
    <FIELD name="callidentifier">H2020-JTI-IMI2-2014-01-two-stage</FIELD>
57
    <FIELD name="subjects">
58
        <ITEM>Translational approaches to disease modifying therapy of Type 1 Diabetes Mellitus
59
            (T1DM)###ec:h2020topics@@@Horizon 2020
60
            Topics@@@dnet:subject_classification_typologies@@@dnet:subject_classification_typologies
61
        </ITEM>
62
    </FIELD>
63
    <FIELD name="contactfax" isNull="true"/>
64
    <FIELD name="fundedamount">17630000</FIELD>
65
    <FIELD name="optional2">Translational approaches to disease modifying therapy of Type 1 Diabetes Mellitus (T1DM)
66
    </FIELD>
67
    <FIELD name="optional1">IMI2-2014-01-01</FIELD>
68
    <FIELD name="enddate">2022-10-31</FIELD>
69
    <FIELD name="contracttype" isNull="true"/>
70
    <FIELD name="websiteurl" isNull="true"/>
71
    <FIELD name="dateoftransformation">2019-11-19</FIELD>
72
    <FIELD name="deletedbyinference">false</FIELD>
73
    <FIELD name="contactfullname">LAMMERTYN, Elke</FIELD>
74
</ROW>
modules/dnet-mapreduce-jobs/trunk/src/main/java/eu/dnetlib/data/mapreduce/util/XmlRecordFactory.java
544 544
			if (fd.getFullName().equals("eu.dnetlib.data.proto.OafEntity.type")) return;
545 545
			metadata.add(asXmlElement(fd.getName(), ((EnumValueDescriptor) o).getName(), null, null));
546 546
		} else {
547
			metadata.add(asXmlElement(fd.getName(), o.toString(), null, null));
547
			if(fd.getType().equals(FieldDescriptor.Type.FLOAT)){
548
				metadata.add(asXmlElement(fd.getName(), String.format ("%.2f", ((Float) o)), null, null));
549
			} else {
550
				metadata.add(asXmlElement(fd.getName(), o.toString(), null, null));
551
			}
548 552
		}
549 553
	}
550 554

  

Also available in: Unified diff