本文整理了Java中org.vertexium.Vertex.getEdgeVertexPairs()
方法的一些代码示例,展示了Vertex.getEdgeVertexPairs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.getEdgeVertexPairs()
方法的具体详情如下:
包路径:org.vertexium.Vertex
类名称:Vertex
方法名:getEdgeVertexPairs
[英]Gets all edge/vertex pairs with the given label attached to this vertex.
[中]获取给定标签附着到此顶点的所有边/顶点对。
代码示例来源:origin: visallo/vertexium
@Test
public void testGetEdgeVertexPairs() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v3 = graph.addVertex("v3", VISIBILITY_A, AUTHORIZATIONS_A);
Edge v1_to_v2_label1 = graph.addEdge("v1_to_v2_label1", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
Edge v1_to_v2_label2 = graph.addEdge("v1_to_v2_label2", v1, v2, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
Edge v1_to_v3_label2 = graph.addEdge("v1_to_v3_label2", v1, v3, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
v1 = graph.getVertex("v1", AUTHORIZATIONS_A);
List<EdgeVertexPair> pairs = toList(v1.getEdgeVertexPairs(Direction.BOTH, AUTHORIZATIONS_A));
assertEquals(3, pairs.size());
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v2_label1, v2)));
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v2_label2, v2)));
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v3_label2, v3)));
pairs = toList(v1.getEdgeVertexPairs(Direction.BOTH, LABEL_LABEL2, AUTHORIZATIONS_A));
assertEquals(2, pairs.size());
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v2_label2, v2)));
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v3_label2, v3)));
}
代码示例来源:origin: org.vertexium/vertexium-test
@Test
public void testGetEdgeVertexPairs() {
Vertex v1 = graph.addVertex("v1", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v2 = graph.addVertex("v2", VISIBILITY_A, AUTHORIZATIONS_A);
Vertex v3 = graph.addVertex("v3", VISIBILITY_A, AUTHORIZATIONS_A);
Edge v1_to_v2_label1 = graph.addEdge("v1_to_v2_label1", v1, v2, LABEL_LABEL1, VISIBILITY_A, AUTHORIZATIONS_A);
Edge v1_to_v2_label2 = graph.addEdge("v1_to_v2_label2", v1, v2, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
Edge v1_to_v3_label2 = graph.addEdge("v1_to_v3_label2", v1, v3, LABEL_LABEL2, VISIBILITY_A, AUTHORIZATIONS_A);
graph.flush();
v1 = graph.getVertex("v1", AUTHORIZATIONS_A);
List<EdgeVertexPair> pairs = toList(v1.getEdgeVertexPairs(Direction.BOTH, AUTHORIZATIONS_A));
assertEquals(3, pairs.size());
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v2_label1, v2)));
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v2_label2, v2)));
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v3_label2, v3)));
pairs = toList(v1.getEdgeVertexPairs(Direction.BOTH, LABEL_LABEL2, AUTHORIZATIONS_A));
assertEquals(2, pairs.size());
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v2_label2, v2)));
assertTrue(pairs.contains(new EdgeVertexPair(v1_to_v3_label2, v3)));
}
代码示例来源:origin: org.vertexium/vertexium-core
foundPaths.add(currentPath);
} else if (hops > 0) {
Iterable<Vertex> vertices = filterFindPathEdgePairs(options, sourceVertex.getEdgeVertexPairs(Direction.BOTH, options.getLabels(), authorizations));
int vertexCount = 0;
if (firstLevelRecursion) {
代码示例来源:origin: visallo/vertexium
foundPaths.add(currentPath);
} else if (hops > 0) {
Iterable<Vertex> vertices = filterFindPathEdgePairs(options, sourceVertex.getEdgeVertexPairs(Direction.BOTH, options.getLabels(), authorizations));
int vertexCount = 0;
if (firstLevelRecursion) {
代码示例来源:origin: org.visallo/visallo-model-vertexium
@Override
public void updatePropertyDomainIris(OntologyProperty property, Set<String> domainIris, User user, String workspaceId) {
VertexiumOntologyProperty vertexiumProperty = (VertexiumOntologyProperty) property;
if (!isPublic(workspaceId) && property.getSandboxStatus() != SandboxStatus.PRIVATE) {
throw new UnsupportedOperationException("Sandboxed updating of domain iris is not currently supported for published properties");
}
Iterable<EdgeVertexPair> existingConcepts = vertexiumProperty.getVertex().getEdgeVertexPairs(Direction.BOTH, LabelName.HAS_PROPERTY.toString(), getAuthorizations(workspaceId));
for (EdgeVertexPair existingConcept : existingConcepts) {
String conceptIri = OntologyProperties.ONTOLOGY_TITLE.getPropertyValue(existingConcept.getVertex());
if (!domainIris.remove(conceptIri)) {
getGraph().softDeleteEdge(existingConcept.getEdge(), getAuthorizations(workspaceId));
}
}
for (String domainIri : domainIris) {
Vertex domainVertex;
Concept concept = getConceptByIRI(domainIri, workspaceId);
if (concept != null) {
domainVertex = ((VertexiumConcept) concept).getVertex();
} else {
Relationship relationship = getRelationshipByIRI(domainIri, workspaceId);
if (relationship != null) {
domainVertex = ((VertexiumRelationship) relationship).getVertex();
} else {
throw new VisalloException("Could not find domain with IRI " + domainIri);
}
}
findOrAddEdge(domainVertex, ((VertexiumOntologyProperty) property).getVertex(), LabelName.HAS_PROPERTY.toString(), user, workspaceId);
}
}
内容来源于网络,如有侵权,请联系作者删除!