@CheckReturnValue public Label getLabel(String attributeType) { return Label.of(String.format(label, attributeType)); }
/** * Create a matcher to test that the concept has the given type name. */ public static Matcher<MatchableConcept> role(String type) { return role(Label.of(type)); }
/** * Create a matcher to test that the concept has the given type name. */ public static Matcher<MatchableConcept> type(String type) { return type(Label.of(type)); }
@Nullable @Override public EntityType getEntityType(String label) { return getSchemaConcept(Label.of(label)); }
@Nullable @Override public Role getRole(String label) { return getSchemaConcept(Label.of(label)); }
/** * Create a matcher to test that the concept has the given type name. */ public static Matcher<MatchableConcept> rule(String type) { return rule(Label.of(type)); }
@Override public final VarPattern label(String label) { return label(Label.of(label)); }
@Override public Role getRole(String label) { return getSchemaConcept(Label.of(label), Schema.BaseType.ROLE); }
@Nullable @Override public Rule getRule(String label) { return getSchemaConcept(Label.of(label)); }
MetaSchema(String s, int i) { label = Label.of(s); id = LabelId.of(i); }
/** * Create a {@link RelationshipType} with super-type {@code relation}, or return a pre-existing {@link RelationshipType}, * with the specified label. * * @param label A unique label for the {@link RelationshipType} * @return A new or existing {@link RelationshipType} with the provided label. * * @throws GraknTxOperationException if the graph is closed * @throws PropertyNotUniqueException if the {@param label} is already in use by an existing non-{@link RelationshipType}. */ default RelationshipType putRelationshipType(String label) { return putRelationshipType(Label.of(label)); }
@Override public final VarPattern has(String type, VarPattern attribute) { return has(Label.of(type), attribute); }
@Override public EntityType getEntityType(String label) { return getSchemaConcept(Label.of(label), Schema.BaseType.ENTITY_TYPE); }
@Override public <V> AttributeType<V> getAttributeType(String label) { return getSchemaConcept(Label.of(label), Schema.BaseType.ATTRIBUTE_TYPE); }
@Override public Rule getRule(String label) { return getSchemaConcept(Label.of(label), Schema.BaseType.RULE); }
/** * Rename a {@link Label} (does not modify the original {@link Label}) * @param mapper a function to apply to the underlying type label * @return the new type label */ @CheckReturnValue public Label map(Function<String, String> mapper) { return Label.of(mapper.apply(getValue())); }
@Nullable @Override public <V> AttributeType<V> getAttributeType(String label) { SchemaConcept concept = getSchemaConcept(Label.of(label)); if (concept == null || !concept.isAttributeType()) return null; return concept.asAttributeType(); }
@Nullable @Override public EntityType getEntityType(String label) { SchemaConcept concept = getSchemaConcept(Label.of(label)); if (concept == null || !concept.isEntityType()) return null; return concept.asEntityType(); }
@Nullable @Override public Rule getRule(String label) { SchemaConcept concept = getSchemaConcept(Label.of(label)); if (concept == null || !concept.isRule()) return null; return concept.asRule(); }