public class ConceptBuilder extends Object
Concept, by providing properties.
A VarProperty is responsible for inserting itself into the graph. However,
some properties can only operate in combination. For example, to create a Attribute you need both
an IsaProperty and a ValueProperty.
Therefore, these properties do not create the Concept themselves.
instead they provide the necessary information to the ConceptBuilder, which will create the
Concept at a later time:
// Executor:
ConceptBuilder builder = ConceptBuilder.of(executor, var);
// IsaProperty:
builder.isa(name);
// ValueProperty:
builder.value("Bob");
// Executor:
Concept concept = builder.build();
| Modifier and Type | Method and Description |
|---|---|
ConceptBuilder |
dataType(AttributeType.DataType<?> dataType) |
ConceptBuilder |
id(ConceptId id) |
ConceptBuilder |
isa(Type type) |
ConceptBuilder |
label(Label label) |
static void |
setSuper(SchemaConcept subConcept,
SchemaConcept superConcept)
Make the second argument the super of the first argument
|
ConceptBuilder |
sub(SchemaConcept superConcept) |
ConceptBuilder |
then(Pattern then) |
ConceptBuilder |
value(Object value) |
ConceptBuilder |
when(Pattern when) |
public ConceptBuilder isa(Type type)
public ConceptBuilder sub(SchemaConcept superConcept)
public ConceptBuilder label(Label label)
public ConceptBuilder id(ConceptId id)
public ConceptBuilder value(Object value)
public ConceptBuilder dataType(AttributeType.DataType<?> dataType)
public ConceptBuilder when(Pattern when)
public ConceptBuilder then(Pattern then)
public static void setSuper(SchemaConcept subConcept, SchemaConcept superConcept)
GraqlQueryException - if the types are different, or setting the super to be a meta-typeCopyright © 2017 Grakn Labs Ltd. All rights reserved.