Revision 56902
Added by Michele Artini about 5 years ago
modules/dnet-grid-application/trunk/src/main/java/eu/dnetlib/grid/process/utils/GridUtils.java | ||
---|---|---|
38 | 38 |
|
39 | 39 |
public class GridUtils { |
40 | 40 |
|
41 |
private static final String TRUST_LEVEL = "0.91"; |
|
41 |
private static final String PRIMARY_TRUST_LEVEL = "0.91";
|
|
42 | 42 |
|
43 |
private static final String SECONDARY_TRUST_LEVEL = "0.89"; |
|
44 |
|
|
43 | 45 |
public static Stream<GridOrganization> streamOrganizations(final String jsonFile) { |
44 | 46 |
try { |
45 | 47 |
return StreamSupport.stream(GridUtils.getOrganizations(new FileInputStream(jsonFile)).spliterator(), false); |
... | ... | |
100 | 102 |
country, |
101 | 103 |
e.getKey().equals(mainOpenaireId) ? alternativeNames : new HashSet<>(), |
102 | 104 |
orgNames.keySet(), |
103 |
collectedFrom)) |
|
105 |
collectedFrom, |
|
106 |
e.getValue().equals(mainName) ? PRIMARY_TRUST_LEVEL : SECONDARY_TRUST_LEVEL)) |
|
104 | 107 |
.flatMap(l -> l.stream()) |
105 | 108 |
.collect(Collectors.toList()); |
106 | 109 |
} |
... | ... | |
113 | 116 |
final Qualifier country, |
114 | 117 |
final Set<String> alternativeNames, |
115 | 118 |
final Set<String> orgRels, |
116 |
final KeyValue collectedFrom) { |
|
119 |
final KeyValue collectedFrom, |
|
120 |
final String trust) { |
|
117 | 121 |
|
118 | 122 |
final OafEntity.Builder entity = OafEntity.newBuilder() |
119 | 123 |
.setId(openaireId) |
... | ... | |
157 | 161 |
.setLastupdatetimestamp(DateUtils.now()) |
158 | 162 |
.setEntity(entity) |
159 | 163 |
.setDataInfo(DataInfo.newBuilder() |
160 |
.setTrust(TRUST_LEVEL)
|
|
164 |
.setTrust(trust)
|
|
161 | 165 |
.setInferred(false) |
162 | 166 |
.setProvenanceaction(Qualifier.newBuilder() |
163 | 167 |
.setClassid("UNKNOWN") |
modules/dnet-grid-application/trunk/README.txt | ||
---|---|---|
1 | 1 |
1) Download the input file from https://grid.ac/downloads (json format) |
2 |
2) mvn package mvn package && java -jar target/dnet-grid-application-[VERSION]-SNAPSHOT.jar [INPUT JSON FILE] > [OUTPUT JSON FILE]
|
|
2 |
2) mvn package && java -jar target/dnet-grid-application-[VERSION]-SNAPSHOT.jar [INPUT JSON FILE] > [OUTPUT JSON FILE] |
|
3 | 3 |
3) Copy the generated file under the hdfs filesystem according to the "Import Infospace > Import GridAC" workflow |
Also available in: Unified diff
different trust for principal and alternative names