constants

This commit is contained in:
Michele Artini 2024-11-21 12:40:40 +01:00
parent b8e264404f
commit da7c66d29d
1 changed files with 6 additions and 26 deletions

View File

@ -23,6 +23,7 @@ import eu.dnetlib.app.directindex.errors.DirectIndexApiException;
import eu.dnetlib.app.directindex.input.DatasourceEntry;
import eu.dnetlib.app.directindex.input.PidEntry;
import eu.dnetlib.app.directindex.input.ResultEntry;
import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.solr.AccessRight;
import eu.dnetlib.dhp.schema.solr.Author;
import eu.dnetlib.dhp.schema.solr.BestAccessRight;
@ -294,44 +295,23 @@ public class SolrRecordMapper {
final RelatedRecordHeader head = new RelatedRecordHeader();
head.setRelatedIdentifier(calculateProjectId(arr[2], arr[3], arr[4]));
head.setRelationType(null); // TODO
head.setRelationType(ModelConstants.RESULT_PROJECT);
head.setRelatedRecordType(RecordType.project);
head.setRelationClass("isProducedBy");
head.setRelationProvenance("user:claim");
head.setRelationClass(ModelConstants.IS_PRODUCED_BY);
head.setRelationProvenance(ModelConstants.USER_CLAIM);
head.setTrust("0.9");
final RelatedRecord rel = new RelatedRecord();
rel.setHeader(head);
rel.setProjectTitle(title);
rel.setAcronym(acronym); // TODO
rel.setCode(code); // TODO
rel.setAcronym(acronym);
rel.setCode(code);
rel.setFunding(funding);
if (StringUtils.isNotBlank(arr[3])) {
info.put("fundingId", funderId + "::" + fundingName);
}
// @formatter:off
/*<rel inferred="false" trust="0.9" inferenceprovenance="" provenanceaction="user:claim">
<to class="isProducedBy" scheme="dnet:result_project_relations" type="project">$!esc.evaluate($!info.id)</to>
<code>$!esc.evaluate($!info.code)</code>
<acronym>$!esc.evaluate($!info.acronym)</acronym>
<title>$!esc.evaluate($!info.title)</title>
<contracttype classid="" classname="" schemeid="" schemename=""/>
<funding>
<funder id="$!esc.evaluate($!info.funderId)"
shortname="$!esc.evaluate($!info.funderShortName)"
name="$!esc.evaluate($!info.funderName)"
jurisdiction="$!esc.evaluate($!info.jurisdiction)"/>
#if($!info.fundingId)
<funding_level_0 name="$!esc.evaluate($!info.fundingName)">$!esc.evaluate($!info.fundingId)</funding_level_0>
#end
</funding>
<websiteurl/>
</rel>*/
// @formatter:on
return rel;
}
return null;