本文整理汇总了Java中org.neo4j.graphdb.Node.setProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Node.setProperty方法的具体用法?Java Node.setProperty怎么用?Java Node.setProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.graphdb.Node
的用法示例。
在下文中一共展示了Node.setProperty方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public void insertBd() {
Result res;
try (Transaction tx = db.beginTx()) {
Node depart = db.createNode(Main.Tables.Depart);
depart.setProperty("numero",numero);
depart.setProperty("date",date);
res = db.execute("MATCH (a:Avion), (d:Depart) WHERE a.numero="+avion+" AND d.numero="+numero+" CREATE (a)-[:Affecter]->(d)");
res = db.execute("MATCH (v:Vol), (d:Depart) WHERE v.numero="+vol+" AND d.numero="+numero+" CREATE (v)-[:Constituer]->(d)");
for (int i=0; i<passagers.size(); i++) {
res = db.execute("MATCH (p:Passagers), (d:Depart) WHERE p.cin='"+passagers.get(i)+"' AND d.numero="+numero+" CREATE (p)-[:Enregistrer]->(d)");
}
for (int i=0; i<personnels.size(); i++) {
res = db.execute("MATCH (p:Passagers), (d:Depart) WHERE p.cin='"+personnels.get(i)+"' AND d.numero="+numero+" CREATE (p)-[:Enregistrer]->(d)");
}
tx.success();
}
//res = db.execute("MATCH (d:Depart{date:'"+date+"'}), (p:Passager{cin:'"+passagers.get(0)+"'}) CREATE (p)-[r:Enregistrer]->(d)");
}
示例2: show
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
@Override
List<Node> show() {
if ( state != State.ready ) throw new IllegalStateException("Model not trained yet");
List<Node> result = new ArrayList<>();
int layerCount = model.getnLayers();
for (Layer layer : model.getLayers()) {
Node node = node("Layer",
"type", layer.type().name(), "index", layer.getIndex(),
"pretrainLayer", layer.isPretrainLayer(), "miniBatchSize", layer.getInputMiniBatchSize(),
"numParams", layer.numParams());
if (layer instanceof DenseLayer) {
DenseLayer dl = (DenseLayer) layer;
node.addLabel(Label.label("DenseLayer"));
node.setProperty("activation",dl.getActivationFn().toString()); // todo parameters
node.setProperty("biasInit",dl.getBiasInit());
node.setProperty("biasLearningRate",dl.getBiasLearningRate());
node.setProperty("l1",dl.getL1());
node.setProperty("l1Bias",dl.getL1Bias());
node.setProperty("l2",dl.getL2());
node.setProperty("l2Bias",dl.getL2Bias());
node.setProperty("distribution",dl.getDist().toString());
node.setProperty("in",dl.getNIn());
node.setProperty("out",dl.getNOut());
}
result.add(node);
// layer.preOutput(allOne, Layer.TrainingMode.TEST);
// layer.p(allOne, Layer.TrainingMode.TEST);
// layer.activate(allOne, Layer.TrainingMode.TEST);
}
return result;
}
示例3: addNode
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public static Node addNode(Map<String,Object> properties)
{
Node newNode = graphDb.createNode();
Set<Entry<String, Object>> entrySet = properties.entrySet();
Iterator<Entry<String, Object>> it = entrySet.iterator();
while(it.hasNext()){
Entry<String, Object> next = it.next();
newNode.setProperty(next.getKey(), next.getValue());
}
return newNode;
}
示例4: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public void insertBd() {
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Main.Tables.Personne);
vols.setProperty("cin", getCin());
vols.setProperty("numPassport", getNumPassport());
vols.setProperty("nom", getNom());
vols.setProperty("adresse", getAdresse());
vols.setProperty("telephone", getTelephone());
tx.success();
}
}
示例5: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public void insertBd() {
super.insertBd();
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Main.Tables.Passager);
vols.setProperty("cin",super.getCin());
vols.setProperty("numPassport",super.getNumPassport());
vols.setProperty("nom",super.getNom());
vols.setProperty("adresse",super.getAdresse());
vols.setProperty("telephone",super.getTelephone());
tx.success();
}
}
示例6: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public void insertBd() {
super.insertBd();
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Main.Tables.NonNaviguant);
vols.setProperty("cin",super.getCin());
vols.setProperty("numPassport",super.getNumPassport());
vols.setProperty("nom",super.getNom());
vols.setProperty("adresse",super.getAdresse());
vols.setProperty("telephone",super.getTelephone());
tx.success();
}
}
示例7: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public void insertBd() {
super.insertBd();
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Main.Tables.Naviguant);
vols.setProperty("cin",super.getCin());
vols.setProperty("numPassport",super.getNumPassport());
vols.setProperty("nom",super.getNom());
vols.setProperty("adresse",super.getAdresse());
vols.setProperty("telephone",super.getTelephone());
tx.success();
}
}
示例8: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public int insertBd() {
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Tables.Vol);
vols.setProperty("numero",numero);
vols.setProperty("villeDep",villeDep);
vols.setProperty("villeArr",villeArr);
vols.setProperty("heureDep",heureDep);
vols.setProperty("heureArr",heureArr);
vols.setProperty("distance",distance);
vols.setProperty("frequence",frequence);
tx.success();
}
return 0;
}
示例9: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public void insertBd() {
super.insertBd();
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Main.Tables.Pilote);
vols.setProperty("cin",super.getCin());
vols.setProperty("numPassport",super.getNumPassport());
vols.setProperty("nom",super.getNom());
vols.setProperty("adresse",super.getAdresse());
vols.setProperty("telephone",super.getTelephone());
tx.success();
}
}
示例10: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public void insertBd() {
super.insertBd();
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Main.Tables.Personnel);
vols.setProperty("cin",super.getCin());
vols.setProperty("type",type);
vols.setProperty("numPassport",super.getNumPassport());
vols.setProperty("nom",super.getNom());
vols.setProperty("adresse",super.getAdresse());
vols.setProperty("telephone",super.getTelephone());
tx.success();
}
}
示例11: insertBd
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
public int insertBd() {
try (Transaction tx = db.beginTx()) {
Node vols = db.createNode(Tables.Avion);
vols.setProperty("numero",numero);
vols.setProperty("type",type);
vols.setProperty("capacite",capacite);
tx.success();
}
return 0;
}
示例12: create
import org.neo4j.graphdb.Node; //导入方法依赖的package包/类
@Procedure(name = "com.maxdemarzi.rules.create", mode = Mode.WRITE)
@Description("CALL com.maxdemarzi.rules.create(id, formula) - create a rule")
public Stream<StringResult> create(@Name("id") String id, @Name("formula") String formula) throws IOException {
// See if the rule already exists
Node rule = db.findNode(Labels.Rule, "id", id);
if (rule == null) {
// Create the rule
rule = db.createNode(Labels.Rule);
rule.setProperty("id", id);
rule.setProperty("formula", formula);
// Use the expression to find the required paths
BooleanExpression boEx = new BooleanExpression(formula);
boEx.doTabulationMethod();
boEx.doQuineMcCluskey();
boEx.doPetricksMethod();
// Create a relationship from the lead attribute node to the path nodes
for (String path : boEx.getPathExpressions()) {
Node pathNode = db.findNode(Labels.Path, "id", path);
if (pathNode == null) {
// Create the path node if it doesn't already exist
pathNode = db.createNode(Labels.Path);
pathNode.setProperty("id", path);
// Create the attribute nodes if they don't already exist
String[] attributes = path.split("[!&]");
for (int i = 0; i < attributes.length; i++) {
String attributeId = attributes[i];
Node attribute = db.findNode(Labels.Attribute, "id", attributeId);
if (attribute == null) {
attribute = db.createNode(Labels.Attribute);
attribute.setProperty("id", attributeId);
}
// Create the relationship between the lead attribute node to the path node
if (i == 0) {
Relationship inPath = attribute.createRelationshipTo(pathNode, RelationshipTypes.IN_PATH);
inPath.setProperty("path", path);
}
}
}
// Create a relationship between the path and the rule
pathNode.createRelationshipTo(rule, RelationshipTypes.HAS_RULE);
}
}
return Stream.of(new StringResult("Rule " + formula + " created."));
}