Multiple labels not working in mergeV() syntax for conditional inserts in AWS Neptune

0

While attempting to migrate conditional inserts (upserts) to the new mergeV/E() syntax, I encountered an issue with vertices that have multiple labels. It appears that creating a vertex with multiple labels only works with the addV() step, which was present in the fold()/coalesce()/unfold() pattern for conditional inserts. In the new syntax, the label property is specified in a map, and a string such as 'Label1::Label2::Label3' will be treated as a single label. For example, the following code written in Gremlin-Java, creates a vertex with a single label called 'Label1::Label2', if it does not already exist:

Map<Object, Object> mergeMap = Map.of(T.id, someId);
Map<Object, Object> createMap = new HashMap<>(
	Map.of(
		T.id, someId, T.label, "Label1::Label2"
	)
);

g.mergeV(mergeMap).option(Merge.onCreate, createMap)

Are there any alternative approaches to this issue that make use of the new syntax for efficient upserts?

질문됨 일 년 전76회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠