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

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

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

Edge.getProperty介绍

暂无

代码示例

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

@Override
protected Property getP() {
  Edge edge = getE();
  if (edge == null) {
    return null;
  }
  return edge.getProperty(getKey(), getName(), getVisibility());
}

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

@Test
public void testAddEdgeWithProperties() {
  Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
  Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
  Edge addedEdge = graph.prepareEdge("e1", v1, v2, LABEL_LABEL1, VISIBILITY_A)
      .setProperty("propA", "valueA", VISIBILITY_A)
      .setProperty("propB", "valueB", VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Edge e = graph.getEdge("e1", AUTHORIZATIONS_A);
  Assert.assertEquals(1, count(e.getProperties()));
  assertEquals("valueA", e.getPropertyValues("propA").iterator().next());
  Assert.assertEquals(0, count(e.getPropertyValues("propB")));
  e = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(e.getProperties()));
  assertEquals("valueA", e.getPropertyValues("propA").iterator().next());
  assertEquals("valueB", e.getPropertyValues("propB").iterator().next());
  assertEquals("valueA", e.getPropertyValue("propA"));
  assertEquals("valueB", e.getPropertyValue("propB"));
  graph.flush();
  assertEvents(
      new AddVertexEvent(graph, v1),
      new AddVertexEvent(graph, v2),
      new AddEdgeEvent(graph, addedEdge),
      new AddPropertyEvent(graph, addedEdge, addedEdge.getProperty("propA")),
      new AddPropertyEvent(graph, addedEdge, addedEdge.getProperty("propB"))
  );
}

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

assertEquals("valueA", e.getPropertyValues("propA").iterator().next());
Property propA = e.getProperty("", "propA");
assertNotNull(propA);

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

Property property = edge.getProperty(propertyKey, propertyName);
if (property == null) {
  throw new VisalloResourceNotFoundException(String.format("property %s:%s not found on edge %s", propertyKey, propertyName, edge.getId()));

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

@Test
public void testAddEdgeWithProperties() {
  Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
  Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
  Edge addedEdge = graph.prepareEdge("e1", v1, v2, LABEL_LABEL1, VISIBILITY_A)
      .setProperty("propA", "valueA", VISIBILITY_A)
      .setProperty("propB", "valueB", VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  graph.flush();
  Edge e = graph.getEdge("e1", AUTHORIZATIONS_A);
  Assert.assertEquals(1, count(e.getProperties()));
  assertEquals("valueA", e.getPropertyValues("propA").iterator().next());
  Assert.assertEquals(0, count(e.getPropertyValues("propB")));
  e = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(e.getProperties()));
  assertEquals("valueA", e.getPropertyValues("propA").iterator().next());
  assertEquals("valueB", e.getPropertyValues("propB").iterator().next());
  assertEquals("valueA", e.getPropertyValue("propA"));
  assertEquals("valueB", e.getPropertyValue("propB"));
  graph.flush();
  assertEvents(
      new AddVertexEvent(graph, v1),
      new AddVertexEvent(graph, v2),
      new AddEdgeEvent(graph, addedEdge),
      new AddPropertyEvent(graph, addedEdge, addedEdge.getProperty("propA")),
      new AddPropertyEvent(graph, addedEdge, addedEdge.getProperty("propB"))
  );
}

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

assertEquals("valueA", e.getPropertyValues("propA").iterator().next());
Property propA = e.getProperty("", "propA");
assertNotNull(propA);

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

Property property = edge.getProperty(propertyKey, propertyName, visibility);
if (property == null) {
  VisibilityJson visibilityJson = new VisibilityJson();
  visibilityJson.addWorkspace(workspaceId);
  VisalloVisibility v2 = visibilityTranslator.toVisibility(visibilityJson);
  property = edge.getProperty(propertyKey, propertyName, v2.getVisibility());
  if (property == null) {
    throw new VisalloResourceNotFoundException("Could not find property " + propertyKey + ":" + propertyName + ":" + visibility + " on edge with id: " + edgeId, edgeId);

代码示例来源: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: visallo/vertexium

assertNull(e1.getProperty("prop2"));
Property e1prop1 = e1.getProperty("prop2");
assertNotNull(e1prop1);
assertEquals(VISIBILITY_B, e1prop1.getVisibility());

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

assertNull(e1.getProperty("prop2"));
Property e1prop1 = e1.getProperty("prop2");
assertNotNull(e1prop1);
assertEquals(VISIBILITY_B, e1prop1.getVisibility());

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

Property edgeProperty = e1.getProperty("key1", "prop1");
e1.prepareMutation()
    .deleteProperties("key1", "prop1")

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

Property edgeProperty = e1.getProperty("key1", "prop1");
e1.prepareMutation()
    .deleteProperties("key1", "prop1")

相关文章