Hi,
The setter is not there intentionally. It’s not a mutable property of the HRel. When you create HGRel atoms you are normally supposed to add them with a HGRelType which itself will hold the label.
What’s probably happening in your case is that you are storing the HGRel as a Java bean and not using the HGRelType at all. This works as a strategy but the particular API (HGRelType, HGRel, HGRelTypeConstructor) is not intended to be used this way.
What I’d suggest instead is to create your own generic LabeledLink class where the name is a bean property and then index by it so you can query more efficiently:
public class LabeledLink extends HGPlainLink {
private String label;
public LabeledLink(HGHandle…targets) { super(targets); }
public void setLabel(String label) …
public String getLabel() {return label; }
}
HGHandle labeledType = graph.getTypeSystem().getTypeHandle(LabeledLink.class);
graph.getIndexManager().register(new ByPartIndexer(labeledType, “label”);
Cheers,
Boris