本文整理了Java中com.tinkerpop.blueprints.Vertex.getPropertyKeys()
方法的一些代码示例,展示了Vertex.getPropertyKeys()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vertex.getPropertyKeys()
方法的具体详情如下:
包路径:com.tinkerpop.blueprints.Vertex
类名称:Vertex
方法名:getPropertyKeys
暂无
代码示例来源:origin: joshsh/ripple
@Override
public Collection<String> getKeys(Vertex instance) {
return instance.getPropertyKeys();
}
代码示例来源:origin: tinkerpop/furnace
public Set<String> getPropertyKeys() {
return baseVertex.getPropertyKeys();
}
代码示例来源:origin: apache/incubator-atlas
public Collection<String> getPropertyKeys() {
Collection<String> propertyKeys = new TreeSet<>(resourceComparator);
for (String p : vertex.getPropertyKeys()) {
String cleanName = propertyMapper.toCleanName(p, vertexType);
if (! removedProperties.contains(cleanName)) {
propertyKeys.add(cleanName);
}
}
return propertyKeys;
}
代码示例来源:origin: gentics/mesh
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));
}
}
}
代码示例来源:origin: SciGraph/SciGraph
public void project(Collection<String> projection) {
if (projection.contains("*")) {
return;
}
for (Vertex vertex : graph.getVertices()) {
for (String key : vertex.getPropertyKeys()) {
if (!projection.contains(key) && !PROTECTED_PROPERTY_KEYS.contains(key)) {
vertex.removeProperty(key);
}
}
}
}
代码示例来源:origin: com.puresoltechnologies.extended-objects/titan
@Override
public Set<String> getEntityDiscriminators(Vertex vertex) {
Set<String> discriminators = new HashSet<>();
for (String key : vertex.getPropertyKeys()) {
if (key.startsWith(TitanStoreSession.XO_DISCRIMINATORS_PROPERTY)) {
String discriminator = vertex.getProperty(key);
discriminators.add(discriminator);
}
}
if (discriminators.size() == 0) {
throw new XOException(
"A vertex was found without discriminators. Does another framework alter the database?");
}
return discriminators;
}
代码示例来源:origin: SciGraph/SciGraph
@Override
public Paint transform(Vertex vertex) {
if (vertex.getPropertyKeys().contains(Concept.CATEGORY)) {
Object categories = vertex.getProperty(Concept.CATEGORY);
if (categories.getClass().isArray() || categories instanceof Iterable) {
return Color.WHITE;
} else {
String category = (String) categories;
if (!colorMap.containsKey(category)) {
if (index > colors.size()) {
return Color.WHITE;
} else {
colorMap.put(category, colors.get(index++));
}
}
return colorMap.get(category);
}
} else {
return Color.WHITE;
}
}
};
代码示例来源:origin: apache/incubator-atlas
public Map<String, Object> getPropertyMap() {
Map<String, Object> props = new TreeMap<>(resourceComparator);
for (String p : vertex.getPropertyKeys()) {
String cleanName = propertyMapper.toCleanName(p, vertexType);
if (! removedProperties.contains(cleanName)) {
Object val = vertex.getProperty(p);
if (propertyValueFormatters.containsKey(cleanName)) {
val = propertyValueFormatters.get(cleanName).format(val);
}
props.put(cleanName, val);
}
}
return props;
}
代码示例来源:origin: iTransformers/netTransformer
private GraphmlNode vertexToNode(Vertex vertex){
GraphmlNode node = new GraphmlNode(vertex.getId().toString(),vertex.getId().toString());
Map<String, String> graphmlNodeData = new HashMap<>();
Set<String> keys = vertex.getPropertyKeys();
for (String key : keys) {
graphmlNodeData.put(key,vertex.getProperty(key));
}
node.setGraphmlNodeData(graphmlNodeData);
return node;
}
代码示例来源:origin: SciGraph/SciGraph
@Override
public String transform(Vertex vertex) {
String label = "";
if (vertex.getPropertyKeys().contains(NodeProperties.LABEL)) {
Object labels = vertex.getProperty(NodeProperties.LABEL);
if (labels.getClass().isArray()) {
label = " (" + ((String[])labels)[0] + ")";
} else {
label = " (" + vertex.getProperty(NodeProperties.LABEL) + ")";
}
}
// TODO: add curies
/*if (vertex.getPropertyKeys().contains(CommonProperties.FRAGMENT)) {
return (String) vertex.getProperty(CommonProperties.FRAGMENT) + label;
} else {*/
return (String) vertex.getProperty(CommonProperties.IRI) + label;
//}
}
};
代码示例来源:origin: SciGraph/SciGraph
@Test
public void nonFoundCuriesAreIgnored() {
Vertex v = graph.addVertex(null);
adder.addCuries(graph);
assertThat(v.getPropertyKeys(), not(contains(CommonProperties.CURIE)));
}
代码示例来源:origin: eu.agrosense.server/storage-tinkerpop
@Override
public DTO findDTOById(String id) {
Query query = getPartitionRO().query();
query.has(eu.agrosense.shared.model.AgroEntity.PROP_URI, id);
List<Slot> slots = new ArrayList<>();
for (Vertex v : query.vertices()) {
for (String key : v.getPropertyKeys()){
slots.add(new Slot(key, v.getProperty(key), Qualifier.qualify(id, key)));
}
return new DTO(slots);
}
return null;
}
代码示例来源:origin: iTransformers/netTransformer
private Vertex mergeVertex(Graph graph1, Vertex vertex2) {
Vertex vertex1 = graph1.getVertex(vertex2.getId());
if (vertex1 == null) {
vertex1 = graph1.addVertex(vertex2.getId());
Set<String> keys2 = vertex2.getPropertyKeys();
for (String key2 : keys2) {
vertex1.setProperty(key2,vertex2.getProperty(key2));
}
} else {
Set<String> keys1 = vertex1.getPropertyKeys();
Set<String> keys2 = vertex2.getPropertyKeys();
for (String key2 : keys2) {
if (keys1.contains(key2)) {
MergeConflictResolver conflictResolver = getVertexConflictResolver(key2);
Object merge = conflictResolver.resolveConflict(vertex1.getProperty(key2), vertex2.getProperty(key2));
vertex1.setProperty(key2,merge);
} else {
vertex1.setProperty(key2,vertex2.getProperty(key2));
}
}
}
return vertex1;
}
代码示例来源:origin: org.jboss.windup.rules/rules-impl
for (String key : v.getPropertyKeys())
代码示例来源:origin: org.jboss.windup.rules/rules-impl
@Override
public void visitArchive(ArchiveResource file)
{
// now, check to see whether it is a JAR, and republish the typed value.
String filePath = file.getFileResource().getFilePath();
if (StringUtils.endsWith(filePath, ".jar"))
{
jarDao.castToType(file);
}
else if (StringUtils.endsWith(filePath, ".war"))
{
warDao.castToType(file);
}
else if (StringUtils.endsWith(filePath, ".ear"))
{
earDao.castToType(file);
}
else
{
Vertex v = file.asVertex();
LOG.info("Not found for Vertex: " + v);
for (String key : v.getPropertyKeys())
{
LOG.info(" - " + key + " -> " + v.getProperty(key));
}
LOG.warn("Extension not routed for: " + filePath);
}
}
代码示例来源:origin: net.fortytwo.extendo/extendo-brain
Vertex vt = target.addVertex(vs.getId());
for (String key : vs.getPropertyKeys()) {
vt.setProperty(key, vs.getProperty(key));
代码示例来源:origin: SciGraph/SciGraph
@Test
public void propertiesProject() {
TinkerGraph graph = new TinkerGraph();
Vertex v = graph.addVertex(1);
v.setProperty(CommonProperties.IRI, "http://x.org/a");
v.setProperty("foo", "fizz");
v.setProperty("bar", "baz");
TinkerGraphUtil tgu = new TinkerGraphUtil(graph, curieUtil);
tgu.project(newHashSet("foo"));
assertThat(v.getPropertyKeys(), containsInAnyOrder("foo", CommonProperties.IRI));
}
代码示例来源:origin: SciGraph/SciGraph
@Test
public void allPropertiesProject() {
TinkerGraph graph = new TinkerGraph();
Vertex v = graph.addVertex(1);
v.setProperty(CommonProperties.IRI, "http://x.org/a");
v.setProperty("foo", "fizz");
v.setProperty("bar", "baz");
TinkerGraphUtil tgu = new TinkerGraphUtil(graph, curieUtil);
tgu.project(newHashSet("*"));
assertThat(v.getPropertyKeys(), containsInAnyOrder("foo", "bar", CommonProperties.IRI));
}
代码示例来源:origin: atlanmod/NeoEMF
@Override
public void copyTo(ModelGraph target) {
final List<String> classPropertyKeys = Arrays.asList(ClassVertex.PROPERTY_NAME, ClassVertex.PROPERTY_URI);
// Copy all vertices
for (Vertex fromVertex : getVertices()) {
Vertex toVertex;
final Set<String> propertyKeys = fromVertex.getPropertyKeys();
// If this vertex is a meta-class vertex: rebuild the meta-classes index
if (propertyKeys.containsAll(classPropertyKeys)) {
final ClassBean bean = ClassVertex.from(((IdVertex<?>) fromVertex).getBaseElement(), this).toBean();
toVertex = ClassVertex.create(target, bean);
propertyKeys.removeAll(classPropertyKeys);
}
else {
toVertex = target.addVertex(fromVertex.getId());
}
// Copy all remaining properties
copyProperties(fromVertex, toVertex, propertyKeys);
}
// Copy all edges
for (Edge fromEdge : getEdges()) {
Vertex outVertex = target.getVertex(fromEdge.getVertex(Direction.OUT).getId());
Vertex inVertex = target.getVertex(fromEdge.getVertex(Direction.IN).getId());
Edge toEdge = target.addEdge(fromEdge.getId(), outVertex, inVertex, fromEdge.getLabel());
// Copy all properties
copyProperties(fromEdge, toEdge, fromEdge.getPropertyKeys());
}
}
代码示例来源:origin: gentics/mesh
for (String key : fromV.getPropertyKeys()) {
toV.setProperty(key, fromV.getProperty(key));
内容来源于网络,如有侵权,请联系作者删除!