org.vertexium.Edge.prepareMutation()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(203)

本文整理了Java中org.vertexium.Edge.prepareMutation()方法的一些代码示例,展示了Edge.prepareMutation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Edge.prepareMutation()方法的具体详情如下:
包路径:org.vertexium.Edge
类名称:Edge
方法名:prepareMutation

Edge.prepareMutation介绍

暂无

代码示例

代码示例来源:origin: org.vertexium/vertexium-core

@Override
public ExistingEdgeMutation prepareMutation() {
  return getEdge().prepareMutation();
}

代码示例来源:origin: visallo/vertexium

@Override
public ExistingEdgeMutation prepareMutation() {
  return getEdge().prepareMutation();
}

代码示例来源:origin: org.visallo/visallo-model-vertexium

ExistingEdgeMutation m = edge.prepareMutation();
m.setIndexHint(IndexHint.DO_NOT_INDEX);
m.save(authorizations);

代码示例来源:origin: org.vertexium/vertexium-test

@Test
public void testGraphQueryEdgeWithTermsAggregationAlterElementVisibility() {
  graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareVertex("v2", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareEdge("e1", "v1", "v2", LABEL_LABEL1, VISIBILITY_A)
      .addPropertyValue("k1", "age", 25, VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Edge e1 = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B);
  e1.prepareMutation()
      .alterElementVisibility(VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Map<Object, Long> propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A_AND_B);
  assumeTrue("terms aggregation not supported", propertyCountByValue != null);
  assertEquals(1, propertyCountByValue.size());
  propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A);
  assumeTrue("terms aggregation not supported", propertyCountByValue != null);
  assertEquals(0, propertyCountByValue.size());
  propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_B);
  assumeTrue("terms aggregation not supported", propertyCountByValue != null);
  assertEquals(1, propertyCountByValue.size());
}

代码示例来源:origin: visallo/vertexium

@Test
public void testGraphQueryEdgeWithTermsAggregationAlterElementVisibility() {
  graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareVertex("v2", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.prepareEdge("e1", "v1", "v2", LABEL_LABEL1, VISIBILITY_A)
      .addPropertyValue("k1", "age", 25, VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Edge e1 = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B);
  e1.prepareMutation()
      .alterElementVisibility(VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Map<Object, Long> propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A_AND_B);
  assumeTrue("terms aggregation not supported", propertyCountByValue != null);
  assertEquals(1, propertyCountByValue.size());
  propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A);
  assumeTrue("terms aggregation not supported", propertyCountByValue != null);
  assertEquals(0, propertyCountByValue.size());
  propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_B);
  assumeTrue("terms aggregation not supported", propertyCountByValue != null);
  assertEquals(1, propertyCountByValue.size());
}

代码示例来源:origin: org.vertexium/vertexium-test

@Test
public void testMetadataMutationsOnEdge() {
  Metadata metadataPropB = Metadata.create();
  metadataPropB.add("meta1", "meta1", VISIBILITY_A);
  Edge edge = graph.prepareEdge("v1", "v2", LABEL_LABEL1, VISIBILITY_A)
      .setProperty("propBmeta", "propBmeta", metadataPropB, VISIBILITY_A)
      .save(AUTHORIZATIONS_ALL);
  graph.flush();
  ExistingElementMutation<Edge> m = edge.prepareMutation();
  m.setPropertyMetadata("propBmeta", "meta1", "meta2", VISIBILITY_A);
  edge = m.save(AUTHORIZATIONS_ALL);
  assertEquals("meta2", edge.getProperty("propBmeta").getMetadata().getEntry("meta1").getValue());
}

代码示例来源:origin: visallo/vertexium

@Test
public void testMetadataMutationsOnEdge() {
  Metadata metadataPropB = Metadata.create();
  metadataPropB.add("meta1", "meta1", VISIBILITY_A);
  Edge edge = graph.prepareEdge("v1", "v2", LABEL_LABEL1, VISIBILITY_A)
      .setProperty("propBmeta", "propBmeta", metadataPropB, VISIBILITY_A)
      .save(AUTHORIZATIONS_ALL);
  graph.flush();
  ExistingElementMutation<Edge> m = edge.prepareMutation();
  m.setPropertyMetadata("propBmeta", "meta1", "meta2", VISIBILITY_A);
  edge = m.save(AUTHORIZATIONS_ALL);
  assertEquals("meta2", edge.getProperty("propBmeta").getMetadata().getEntry("meta1").getValue());
}

代码示例来源:origin: org.vertexium/vertexium-test

@Test
public void testSoftDeletePropertyOnEdgeNotIndexed() {
  Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
  Vertex v2 = graph.addVertex("v2", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
  ElementBuilder<Edge> elementBuilder = graph.prepareEdge("e1", v1, v2, LABEL_LABEL1, VISIBILITY_B)
      .setProperty("prop1", "value1", VISIBILITY_B);
  elementBuilder.setIndexHint(IndexHint.DO_NOT_INDEX);
  Edge e1 = elementBuilder.save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  ExistingElementMutation<Edge> m = e1.prepareMutation();
  m.softDeleteProperty("prop1", VISIBILITY_B);
  m.setIndexHint(IndexHint.DO_NOT_INDEX);
  m.save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  e1 = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B);
  assertEquals(0, IterableUtils.count(e1.getProperties()));
}

代码示例来源:origin: visallo/vertexium

@Test
public void testSoftDeletePropertyOnEdgeNotIndexed() {
  Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
  Vertex v2 = graph.addVertex("v2", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
  ElementBuilder<Edge> elementBuilder = graph.prepareEdge("e1", v1, v2, LABEL_LABEL1, VISIBILITY_B)
      .setProperty("prop1", "value1", VISIBILITY_B);
  elementBuilder.setIndexHint(IndexHint.DO_NOT_INDEX);
  Edge e1 = elementBuilder.save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  ExistingElementMutation<Edge> m = e1.prepareMutation();
  m.softDeleteProperty("prop1", VISIBILITY_B);
  m.setIndexHint(IndexHint.DO_NOT_INDEX);
  m.save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  e1 = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B);
  assertEquals(0, IterableUtils.count(e1.getProperties()));
}

代码示例来源:origin: org.visallo/visallo-core

public void updateVisibility(Vertex termMention, Visibility newVisibility, Authorizations authorizations) {
  Authorizations authorizationsWithTermMention = getAuthorizations(authorizations);
  Visibility newVisibilityWithTermMention = VisalloVisibility.and(newVisibility, VISIBILITY_STRING);
  ExistingElementMutation<Vertex> m = termMention.prepareMutation();
  m.alterElementVisibility(newVisibilityWithTermMention);
  for (Property property : termMention.getProperties()) {
    m.alterPropertyVisibility(property, newVisibilityWithTermMention);
  }
  Property refPropertyVisibility = VisalloProperties.TERM_MENTION_REF_PROPERTY_VISIBILITY.getProperty(termMention);
  if (refPropertyVisibility != null) {
    VisalloProperties.TERM_MENTION_REF_PROPERTY_VISIBILITY.setProperty(
        m,
        newVisibility.getVisibilityString(),
        refPropertyVisibility.getMetadata(),
        newVisibilityWithTermMention
    );
  }
  m.save(authorizationsWithTermMention);
  for (Edge edge : termMention.getEdges(Direction.BOTH, authorizationsWithTermMention)) {
    ExistingElementMutation<Edge> edgeMutation = edge.prepareMutation();
    edgeMutation.alterElementVisibility(newVisibilityWithTermMention);
    for (Property property : edge.getProperties()) {
      edgeMutation.alterPropertyVisibility(property, newVisibilityWithTermMention);
    }
    edgeMutation.save(authorizationsWithTermMention);
  }
}

代码示例来源:origin: org.visallo/visallo-web-product-graph

ElementMutation<Edge> m = productEdge.prepareMutation();
GraphProductOntology.NODE_TITLE.setProperty(m, title, GraphWorkProductService.VISIBILITY.getVisibility());
m.save(authorizations);

代码示例来源:origin: org.vertexium/vertexium-test

e1.prepareMutation()
    .alterElementVisibility(VISIBILITY_B)
    .save(AUTHORIZATIONS_A_AND_B);
e1.prepareMutation()
    .alterElementVisibility(VISIBILITY_B)
    .save(AUTHORIZATIONS_A_AND_B);

代码示例来源:origin: visallo/vertexium

e1.prepareMutation()
    .alterElementVisibility(VISIBILITY_B)
    .save(AUTHORIZATIONS_A_AND_B);
e1.prepareMutation()
    .alterElementVisibility(VISIBILITY_B)
    .save(AUTHORIZATIONS_A_AND_B);

代码示例来源:origin: visallo/vertexium

Assert.assertEquals(LABEL_LABEL1, IterableUtils.single(v2.getEdgesSummary(AUTHORIZATIONS_A).getInEdgeLabels()));
e.prepareMutation()
    .alterEdgeLabel(LABEL_LABEL2)
    .save(AUTHORIZATIONS_A);

代码示例来源:origin: visallo/vertexium

.prepareMutation()
.alterElementVisibility(VISIBILITY_A)
.save(AUTHORIZATIONS_A);

代码示例来源:origin: org.vertexium/vertexium-test

Assert.assertEquals(LABEL_LABEL1, IterableUtils.single(v2.getEdgesSummary(AUTHORIZATIONS_A).getInEdgeLabels()));
e.prepareMutation()
    .alterEdgeLabel(LABEL_LABEL2)
    .save(AUTHORIZATIONS_A);

代码示例来源:origin: org.vertexium/vertexium-test

.prepareMutation()
.alterElementVisibility(VISIBILITY_A)
.save(AUTHORIZATIONS_A);

代码示例来源:origin: org.vertexium/vertexium-test

e1.prepareMutation()
    .alterPropertyVisibility("k2", "prop2", VISIBILITY_B)
    .save(AUTHORIZATIONS_A_AND_B);

代码示例来源:origin: visallo/vertexium

e1.prepareMutation()
    .alterPropertyVisibility("k2", "prop2", VISIBILITY_B)
    .save(AUTHORIZATIONS_A_AND_B);

代码示例来源:origin: org.vertexium/vertexium-test

e1.prepareMutation()
    .deleteProperties("key1", "prop1")
    .save(AUTHORIZATIONS_A_AND_B);

相关文章