本文整理匯總了Java中com.tinkerpop.blueprints.Vertex.getEdges方法的典型用法代碼示例。如果您正苦於以下問題:Java Vertex.getEdges方法的具體用法?Java Vertex.getEdges怎麽用?Java Vertex.getEdges使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.tinkerpop.blueprints.Vertex
的用法示例。
在下文中一共展示了Vertex.getEdges方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: migrateContainer
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void migrateContainer(Vertex container) {
boolean isPublished = false;
Iterable<Edge> edges = container.getEdges(Direction.IN, "HAS_FIELD_CONTAINER");
// Check whether the container is published
for (Edge edge : edges) {
String type = edge.getProperty("edgeType");
if ("P".equals(type)) {
isPublished = true;
}
}
// The container is not published anywhere. Remove the bogus publish webroot info which otherwise causes publish webroot conflicts with new versions.
if (!isPublished) {
if (container.getProperty(WEBROOT_PUB) != null) {
log.info("Found inconsistency on container {" + container.getProperty("uuid") + "}");
container.removeProperty(WEBROOT_PUB);
log.info("Inconsistency fixed");
}
}
}
示例2: migrateSchemaContainerRootEdges
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
/**
* The edge label has change. Migrate existing edges.
*/
private void migrateSchemaContainerRootEdges(Vertex schemaRoot) {
for (Edge edge : schemaRoot.getEdges(Direction.OUT, "HAS_SCHEMA_CONTAINER")) {
Vertex container = edge.getVertex(Direction.IN);
schemaRoot.addEdge("HAS_SCHEMA_CONTAINER_ITEM", container);
edge.remove();
}
}
示例3: migrateTagFamilies
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void migrateTagFamilies(Vertex project) {
Vertex tagFamilyRoot = project.getVertices(Direction.OUT, "HAS_TAGFAMILY_ROOT").iterator().next();
for (Vertex tagFamily : tagFamilyRoot.getVertices(Direction.OUT, "HAS_TAG_FAMILY")) {
// Check dates
Object tagFamilyCreationTimeStamp = tagFamily.getProperty("creation_timestamp");
if (tagFamilyCreationTimeStamp == null) {
tagFamily.setProperty("creation_timestamp", System.currentTimeMillis());
}
Object tagFamilyEditTimeStamp = tagFamily.getProperty("last_edited_timestamp");
if (tagFamilyEditTimeStamp == null) {
tagFamily.setProperty("last_edited_timestamp", System.currentTimeMillis());
}
// Create a new tag root vertex for the tagfamily and link the tags to this vertex instead to the tag family itself.
Vertex tagRoot = getGraph().addVertex("class:TagRootImpl");
tagRoot.setProperty("ferma_type", "com.gentics.mesh.core.data.root.impl.TagRootImpl");
tagRoot.setProperty("uuid", randomUUID());
for (Edge tagEdge : tagFamily.getEdges(Direction.OUT, "HAS_TAG")) {
Vertex tag = tagEdge.getVertex(Direction.IN);
tagEdge.remove();
tagRoot.addEdge("HAS_TAG", tag);
tag.getEdges(Direction.OUT, "HAS_TAGFAMILY_ROOT").forEach(edge -> edge.remove());
tag.addEdge("HAS_TAGFAMILY_ROOT", tagFamily);
if (!tag.getEdges(Direction.OUT, "ASSIGNED_TO_PROJECT").iterator().hasNext()) {
log.error("Tag {" + tag.getProperty("uuid") + " has no project assigned to it. Fixing it...");
tag.addEdge("ASSIGNED_TO_PROJECT", project);
}
Object creationTimeStamp = tag.getProperty("creation_timestamp");
if (creationTimeStamp == null) {
tag.setProperty("creation_timestamp", System.currentTimeMillis());
}
Object editTimeStamp = tag.getProperty("last_edited_timestamp");
if (editTimeStamp == null) {
tag.setProperty("last_edited_timestamp", System.currentTimeMillis());
}
}
tagFamily.addEdge("HAS_TAG_ROOT", tagRoot);
if (!tagFamily.getEdges(Direction.OUT, "ASSIGNED_TO_PROJECT").iterator().hasNext()) {
log.error("TagFamily {" + tagFamily.getProperty("uuid") + " has no project assigned to it. Fixing it...");
tagFamily.addEdge("ASSIGNED_TO_PROJECT", project);
}
getOrFixUserReference(tagFamily, "HAS_EDITOR");
getOrFixUserReference(tagFamily, "HAS_CREATOR");
}
}