diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java index 664910f04a..4b1a88ddc2 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/dump/oaf/graph/Relation.java @@ -49,4 +49,13 @@ public class Relation implements Serializable { return Objects.hash(source.getId(), target.getId(), reltype.getType() + ":" + reltype.getName()); } + + public static Relation newInstance(Node source, Node target, RelType reltype, Provenance provenance) { + Relation relation = new Relation(); + relation.source = source; + relation.target = target; + relation.reltype = reltype; + relation.provenance = provenance; + return relation; + } }