本文整理匯總了Java中com.tinkerpop.blueprints.Vertex.removeProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Vertex.removeProperty方法的具體用法?Java Vertex.removeProperty怎麽用?Java Vertex.removeProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.tinkerpop.blueprints.Vertex
的用法示例。
在下文中一共展示了Vertex.removeProperty方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateProperty
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void updateProperty(String propertyName, Vertex node) {
Object obj = node.getProperty(propertyName);
if (obj == null) {
return;
}
if (!(obj instanceof String)) {
if (log.isDebugEnabled()) {
log.debug("Property '{}' for node '{}' in database is no string so we don't convert it. {}: '{}'", propertyName, node.getProperty(UUID), obj.getClass(), obj);
}
return;
}
String strVal = (String) obj;
Number numVal;
try {
numVal = format.parse(strVal);
} catch (ParseException e) {
log.warn("Could not parse the number '{}', for field '{}' in node {}", strVal, propertyName, node.getId());
numVal = 0;
}
node.removeProperty(propertyName);
node.setProperty(propertyName, numVal);
}
示例2: updateMicroschemas
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
private void updateMicroschemas(Vertex meshRoot) {
Vertex microschemaRoot = meshRoot.getVertices(OUT, "HAS_MICROSCHEMA_ROOT").iterator().next();
Iterator<Vertex> microschemaIt = microschemaRoot.getVertices(OUT, "HAS_SCHEMA_CONTAINER_ITEM").iterator();
while (microschemaIt.hasNext()) {
Vertex microschemaVertex = microschemaIt.next();
Iterator<Vertex> versionIt = microschemaVertex.getVertices(OUT, "HAS_PARENT_CONTAINER").iterator();
while (versionIt.hasNext()) {
Vertex schemaVersion = versionIt.next();
// Update the version within the vertex
int vertexVersion = schemaVersion.getProperty("version");
schemaVersion.removeProperty("version");
schemaVersion.setProperty("version", String.valueOf(vertexVersion) + ".0");
// Update the version within the json
String json = schemaVersion.getProperty("json");
JsonObject schema = new JsonObject(json);
int version = schema.getInteger("version");
schema.remove("version");
schema.put("version", String.valueOf(version) + ".0");
schemaVersion.setProperty("json", schema.toString());
}
}
}
示例3: 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");
}
}
}
示例4: 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") + "}");
}
示例5: 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();
}
示例6: migrateSchemaContainers
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
/**
* Add the schema container versions to schema containers.
*/
private void migrateSchemaContainers() {
log.info("Migrating schema containers");
for (Vertex schemaContainer : getGraph().getVertices()) {
String type = schemaContainer.getProperty("ferma_type");
if (type != null && type.endsWith("SchemaContainerImpl")) {
String name = schemaContainer.getProperty("name");
log.info("Migrating schema {" + name + "}");
String json = schemaContainer.getProperty("json");
schemaContainer.removeProperty("json");
try {
JSONObject schema = new JSONObject(json);
// TVC does not use segment fields. Remove the segment field properties from the schema
if (schema.has("segmentField")) {
schema.remove("segmentField");
}
if (schema.has("meshVersion")) {
schema.remove("meshVersion");
}
// property was renamed
if (schema.has("folder")) {
schema.put("container", schema.getBoolean("folder"));
schema.remove("folder");
}
if (schema.has("binary") && schema.getBoolean("binary")) {
JSONObject binaryFieldSchema = new JSONObject();
binaryFieldSchema.put("name", "binary");
binaryFieldSchema.put("label", "Binary Content");
binaryFieldSchema.put("required", false);
binaryFieldSchema.put("type", "binary");
schema.getJSONArray("fields").put(binaryFieldSchema);
}
// Check whether all fields have a name
JSONArray fields = schema.getJSONArray("fields");
for (int i = 0; i < fields.length(); i++) {
// Remove fields which have no name to it.
JSONObject field = fields.getJSONObject(i);
if (!field.has("name")) {
fields.remove(field);
}
}
schema.remove("fields");
schema.put("fields", fields);
schema.put("version", "1");
if (schema.has("binary")) {
schema.remove("binary");
}
json = schema.toString();
} catch (JSONException e) {
throw new RuntimeException("Could not parse stored schema {" + json + "}");
}
Vertex version = getGraph().addVertex("class:SchemaContainerVersionImpl");
version.setProperty("uuid", randomUUID());
version.setProperty("name", name);
version.setProperty("json", json);
version.setProperty("version", 1);
version.setProperty("ferma_type", "com.gentics.mesh.core.data.schema.impl.SchemaContainerVersionImpl");
schemaContainer.addEdge("HAS_LATEST_VERSION", version);
schemaContainer.addEdge("HAS_PARENT_CONTAINER", version);
}
}
log.info("Completed migration of schema containers");
}
示例7: clean
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void clean(Vertex v) {
v.removeProperty(connectedComponentsKey);
}
示例8: clean
import com.tinkerpop.blueprints.Vertex; //導入方法依賴的package包/類
@Override
public void clean(Vertex v) {
v.removeProperty(LP_COMMUNITY_KEY);
v.removeProperty(LP_COMPUTED_COMMUNITY_KEY);
}