本文整理匯總了Java中com.tinkerpop.blueprints.Vertex.getVertices方法的典型用法代碼示例。如果您正苦於以下問題:Java Vertex.getVertices方法的具體用法?Java Vertex.getVertices怎麽用?Java Vertex.getVertices使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.tinkerpop.blueprints.Vertex
的用法示例。
在下文中一共展示了Vertex.getVertices方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void apply() {
Vertex meshRoot = getMeshRootVertex();
Vertex projectRoot = meshRoot.getVertices(Direction.OUT, "HAS_PROJECT_ROOT").iterator().next();
for (Vertex project : projectRoot.getVertices(Direction.OUT, "HAS_PROJECT")) {
Iterator<Vertex> it = project.getVertices(Direction.OUT, "HAS_RELEASE_ROOT").iterator();
if (it.hasNext()) {
Vertex releaseRoot = it.next();
// Iterate over all releases
for (Vertex release : releaseRoot.getVertices(Direction.OUT, "HAS_RELEASE")) {
processRelease(release);
}
}
}
}
示例2: migrateTags
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
/**
* Tags no longer have a TagGraphFieldContainerImpl. The value is now stored directly in the tag vertex.
*
* @param meshRoot
*/
private void migrateTags(Vertex meshRoot) {
Vertex tagRoot = meshRoot.getVertices(Direction.OUT, "HAS_TAG_ROOT").iterator().next();
for (Vertex tag : tagRoot.getVertices(Direction.OUT, "HAS_TAG")) {
Iterator<Vertex> tagFieldIterator = tag.getVertices(Direction.OUT, "HAS_FIELD_CONTAINER").iterator();
Vertex tagFieldContainer = tagFieldIterator.next();
if (tagFieldIterator.hasNext()) {
fail("The tag with uuid {" + tag.getProperty("uuid") + "} got more then one field container.");
}
// Load the tag value from the field container and store it directly into the tag. Remove the now no longer needed field container from the graph.
String tagValue = tagFieldContainer.getProperty("name");
tag.setProperty("tagValue", tagValue);
tagFieldContainer.remove();
// Check editor /creator
getOrFixUserReference(tag, "HAS_EDITOR");
getOrFixUserReference(tag, "HAS_CREATOR");
}
}
示例3: apply
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void apply() {
// 1. Remove jobs
Vertex meshRoot = getMeshRootVertex();
Iterator<Vertex> it = meshRoot.getVertices(Direction.OUT, "HAS_JOB_ROOT").iterator();
if (it.hasNext()) {
Vertex jobRoot = meshRoot.getVertices(Direction.OUT, "HAS_JOB_ROOT").iterator().next();
Iterable<Vertex> jobIt = jobRoot.getVertices(OUT, "HAS_JOB");
for (Vertex v : jobIt) {
v.remove();
}
}
// 2. Remove JobImpl type since we have now specific job vertices
getDb().removeVertexType("JobImpl");
}
示例4: findBinary
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private Vertex findBinary(String hash, Vertex binaryRoot) {
for (Vertex binary : binaryRoot.getVertices(OUT, "HAS_BINARY")) {
String foundHash = binary.getProperty(NEW_HASH_KEY);
if (foundHash.equals(hash)) {
return binary;
}
}
return null;
}
示例5: apply
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void apply() {
Vertex meshRoot = getMeshRootVertex();
Vertex projectRoot = meshRoot.getVertices(Direction.OUT, "HAS_PROJECT_ROOT").iterator().next();
// Iterate over all projects
for (Vertex project : projectRoot.getVertices(Direction.OUT, "HAS_PROJECT")) {
// Migrate all nodes of the project
Vertex baseNode = project.getVertices(Direction.OUT, "HAS_ROOT_NODE").iterator().next();
migrateNode(baseNode);
}
}
示例6: updateLists
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void updateLists(Vertex container, Map<String, JsonObject> fieldMap) {
for (Vertex listElement: container.getVertices(Direction.OUT, HAS_LIST)) {
String fieldName = listElement.getProperty(FIELD_KEY);
if (fieldMap.containsKey(fieldName) && NUMBER_TYPE.equals(fieldMap.get(fieldName).getString(FIELD_LIST_TYPE_KEY))) {
listElement.getPropertyKeys().stream()
.filter(k -> k.startsWith(ITEM_PREFIX))
.forEach(k -> updateProperty(k, listElement));
}
}
}
示例7: updateVerticesForSchema
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
public void updateVerticesForSchema(Vertex schemaVertex, Map<String, JsonObject> fieldMap, String label) {
long count = 0;
for (Vertex vertex : schemaVertex.getVertices(Direction.IN, label)) {
count++;
updateFields(vertex, fieldMap);
updateLists(vertex, fieldMap);
if (count % 10000 == 0) {
log.debug("Commit the changes for the last 10.000 vertices to database...");
getGraph().commit();
log.info("Updated vertices {}", count);
}
}
}
示例8: apply
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void apply() {
Vertex meshRoot = getMeshRootVertex();
Vertex nodeRoot = meshRoot.getVertices(Direction.OUT, "HAS_NODE_ROOT").iterator().next();
log.info("Migrating node publish flag..");
long i = 0;
// Iterate over all nodes
for (Vertex node : nodeRoot.getVertices(Direction.OUT, "HAS_NODE")) {
migrateNode(node);
i++;
}
log.info("Completed migration of {" + i + "} nodes.");
}
示例9: migrateNode
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void migrateNode(Vertex node) {
// Extract and remove the published flag from the node
String publishFlag = node.getProperty("published");
node.removeProperty("published");
// Set the published flag to all node graph field containers
Iterable<Vertex> containers = node.getVertices(Direction.OUT, "HAS_FIELD_CONTAINER");
for (Vertex container : containers) {
if (publishFlag != null) {
container.setProperty("published", publishFlag);
}
}
log.info("Migrated node {" + node.getProperty("uuid") + "}");
}
示例10: migrateUsers
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void migrateUsers(Vertex meshRoot) {
Vertex userRoot = meshRoot.getVertices(Direction.OUT, "HAS_USER_ROOT").iterator().next();
for (Vertex user : userRoot.getVertices(Direction.OUT, "HAS_USER")) {
// Check editor/creator
getOrFixUserReference(user, "HAS_EDITOR");
getOrFixUserReference(user, "HAS_CREATOR");
}
}
示例11: apply
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void apply() {
try {
FileUtils.moveDirectory(new File("data/binaryFiles"), new File("data/binaryFilesOld"));
} catch (IOException e) {
throw new RuntimeException("Could not move binary files to backup location.", e);
}
Vertex meshRoot = getMeshRootVertex();
meshRoot.removeProperty("databaseVersion");
Vertex projectRoot = meshRoot.getVertices(Direction.OUT, "HAS_PROJECT_ROOT").iterator().next();
// Delete bogus vertices
List<String> ids = Arrays.asList("#70:4", "#79:148", "#62:5");
for (String id : ids) {
Vertex vertex = getGraph().getVertex(id);
getGraph().removeVertex(vertex);
}
migrateSchemaContainers();
Vertex schemaRoot = meshRoot.getVertices(Direction.OUT, "HAS_ROOT_SCHEMA").iterator().next();
migrateSchemaContainerRootEdges(schemaRoot);
// Iterate over all projects
for (Vertex project : projectRoot.getVertices(Direction.OUT, "HAS_PROJECT")) {
Vertex baseNode = project.getVertices(Direction.OUT, "HAS_ROOT_NODE").iterator().next();
migrateNode(baseNode, project);
migrateTagFamilies(project);
Vertex projectSchemaRoot = project.getVertices(Direction.OUT, "HAS_ROOT_SCHEMA").iterator().next();
migrateSchemaContainerRootEdges(projectSchemaRoot);
}
migrateFermaTypes();
purgeSearchQueue();
}
示例12: purgeSearchQueue
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void purgeSearchQueue() {
Vertex meshRoot = getMeshRootVertex();
Vertex sqRoot = meshRoot.getVertices(Direction.OUT, "HAS_SEARCH_QUEUE_ROOT").iterator().next();
for (Vertex batch : sqRoot.getVertices(Direction.OUT, "HAS_BATCH")) {
for (Vertex entry : batch.getVertices(Direction.OUT, "HAS_ITEM")) {
entry.remove();
}
batch.remove();
}
}
示例13: apply
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void apply() {
Vertex meshRoot = getMeshRootVertex();
Vertex searchQueueRoot = meshRoot.getVertices(OUT, "HAS_SEARCH_QUEUE_ROOT").iterator().next();
for (Vertex batch : searchQueueRoot.getVertices(OUT, "HAS_BATCH")) {
for (Vertex entry : batch.getVertices(OUT, "HAS_ITEM")) {
entry.remove();
}
batch.remove();
}
searchQueueRoot.remove();
}
示例14: apply
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void apply() {
Vertex meshRoot = MeshGraphHelper.getMeshRootVertex(getGraph());
Vertex projectRoot = meshRoot.getVertices(Direction.OUT, "HAS_PROJECT_ROOT").iterator().next();
for (Vertex project : projectRoot.getVertices(Direction.OUT, "HAS_PROJECT")) {
Iterator<Vertex> it = project.getVertices(Direction.OUT, "HAS_RELEASE_ROOT").iterator();
if (it.hasNext()) {
Vertex releaseRoot = it.next();
for (Vertex release : releaseRoot.getVertices(Direction.OUT, "HAS_RELEASE")) {
// Assign the release to the project
release.addEdge("ASSIGNED_TO_PROJECT", project);
}
}
}
}
示例15: compute
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void compute(Vertex v) {
String minLabel = v.getProperty(connectedComponentsKey);
String neighLabel = null;
for(Vertex neigh : v.getVertices(Direction.BOTH)) {
neighLabel = neigh.getProperty(connectedComponentsKey);
minLabel = minLabel.compareTo(neighLabel) <= 0 ? minLabel : neighLabel;
}
if( ! minLabel.equals(v.getProperty(connectedComponentsKey)) )
v.setProperty(connectedComponentsKey, minLabel);
}