本文整理了Java中org.vertexium.Vertex.addPropertyValue()
方法的一些代码示例,展示了Vertex.addPropertyValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.addPropertyValue()
方法的具体详情如下:
包路径:org.vertexium.Vertex
类名称:Vertex
方法名:addPropertyValue
暂无
代码示例来源:origin: org.vertexium/vertexium-test
Assert.assertEquals(3, count(v.getProperties()));
v.addPropertyValue("propid1b", "prop1", "value1a-new", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
graph.flush();
v = graph.getVertex("v1", AUTHORIZATIONS_A);
代码示例来源:origin: visallo/vertexium
v1.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
代码示例来源:origin: visallo/vertexium
Assert.assertEquals(3, count(v.getProperties()));
v.addPropertyValue("propid1b", "prop1", "value1a-new", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
graph.flush();
v = graph.getVertex("v1", AUTHORIZATIONS_A);
代码示例来源:origin: org.vertexium/vertexium-test
v1.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_B, AUTHORIZATIONS_A_AND_B);
graph.flush();
代码示例来源: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);
v1.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
graph.flush();
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);
v2.addPropertyValue("key1", "firstName", "Joe", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
graph.flush();
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testFetchHintsProperties() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n1", "value1", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n2", "value2", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n3", "value3", VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
FetchHints specificPropertiesFetchHints = FetchHints.builder()
.setPropertyNamesToInclude("n1", "n3")
.build();
Vertex v1WithoutN2 = graph.getVertex("v1", specificPropertiesFetchHints, AUTHORIZATIONS_A);
assertEquals("value1", v1WithoutN2.getPropertyValue("n1"));
assertThrowsException(() -> v1WithoutN2.getProperty("n1").getMetadata());
assertThrowsException(() -> v1WithoutN2.getPropertyValue("n2"));
assertEquals("value3", v1WithoutN2.getPropertyValue("n3"));
FetchHints noPropertiesFetchHints = FetchHints.NONE;
Vertex v1WithNotProperties = graph.getVertex("v1", noPropertiesFetchHints, AUTHORIZATIONS_A);
assertThrowsException(v1WithNotProperties::getProperties);
assertThrowsException(() -> v1WithNotProperties.getProperty("n1"));
FetchHints allPropertiesFetchHints = FetchHints.builder()
.setIncludeAllProperties(true)
.setPropertyNamesToInclude("n1", "n3")
.build();
v1 = graph.getVertex("v1", allPropertiesFetchHints, AUTHORIZATIONS_A);
assertEquals("value1", v1.getPropertyValue("n1"));
assertEquals("value2", v1.getPropertyValue("n2"));
assertEquals("value3", v1.getPropertyValue("n3"));
}
代码示例来源: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);
v1.addPropertyValue("key1", "firstName", "Joseph", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
graph.flush();
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);
v2.addPropertyValue("key1", "firstName", "Joe", VISIBILITY_A, AUTHORIZATIONS_A_AND_B);
graph.flush();
代码示例来源:origin: visallo/vertexium
@Test
public void testFetchHintsProperties() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n1", "value1", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n2", "value2", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n3", "value3", VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
FetchHints specificPropertiesFetchHints = FetchHints.builder()
.setPropertyNamesToInclude("n1", "n3")
.build();
Vertex v1WithoutN2 = graph.getVertex("v1", specificPropertiesFetchHints, AUTHORIZATIONS_A);
assertEquals("value1", v1WithoutN2.getPropertyValue("n1"));
assertThrowsException(() -> v1WithoutN2.getProperty("n1").getMetadata());
assertThrowsException(() -> v1WithoutN2.getPropertyValue("n2"));
assertEquals("value3", v1WithoutN2.getPropertyValue("n3"));
FetchHints noPropertiesFetchHints = FetchHints.NONE;
Vertex v1WithNotProperties = graph.getVertex("v1", noPropertiesFetchHints, AUTHORIZATIONS_A);
assertThrowsException(v1WithNotProperties::getProperties);
assertThrowsException(() -> v1WithNotProperties.getProperty("n1"));
FetchHints allPropertiesFetchHints = FetchHints.builder()
.setIncludeAllProperties(true)
.setPropertyNamesToInclude("n1", "n3")
.build();
v1 = graph.getVertex("v1", allPropertiesFetchHints, AUTHORIZATIONS_A);
assertEquals("value1", v1.getPropertyValue("n1"));
assertEquals("value2", v1.getPropertyValue("n2"));
assertEquals("value3", v1.getPropertyValue("n3"));
}
代码示例来源:origin: visallo/vertexium
Vertex v1 = graph.addVertex("v1", VISIBILITY_EMPTY, AUTHORIZATIONS_EMPTY);
Metadata metadata = Metadata.create();
v1.addPropertyValue("prop1", "prop1", "val1", metadata, VISIBILITY_EMPTY, AUTHORIZATIONS_A_AND_B);
v2.addPropertyValue("prop1", "prop1", "val1", metadata, VISIBILITY_EMPTY, AUTHORIZATIONS_A_AND_B);
graph.flush();
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testAddValuesToExistingProperties() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
graph.defineProperty("p1").dataType(String.class).sortable(true).textIndexHint(TextIndexHint.ALL).define();
v1.addPropertyValue("k1", "p1", "val1", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val1").vertexIds(), "v1");
v1.addPropertyValue("k2", "p1", "val2", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val1").vertexIds(), "v1");
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val2").vertexIds(), "v1");
assertResultsCount(0, 0, getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val3").vertexIds());
v1.addPropertyValue("k1", "p1", "val3", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val3").vertexIds(), "v1");
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val2").vertexIds(), "v1");
assertResultsCount(0, 0, getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val1").vertexIds());
}
代码示例来源:origin: visallo/vertexium
@Test
public void testAddValuesToExistingProperties() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
graph.defineProperty("p1").dataType(String.class).sortable(true).textIndexHint(TextIndexHint.ALL).define();
v1.addPropertyValue("k1", "p1", "val1", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val1").vertexIds(), "v1");
v1.addPropertyValue("k2", "p1", "val2", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val1").vertexIds(), "v1");
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val2").vertexIds(), "v1");
assertResultsCount(0, 0, getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val3").vertexIds());
v1.addPropertyValue("k1", "p1", "val3", VISIBILITY_A, AUTHORIZATIONS_ALL);
getGraph().flush();
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val3").vertexIds(), "v1");
assertIdsAnyOrder(getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val2").vertexIds(), "v1");
assertResultsCount(0, 0, getGraph().query(AUTHORIZATIONS_ALL).has("p1", "val1").vertexIds());
}
代码示例来源:origin: visallo/vertexium
@Test
public void testDeleteHistoricalLegacyStreamingPropertyValueData_mixOfOldAndNew() throws Exception {
String vertexId = "v1";
graph.prepareVertex(vertexId, VISIBILITY_EMPTY)
.save(AUTHORIZATIONS_EMPTY);
graph.flush();
long timestamp = new Date().getTime();
String propertyKey = "prefix";
String propertyName = "prop1";
String propertyValue1 = "Hello1";
String propertyValue2 = "Hello2";
addLegacySPVData(vertexId, timestamp - 100, propertyKey, propertyName, propertyValue1);
StreamingPropertyValue newSpv = StreamingPropertyValue.create(propertyValue2);
getGraph().getVertex("v1", AUTHORIZATIONS_EMPTY)
.addPropertyValue(propertyKey, propertyName, newSpv, VISIBILITY_EMPTY, AUTHORIZATIONS_EMPTY);
getGraph().flush();
new DeleteHistoricalLegacyStreamingPropertyValueData(getGraph())
.execute(
new DeleteHistoricalLegacyStreamingPropertyValueData.Options()
.setDryRun(false)
.setVersionsToKeep(1),
AUTHORIZATIONS_EMPTY
);
// verify we can still retrieve it
Vertex v1 = graph.getVertex(vertexId, AUTHORIZATIONS_EMPTY);
StreamingPropertyValue spv = (StreamingPropertyValue) v1.getPropertyValue(propertyKey, propertyName);
assertNotNull("spv should not be null", spv);
assertEquals(propertyValue2, IOUtils.toString(spv.getInputStream()));
}
代码示例来源:origin: org.vertexium/vertexium-test
metadata.add("m2", "m2value", VISIBILITY_A);
metadata.add("m3", "m3value", VISIBILITY_A);
v1.addPropertyValue("k1", "n1", "value1", metadata, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
代码示例来源:origin: visallo/vertexium
metadata.add("m2", "m2value", VISIBILITY_A);
metadata.add("m3", "m3value", VISIBILITY_A);
v1.addPropertyValue("k1", "n1", "value1", metadata, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testFetchHints() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n1", "value1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e1", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
代码示例来源:origin: visallo/vertexium
@Test
public void testFetchHints() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
v1.addPropertyValue("k1", "n1", "value1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Edge e1 = graph.addEdge("e1", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
内容来源于网络,如有侵权,请联系作者删除!