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

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

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

Vertex.getPropertyValue介绍

暂无

代码示例

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

@Override
public boolean hasGlyphIconResource() {
  // TODO: This can be changed to GLYPH_ICON.getPropertyValue(vertex) once ENTITY_IMAGE_URL is added
  return vertex.getPropertyValue(OntologyProperties.GLYPH_ICON.getPropertyName()) != null ||
      vertex.getPropertyValue(OntologyProperties.GLYPH_ICON_FILE_NAME.getPropertyName()) != null;
}

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

@Override
public boolean hasGlyphIconSelectedResource() {
  return vertex.getPropertyValue(OntologyProperties.GLYPH_ICON_SELECTED.getPropertyName()) != null ||
      vertex.getPropertyValue(OntologyProperties.GLYPH_ICON_SELECTED_FILE_NAME.getPropertyName()) != null;
}

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

@Override
public Set<String> getVertexLabels(Vertex vertex) {
  return Sets.newHashSet((String) vertex.getPropertyValue(getLabelPropertyName()));
}

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

@Test
public void testStreamingPropertyValueReadAsString() {
  graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .setProperty("spv", StreamingPropertyValue.create("Hello World"), VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_EMPTY);
  graph.flush();
  Vertex v1 = graph.getVertex("v1", AUTHORIZATIONS_EMPTY);
  assertEquals("Hello World", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString());
  assertEquals("Wor", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString(6, 3));
  assertEquals("", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString("Hello World".length(), 1));
  assertEquals("Hello World", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString(0, 100));
}

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

@Test
public void testStreamingPropertyValueReadAsString() {
  graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .setProperty("spv", StreamingPropertyValue.create("Hello World"), VISIBILITY_EMPTY)
      .save(AUTHORIZATIONS_EMPTY);
  graph.flush();
  Vertex v1 = graph.getVertex("v1", AUTHORIZATIONS_EMPTY);
  assertEquals("Hello World", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString());
  assertEquals("Wor", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString(6, 3));
  assertEquals("", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString("Hello World".length(), 1));
  assertEquals("Hello World", ((StreamingPropertyValue) v1.getPropertyValue("spv")).readToString(0, 100));
}

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

@Test
public void testAddRowWithErrorThatSkipsCell() throws Exception {
  PropertyMapping fraudMapping = findPropertyMapping(TX_FRAUD_NAME);
  fraudMapping.errorHandlingStrategy = PropertyMapping.ErrorHandlingStrategy.SKIP_CELL;
  doParse(false, true, 0, new String[]{"John Smith", "3/13/2015", "you bet"});
  Optional<Vertex> txVertexOpt = getGenerated().stream()
      .filter(vertex -> VisalloProperties.CONCEPT_TYPE.getPropertyValue(vertex).equals(TX_CONCEPT_TYPE))
      .findFirst();
  assertTrue("Unable to find new transaction vertex", txVertexOpt.isPresent());
  Vertex txVertex = txVertexOpt.get();
  assertNull("Incorrect fraud indicator on tx vertex", txVertex.getPropertyValue(TX_FRAUD_NAME));
}

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

@Test
public void testElementMutationDoesntChangeObjectUntilSave() {
  Vertex v = graph.addVertex("v1", VISIBILITY_EMPTY, AUTHORIZATIONS_ALL);
  v.setProperty("prop1", "value1-1", VISIBILITY_A, AUTHORIZATIONS_ALL);
  graph.flush();
  ElementMutation<Vertex> m = v.prepareMutation()
      .setProperty("prop1", "value1-2", VISIBILITY_A)
      .setProperty("prop2", "value2-2", VISIBILITY_A);
  Assert.assertEquals(1, count(v.getProperties()));
  assertEquals("value1-1", v.getPropertyValue("prop1"));
  v = m.save(AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(v.getProperties()));
  assertEquals("value1-2", v.getPropertyValue("prop1"));
  assertEquals("value2-2", v.getPropertyValue("prop2"));
}

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

@Test
public void testElementMutationDoesntChangeObjectUntilSave() {
  Vertex v = graph.addVertex("v1", VISIBILITY_EMPTY, AUTHORIZATIONS_ALL);
  v.setProperty("prop1", "value1-1", VISIBILITY_A, AUTHORIZATIONS_ALL);
  graph.flush();
  ElementMutation<Vertex> m = v.prepareMutation()
      .setProperty("prop1", "value1-2", VISIBILITY_A)
      .setProperty("prop2", "value2-2", VISIBILITY_A);
  Assert.assertEquals(1, count(v.getProperties()));
  assertEquals("value1-1", v.getPropertyValue("prop1"));
  v = m.save(AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(v.getProperties()));
  assertEquals("value1-2", v.getPropertyValue("prop1"));
  assertEquals("value2-2", v.getPropertyValue("prop2"));
}

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

@Test
public void testAddVertexWithPropertiesWithTwoDifferentVisibilities() {
  Vertex v = graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .setProperty("prop1", "value1a", VISIBILITY_A)
      .setProperty("prop1", "value1b", VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(v.getProperties("prop1")));
  graph.flush();
  v = graph.getVertex("v1", AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(v.getProperties("prop1")));
  v = graph.getVertex("v1", AUTHORIZATIONS_A);
  Assert.assertEquals(1, count(v.getProperties("prop1")));
  assertEquals("value1a", v.getPropertyValue("prop1"));
  v = graph.getVertex("v1", AUTHORIZATIONS_B);
  Assert.assertEquals(1, count(v.getProperties("prop1")));
  assertEquals("value1b", v.getPropertyValue("prop1"));
}

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

@Test
public void testAddVertexWithPropertiesWithTwoDifferentVisibilities() {
  Vertex v = graph.prepareVertex("v1", VISIBILITY_EMPTY)
      .setProperty("prop1", "value1a", VISIBILITY_A)
      .setProperty("prop1", "value1b", VISIBILITY_B)
      .save(AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(v.getProperties("prop1")));
  graph.flush();
  v = graph.getVertex("v1", AUTHORIZATIONS_A_AND_B);
  Assert.assertEquals(2, count(v.getProperties("prop1")));
  v = graph.getVertex("v1", AUTHORIZATIONS_A);
  Assert.assertEquals(1, count(v.getProperties("prop1")));
  assertEquals("value1a", v.getPropertyValue("prop1"));
  v = graph.getVertex("v1", AUTHORIZATIONS_B);
  Assert.assertEquals(1, count(v.getProperties("prop1")));
  assertEquals("value1b", v.getPropertyValue("prop1"));
}

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

@Test
public void testStoreGeoCircle() {
  assumeTrue("GeoCircle storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoCircle within = new GeoCircle(38.6270, -90.1994, 100, "St. Louis, MO - within");
  GeoCircle contains = new GeoCircle(38.6270, -90.1994, 800, "St. Louis, MO - contains");
  GeoCircle intersects = new GeoCircle(38.6270, -80.0, 500, "St. Louis, MO - intersects");
  GeoCircle disjoint = new GeoCircle(38.6270, -70.0, 500, "St. Louis, MO - disjoint");
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoCircle geoCircle = (GeoCircle) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoCircle);
  assertEquals(within.getDescription(), geoCircle.getDescription());
}

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

@Test
public void testStoreGeoCircle() {
  assumeTrue("GeoCircle storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoCircle within = new GeoCircle(38.6270, -90.1994, 100, "St. Louis, MO - within");
  GeoCircle contains = new GeoCircle(38.6270, -90.1994, 800, "St. Louis, MO - contains");
  GeoCircle intersects = new GeoCircle(38.6270, -80.0, 500, "St. Louis, MO - intersects");
  GeoCircle disjoint = new GeoCircle(38.6270, -70.0, 500, "St. Louis, MO - disjoint");
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoCircle geoCircle = (GeoCircle) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoCircle);
  assertEquals(within.getDescription(), geoCircle.getDescription());
}

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

@Test
public void testStoreGeoPolygon() {
  assumeTrue("GeoPolygon storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoPolygon within = new GeoPolygon(Arrays.asList(new GeoPoint(39.4, -91.0), new GeoPoint(38.1, -91.0), new GeoPoint(38.627, -89.0), new GeoPoint(39.4, -91.0)), "St. Louis, MO - within");
  GeoPolygon contains = new GeoPolygon(Arrays.asList(new GeoPoint(50.0, -98.0), new GeoPoint(26.0, -98.0), new GeoPoint(38.627, -75.0), new GeoPoint(50.0, -98.0)), "St. Louis, MO - contains");
  GeoPolygon intersects = new GeoPolygon(Arrays.asList(new GeoPoint(43.0, -86.0), new GeoPoint(34.0, -86.0), new GeoPoint(38.627, -74.0), new GeoPoint(43.0, -86.0)), "St. Louis, MO - intersects");
  GeoPolygon disjoint = new GeoPolygon(Arrays.asList(new GeoPoint(43.0, -75.0), new GeoPoint(34.0, -75.0), new GeoPoint(38.627, -65.0), new GeoPoint(43.0, -75.0)), "St. Louis, MO - disjoint");
  // put a hole in the within triangle to make sure it gets stored/retrieved properly
  within.addHole(Arrays.asList(new GeoPoint(39.0, -90.5), new GeoPoint(38.627, -89.5), new GeoPoint(38.5, -90.5), new GeoPoint(39.0, -90.5)));
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoPolygon geoPolygon = (GeoPolygon) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoPolygon);
  assertEquals(within.getDescription(), geoPolygon.getDescription());
}

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

@Test
public void testStoreGeoPolygon() {
  assumeTrue("GeoPolygon storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoPolygon within = new GeoPolygon(Arrays.asList(new GeoPoint(39.4, -91.0), new GeoPoint(38.1, -91.0), new GeoPoint(38.627, -89.0), new GeoPoint(39.4, -91.0)), "St. Louis, MO - within");
  GeoPolygon contains = new GeoPolygon(Arrays.asList(new GeoPoint(50.0, -98.0), new GeoPoint(26.0, -98.0), new GeoPoint(38.627, -75.0), new GeoPoint(50.0, -98.0)), "St. Louis, MO - contains");
  GeoPolygon intersects = new GeoPolygon(Arrays.asList(new GeoPoint(43.0, -86.0), new GeoPoint(34.0, -86.0), new GeoPoint(38.627, -74.0), new GeoPoint(43.0, -86.0)), "St. Louis, MO - intersects");
  GeoPolygon disjoint = new GeoPolygon(Arrays.asList(new GeoPoint(43.0, -75.0), new GeoPoint(34.0, -75.0), new GeoPoint(38.627, -65.0), new GeoPoint(43.0, -75.0)), "St. Louis, MO - disjoint");
  // put a hole in the within triangle to make sure it gets stored/retrieved properly
  within.addHole(Arrays.asList(new GeoPoint(39.0, -90.5), new GeoPoint(38.627, -89.5), new GeoPoint(38.5, -90.5), new GeoPoint(39.0, -90.5)));
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoPolygon geoPolygon = (GeoPolygon) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoPolygon);
  assertEquals(within.getDescription(), geoPolygon.getDescription());
}

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

@Test
public void testStoreGeoCollection() {
  assumeTrue("GeoCollection storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoCollection within = new GeoCollection("St. Louis, MO - within").addShape(new GeoCircle(38.6270, -90.1994, 100));
  GeoCollection contains = new GeoCollection("St. Louis, MO - contains").addShape(new GeoCircle(38.6270, -90.1994, 800));
  GeoCollection intersects = new GeoCollection("St. Louis, MO - intersects").addShape(new GeoCircle(38.6270, -80.0, 500));
  GeoCollection disjoint = new GeoCollection("St. Louis, MO - disjoint").addShape(new GeoCircle(38.6270, -70.0, 500));
  // Add another shape to within to make sure it stores/retrieves properly
  within.addShape(new GeoPoint(38.6270, -90.1994));
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoCollection geoCollection = (GeoCollection) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within.getGeoShapes(), geoCollection.getGeoShapes());
  assertEquals(within.getDescription(), geoCollection.getDescription());
}

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

@Test
public void testStoreGeoCollection() {
  assumeTrue("GeoCollection storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoCollection within = new GeoCollection("St. Louis, MO - within").addShape(new GeoCircle(38.6270, -90.1994, 100));
  GeoCollection contains = new GeoCollection("St. Louis, MO - contains").addShape(new GeoCircle(38.6270, -90.1994, 800));
  GeoCollection intersects = new GeoCollection("St. Louis, MO - intersects").addShape(new GeoCircle(38.6270, -80.0, 500));
  GeoCollection disjoint = new GeoCollection("St. Louis, MO - disjoint").addShape(new GeoCircle(38.6270, -70.0, 500));
  // Add another shape to within to make sure it stores/retrieves properly
  within.addShape(new GeoPoint(38.6270, -90.1994));
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoCollection geoCollection = (GeoCollection) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within.getGeoShapes(), geoCollection.getGeoShapes());
  assertEquals(within.getDescription(), geoCollection.getDescription());
}

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

@Test
public void testStoreGeoRect() {
  assumeTrue("GeoRect storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoRect within = new GeoRect(new GeoPoint(39.52632, -91.35059), new GeoPoint(37.72767, -89.0482), "St. Louis, MO - within");
  GeoRect contains = new GeoRect(new GeoPoint(45.82157, -99.42435), new GeoPoint(31.43242, -80.97444), "St. Louis, MO - contains");
  GeoRect intersects = new GeoRect(new GeoPoint(43.1236, -85.75962), new GeoPoint(34.13039, -74.24038), "St. Louis, MO - intersects");
  GeoRect disjoint = new GeoRect(new GeoPoint(43.1236, -75.75962), new GeoPoint(34.13039, -64.24038), "St. Louis, MO - disjoint");
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoRect geoRect = (GeoRect) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoRect);
  assertEquals(within.getDescription(), geoRect.getDescription());
}

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

@Test
public void testStoreGeoLine() {
  assumeTrue("GeoLine storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoLine within = new GeoLine(new GeoPoint(39.5, -90.1994), new GeoPoint(37.9, -90.1994), "St. Louis, MO - within");
  GeoLine contains = new GeoLine(new GeoPoint(35.0, -100.0), new GeoPoint(39.5, -80), "St. Louis, MO - contains");
  GeoLine intersects = new GeoLine(new GeoPoint(38.67, -85), new GeoPoint(38.67, -80), "St. Louis, MO - intersects");
  GeoLine disjoint = new GeoLine(new GeoPoint(38.6, -74.0), new GeoPoint(38.6, -68), "St. Louis, MO - disjoint");
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoLine geoLine = (GeoLine) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoLine);
  assertEquals(within.getDescription(), geoLine.getDescription());
}

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

@Test
public void testStoreGeoRect() {
  assumeTrue("GeoRect storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoRect within = new GeoRect(new GeoPoint(39.52632, -91.35059), new GeoPoint(37.72767, -89.0482), "St. Louis, MO - within");
  GeoRect contains = new GeoRect(new GeoPoint(45.82157, -99.42435), new GeoPoint(31.43242, -80.97444), "St. Louis, MO - contains");
  GeoRect intersects = new GeoRect(new GeoPoint(43.1236, -85.75962), new GeoPoint(34.13039, -74.24038), "St. Louis, MO - intersects");
  GeoRect disjoint = new GeoRect(new GeoPoint(43.1236, -75.75962), new GeoPoint(34.13039, -64.24038), "St. Louis, MO - disjoint");
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoRect geoRect = (GeoRect) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoRect);
  assertEquals(within.getDescription(), geoRect.getDescription());
}

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

@Test
public void testStoreGeoLine() {
  assumeTrue("GeoLine storage and queries are not supported", isAdvancedGeoQuerySupported());
  GeoLine within = new GeoLine(new GeoPoint(39.5, -90.1994), new GeoPoint(37.9, -90.1994), "St. Louis, MO - within");
  GeoLine contains = new GeoLine(new GeoPoint(35.0, -100.0), new GeoPoint(39.5, -80), "St. Louis, MO - contains");
  GeoLine intersects = new GeoLine(new GeoPoint(38.67, -85), new GeoPoint(38.67, -80), "St. Louis, MO - intersects");
  GeoLine disjoint = new GeoLine(new GeoPoint(38.6, -74.0), new GeoPoint(38.6, -68), "St. Louis, MO - disjoint");
  doALLGeoshapeTestQueries(intersects, disjoint, within, contains);
  QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A_AND_B).has("location", within.getDescription()).vertices();
  assertEquals(1, vertices.getTotalHits());
  Assert.assertEquals(1, count(vertices));
  GeoLine geoLine = (GeoLine) toList(vertices).get(0).getPropertyValue("location");
  assertEquals(within, geoLine);
  assertEquals(within.getDescription(), geoLine.getDescription());
}

相关文章