use of org.neo4j.graphdb.RelationshipType in project neo4j by neo4j.
the class PECListingIT method canListRelationshipPropertyExistenceConstraintsByTypeAndProperty.
@Test
public void canListRelationshipPropertyExistenceConstraintsByTypeAndProperty() throws Exception {
// GIVEN
RelationshipType relType = RelationshipType.withName("KNOWS");
SchemaHelper.createRelPropertyExistenceConstraint(db, relType, "since");
// WHEN / THEN
executeCommand("schema ls -r :KNOWS -p since", "ON \\(\\)-\\[knows:KNOWS\\]-\\(\\) ASSERT exists\\(knows.since\\)");
}
use of org.neo4j.graphdb.RelationshipType in project neo4j by neo4j.
the class PECListingIT method canListRelationshipPropertyExistenceConstraintsByType.
@Test
public void canListRelationshipPropertyExistenceConstraintsByType() throws Exception {
// GIVEN
RelationshipType relType = RelationshipType.withName("KNOWS");
SchemaHelper.createRelPropertyExistenceConstraint(db, relType, "since");
// WHEN / THEN
executeCommand("schema ls -r :KNOWS", "ON \\(\\)-\\[knows:KNOWS\\]-\\(\\) ASSERT exists\\(knows.since\\)");
}
use of org.neo4j.graphdb.RelationshipType in project neo4j by neo4j.
the class GraphDbStructureGuide method showRelCounts.
private void showRelCounts(ReadOperations read, DbStructureVisitor visitor) {
// all wildcards
noSide(read, visitor, WILDCARD_REL_TYPE, ANY_RELATIONSHIP_TYPE);
// one label only
for (Label label : db.getAllLabels()) {
int labelId = read.labelGetForName(label.name());
leftSide(read, visitor, label, labelId, WILDCARD_REL_TYPE, ANY_RELATIONSHIP_TYPE);
rightSide(read, visitor, label, labelId, WILDCARD_REL_TYPE, ANY_RELATIONSHIP_TYPE);
}
// fixed rel type
for (RelationshipType relType : db.getAllRelationshipTypes()) {
int relTypeId = read.relationshipTypeGetForName(relType.name());
noSide(read, visitor, relType, relTypeId);
for (Label label : db.getAllLabels()) {
int labelId = read.labelGetForName(label.name());
// wildcard on right
leftSide(read, visitor, label, labelId, relType, relTypeId);
// wildcard on left
rightSide(read, visitor, label, labelId, relType, relTypeId);
}
}
}
use of org.neo4j.graphdb.RelationshipType in project neo4j by neo4j.
the class GraphDbStructureGuide method showRelTypes.
private void showRelTypes(ReadOperations read, DbStructureVisitor visitor) {
for (RelationshipType relType : db.getAllRelationshipTypes()) {
int relTypeId = read.relationshipTypeGetForName(relType.name());
visitor.visitRelationshipType(relTypeId, relType.name());
}
}
use of org.neo4j.graphdb.RelationshipType in project neo4j by neo4j.
the class BatchInserterImpl method getRelationshipById.
@Override
public BatchRelationship getRelationshipById(long relId) {
RelationshipRecord record = getRelationshipRecord(relId).forReadingData();
RelationshipType type = (RelationshipType) relationshipTypeTokens.byId(record.getType());
return new BatchRelationship(record.getId(), record.getFirstNode(), record.getSecondNode(), type);
}
Aggregations