use of org.neo4j.graphdb.Label in project neo4j by neo4j.
the class PECListingIT method canListNodePropertyExistenceConstraints.
@Test
public void canListNodePropertyExistenceConstraints() throws Exception {
// GIVEN
Label label = label("Person");
SchemaHelper.createNodePropertyExistenceConstraint(db, label, "name");
// WHEN / THEN
executeCommand("schema ls", "ON \\(person:Person\\) ASSERT exists\\(person.name\\)");
}
use of org.neo4j.graphdb.Label in project neo4j by neo4j.
the class PECListingIT method canListBothNodeAndRelationshipPropertyExistenceConstraintsByLabelAndType.
@Test
public void canListBothNodeAndRelationshipPropertyExistenceConstraintsByLabelAndType() throws Exception {
// GIVEN
Label label = label("Person");
RelationshipType relType = RelationshipType.withName("KNOWS");
// WHEN
SchemaHelper.createNodePropertyExistenceConstraint(db, label, "name");
SchemaHelper.createRelPropertyExistenceConstraint(db, relType, "since");
// THEN
executeCommand("schema ls -l :Person -r :KNOWS", "ON \\(person:Person\\) ASSERT exists\\(person.name\\)", "ON \\(\\)-\\[knows:KNOWS\\]-\\(\\) ASSERT exists\\(knows.since\\)");
}
use of org.neo4j.graphdb.Label in project neo4j by neo4j.
the class PECListingIT method canListNodePropertyExistenceConstraintsByLabelAndProperty.
@Test
public void canListNodePropertyExistenceConstraintsByLabelAndProperty() throws Exception {
// GIVEN
Label label = label("Person");
SchemaHelper.createNodePropertyExistenceConstraint(db, label, "name");
// WHEN / THEN
executeCommand("schema ls -l :Person -p name", "ON \\(person:Person\\) ASSERT exists\\(person.name\\)");
}
use of org.neo4j.graphdb.Label in project neo4j by neo4j.
the class PECListingIT method canListBothNodeAndRelationshipPropertyExistenceConstraints.
@Test
public void canListBothNodeAndRelationshipPropertyExistenceConstraints() throws Exception {
// GIVEN
Label label = label("Person");
RelationshipType relType = RelationshipType.withName("KNOWS");
// WHEN
SchemaHelper.createNodePropertyExistenceConstraint(db, label, "name");
SchemaHelper.createRelPropertyExistenceConstraint(db, relType, "since");
// THEN
executeCommand("schema ls", "ON \\(person:Person\\) ASSERT exists\\(person.name\\)", "ON \\(\\)-\\[knows:KNOWS\\]-\\(\\) ASSERT exists\\(knows.since\\)");
}
use of org.neo4j.graphdb.Label in project neo4j by neo4j.
the class PECListingIT method canListNodePropertyExistenceConstraintsByLabel.
@Test
public void canListNodePropertyExistenceConstraintsByLabel() throws Exception {
// GIVEN
Label label = label("Person");
SchemaHelper.createNodePropertyExistenceConstraint(db, label, "name");
// WHEN / THEN
executeCommand("schema ls -l :Person", "ON \\(person:Person\\) ASSERT exists\\(person.name\\)");
}
Aggregations