本文整理汇总了Java中org.neo4j.graphdb.Label.name方法的典型用法代码示例。如果您正苦于以下问题:Java Label.name方法的具体用法?Java Label.name怎么用?Java Label.name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.graphdb.Label
的用法示例。
在下文中一共展示了Label.name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findNodeIntoGraphDb
import org.neo4j.graphdb.Label; //导入方法依赖的package包/类
/**
* Search into database if exists a node with documentId
* @param label
* @param documentId
* @return
*/
private Node findNodeIntoGraphDb(Label label, DocumentId documentId) {
Node node = null;
//check if node already exists
String query = "MATCH (n:"+label.name()+" {"+documentId.toCypherFilter()+"}) RETURN n";
if(log.isDebugEnabled())
{
log.debug(query);
}
Result result = db.execute(query);
while (result.hasNext()) {
Map<String, Object> row = result.next();
node = (Node) row.get("n");
if(log.isDebugEnabled())
{
log.debug("Found: "+node);
}
}
return node;
}
示例2: getNodeType
import org.neo4j.graphdb.Label; //导入方法依赖的package包/类
private String getNodeType(Node node) {
String type = "Wikipedia";
Iterable<Label> labels = node.getLabels();
for (Label label : labels) {
if (!WikipediaLabel.Wikipedia.equals(label)) {
type = label.name();
}
}
return type;
}
示例3: NeoConstraint
import org.neo4j.graphdb.Label; //导入方法依赖的package包/类
public NeoConstraint(boolean constraint, boolean index, Iterable<String>propKeys, Label label, ConstraintType type) {
this.constraint = constraint;
this.index = index;
this.type = type;
this.propertyKeys = IteratorUtil.asList(propKeys);
this.label = (label == null ? "N/A" : label.name());
}
示例4: EmbeddedLabel
import org.neo4j.graphdb.Label; //导入方法依赖的package包/类
public EmbeddedLabel(Label delegate) {
this.delegate = delegate;
this.name = delegate.name();
}
示例5: determineTypeLabel
import org.neo4j.graphdb.Label; //导入方法依赖的package包/类
public static final Optional<String> determineTypeLabel(final Node node) throws DMPGraphException {
final Iterable<Label> labels = node.getLabels();
if (labels == null) {
throw new DMPGraphException(String.format("there are no labels at node %s", GraphDBPrintUtil.printNode(node)));
}
boolean nodeIsResource = false;
for (final Label label : labels) {
final String labelName = label.name();
if (labelName.equals(GraphProcessingStatics.LEAF_IDENTIFIER)) {
continue;
}
try {
final NodeType nodeType = NodeType.getByName(labelName);
if (NodeType.Resource.equals(nodeType)) {
nodeIsResource = true;
}
} catch (final IllegalArgumentException e) {
return Optional.of(labelName);
}
}
if (nodeIsResource) {
// object resources don't need a type label
return Optional.empty();
}
throw new DMPGraphException(String.format("couldn't determine type label for node %s", GraphDBPrintUtil.printNode(node)));
}