org.vertexium.Vertex.softDeleteProperty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(103)

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

Vertex.softDeleteProperty介绍

暂无

代码示例

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

private void deleteChangeableProperties(Vertex vertex, Authorizations authorizations) {
  for (Property property : vertex.getProperties()) {
    if (OntologyProperties.CHANGEABLE_PROPERTY_IRI.contains(property.getName())) {
      vertex.softDeleteProperty(property.getKey(), property.getName(), authorizations);
    }
  }
  graph.flush();
}

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

@Override
public void removeProperty(String name, Authorizations authorizations) {
  getVertex().softDeleteProperty(ElementMutation.DEFAULT_KEY, name, authorizations);
  getVertex().getGraph().flush();
}

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

public void removeProperty(String key, String name, Authorizations authorizations) {
  getVertex().softDeleteProperty(key, name, authorizations);
  getVertex().getGraph().flush();
}

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

@Test
public void testSoftDeletePropertyOnAHiddenVertex() {
  Vertex v1 = graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .addPropertyValue("key1", "name1", "value1", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A);
  graph.flush();
  graph.markVertexHidden(v1, VISIBILITY_A, AUTHORIZATIONS_A);
  graph.flush();
  v1 = graph.getVertex("v1", FetchHints.ALL_INCLUDING_HIDDEN, AUTHORIZATIONS_A);
  v1.softDeleteProperty("key1", "name1", AUTHORIZATIONS_A);
  graph.flush();
  v1 = graph.getVertex("v1", FetchHints.ALL_INCLUDING_HIDDEN, AUTHORIZATIONS_A);
  assertNull(v1.getProperty("key1", "name1", VISIBILITY_EMPTY));
}

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

@Test
public void testSoftDeletePropertyOnAHiddenVertex() {
  Vertex v1 = graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .addPropertyValue("key1", "name1", "value1", VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_A);
  graph.flush();
  graph.markVertexHidden(v1, VISIBILITY_A, AUTHORIZATIONS_A);
  graph.flush();
  v1 = graph.getVertex("v1", FetchHints.ALL_INCLUDING_HIDDEN, AUTHORIZATIONS_A);
  v1.softDeleteProperty("key1", "name1", AUTHORIZATIONS_A);
  graph.flush();
  v1 = graph.getVertex("v1", FetchHints.ALL_INCLUDING_HIDDEN, AUTHORIZATIONS_A);
  assertNull(v1.getProperty("key1", "name1", VISIBILITY_EMPTY));
}

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

v1.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v1.softDeleteProperty("key1", "firstName", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v1.markPropertyVisible("key1", "firstName", VISIBILITY_A, VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
v2.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v2.softDeleteProperty("key1", "firstName", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v2.markPropertyVisible("key1", "firstName", VISIBILITY_A, VISIBILITY_B, AUTHORIZATIONS_A_AND_B);

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

@Override
public void softDeleteVertex(Vertex vertex, Long timestamp, Authorizations authorizations) {
  if (!((InMemoryVertex) vertex).canRead(authorizations)) {
    return;
  }
  if (timestamp == null) {
    timestamp = IncreasingTime.currentTimeMillis();
  }
  for (Property property : vertex.getProperties()) {
    vertex.softDeleteProperty(property.getKey(), property.getName(), property.getVisibility(), authorizations);
  }
  List<Edge> edgesToSoftDelete = IterableUtils.toList(vertex.getEdges(Direction.BOTH, authorizations));
  for (Edge edgeToSoftDelete : edgesToSoftDelete) {
    softDeleteEdge(edgeToSoftDelete, timestamp, authorizations);
  }
  this.vertices.getTableElement(vertex.getId()).appendSoftDeleteMutation(timestamp);
  getSearchIndex().deleteElement(this, vertex, authorizations);
  if (hasEventListeners()) {
    fireGraphEvent(new SoftDeleteVertexEvent(this, vertex));
  }
}

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

v1.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v1.softDeleteProperty("key1", "firstName", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v1.markPropertyVisible("key1", "firstName", VISIBILITY_A, VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
v2.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v2.softDeleteProperty("key1", "firstName", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
v2.markPropertyVisible("key1", "firstName", VISIBILITY_A, VISIBILITY_B, AUTHORIZATIONS_A_AND_B);

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

Property entityHasImage = outVertex.getProperty(VisalloProperties.ENTITY_IMAGE_VERTEX_ID.getPropertyName());
if (entityHasImage != null) {
  outVertex.softDeleteProperty(entityHasImage.getKey(), entityHasImage.getName(), authorizations);
  this.workQueueRepository.pushElementImageQueue(outVertex, entityHasImage, priority);

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

@Test
public void testSoftDeletePropertyWithVisibility() {
  Vertex v1 = graph.prepareVertex("v1", VISIBILITY_A)
      .addPropertyValue("key1", "name1", "value1", VISIBILITY_A)
      .addPropertyValue("key1", "name1", "value2", VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  assertEquals(2, count(graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getProperties()));
  org.vertexium.test.util.IterableUtils.assertContains("value1", v1.getPropertyValues("name1"));
  org.vertexium.test.util.IterableUtils.assertContains("value2", v1.getPropertyValues("name1"));
  graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).softDeleteProperty("key1", "name1", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
  graph.flush();
  assertEquals(1, count(graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getProperties()));
  assertEquals(1, count(graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getPropertyValues("key1", "name1")));
  org.vertexium.test.util.IterableUtils.assertContains("value2", graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getPropertyValues("name1"));
}

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

@Test
public void testSoftDeletePropertyWithVisibility() {
  Vertex v1 = graph.prepareVertex("v1", VISIBILITY_A)
      .addPropertyValue("key1", "name1", "value1", VISIBILITY_A)
      .addPropertyValue("key1", "name1", "value2", VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  assertEquals(2, count(graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getProperties()));
  org.vertexium.test.util.IterableUtils.assertContains("value1", v1.getPropertyValues("name1"));
  org.vertexium.test.util.IterableUtils.assertContains("value2", v1.getPropertyValues("name1"));
  graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).softDeleteProperty("key1", "name1", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
  graph.flush();
  assertEquals(1, count(graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getProperties()));
  assertEquals(1, count(graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getPropertyValues("key1", "name1")));
  org.vertexium.test.util.IterableUtils.assertContains("value2", graph.getVertex("v1", AUTHORIZATIONS_A_AND_B).getPropertyValues("name1"));
}

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

Vertex outVertex = edge.getVertex(Direction.OUT, authorizations);
Property entityHasImage = outVertex.getProperty(VisalloProperties.ENTITY_IMAGE_VERTEX_ID.getPropertyName());
outVertex.softDeleteProperty(entityHasImage.getKey(), entityHasImage.getName(), authorizations);
workQueueRepository.pushElementImageQueue(outVertex, entityHasImage, priority);
graph.softDeleteEdge(edge, authorizations);

相关文章