Revision 47710
Added by Alessia Bardi almost 7 years ago
modules/dnet-openaireplus-workflows/trunk/src/main/java/eu/dnetlib/msro/openaireplus/workflows/nodes/claims/ApplyClaimRelsJobNode.java | ||
---|---|---|
70 | 70 |
for (Claim claim : claimRels) { |
71 | 71 |
log.debug(claim); |
72 | 72 |
totalClaims++; |
73 |
String sourceId = fullId(claim.getSourceType(), claim.getSource());
|
|
74 |
String targetId = fullId(claim.getTargetType(), claim.getTarget());
|
|
73 |
String sourceId = fullId(getOpenAIREType(claim.getSourceType()), claim.getSource());
|
|
74 |
String targetId = fullId(getOpenAIREType(claim.getTargetType()), claim.getTarget());
|
|
75 | 75 |
String value = getValue(sourceId, targetId, claim.getSemantics(), timestamp); |
76 | 76 |
/* |
77 | 77 |
public void addHBaseColumn(final String clusterName, |
... | ... | |
99 | 99 |
return Arc.DEFAULT_ARC; |
100 | 100 |
} |
101 | 101 |
|
102 |
protected String getOpenAIREType(final String type){ |
|
103 |
switch(type){ |
|
104 |
case "publication": |
|
105 |
case "dataset": |
|
106 |
return "result"; |
|
107 |
default: |
|
108 |
return type; |
|
109 |
} |
|
110 |
} |
|
102 | 111 |
|
112 |
|
|
103 | 113 |
private String getValue(final String sourceId, final String semantics, final String targetId, final long timestamp) throws MSROException{ |
104 | 114 |
log.debug(StringUtils.format("%s -- %s -- %s", sourceId, semantics, targetId)); |
105 | 115 |
String[] relInfo = semantics.split(SEPARATOR); |
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/test/profiles/openaireplus/workflows/hbase/tmp_claims2hbase.xml | ||
---|---|---|
23 | 23 |
<PARAMETERS> |
24 | 24 |
<PARAM managedBy="system" name="clusterName" required="true" type="string">DM</PARAM> |
25 | 25 |
<PARAM managedBy="user" name="tableName" required="true" type="string"></PARAM> |
26 |
<PARAM managedBy="system" name="sql" required="true" type="string">/eu/dnetlib/msro/openaireplus/workflows/hbase/queryClaimsRel.sql</PARAM>
|
|
26 |
<PARAM managedBy="user" name="sql" required="true" type="string">SELECT source_type, source_id, target_type, target_id, semantics FROM claim WHERE approved=TRUE AND source_type !='context'</PARAM>
|
|
27 | 27 |
</PARAMETERS> |
28 | 28 |
<ARCS> |
29 | 29 |
<ARC to="applyClaimUpdates"/> |
... | ... | |
34 | 34 |
<PARAMETERS> |
35 | 35 |
<PARAM managedBy="system" name="clusterName" required="true" type="string">DM</PARAM> |
36 | 36 |
<PARAM managedBy="user" name="tableName" required="true" type="string"></PARAM> |
37 |
<PARAM managedBy="system" name="sql" required="true" type="string">/eu/dnetlib/msro/openaireplus/workflows/hbase/queryClaimsUpdate.sql</PARAM>
|
|
37 |
<PARAM managedBy="user" name="sql" required="true" type="string">SELECT source_type, source_id, target_type, target_id, semantics FROM claim WHERE approved=TRUE AND source_type ='context'</PARAM>
|
|
38 | 38 |
</PARAMETERS> |
39 | 39 |
<ARCS> |
40 | 40 |
<ARC to="success"/> |
Also available in: Unified diff
Fixed ApplyClaimRels job param and mapping datasets and pubs to results