Package com.franz.agraph.repository
Class AGRepositoryConnection.AttributeDefinition
java.lang.Object
com.franz.agraph.repository.AGRepositoryConnection.AttributeDefinition
- Enclosing class:
- AGRepositoryConnection
Builder class for defining a new attribute definition. After instantiation,
use the setter methods to build up the attribute definition. The
add
method will submit the definition to AG.
The object can be discarded once add
is called.
-
Constructor Summary
ConstructorDescriptionAttributeDefinition
(String name) To define an attribute, useAGRepositoryConnection.defineAttribute(String)
instead of calling the constructor directly. -
Method Summary
Modifier and TypeMethodDescriptionadd()
Pass the current attribute definition to AllegroGraph for defining.allowedValue
(String value) Add an allowed value to the current list of allowed values for this attribute definitionallowedValues
(List<String> values) Overwrite current setting of allowedValues with the argument List.maximum
(long value) The maximum number of times this attribute can be provided with a triple.minimum
(long value) The minimum number of times this attribute must be provided for a triple.ordered
(boolean value) Specifies whether the values allowed by this attribute definition are ordered.
-
Constructor Details
-
AttributeDefinition
To define an attribute, useAGRepositoryConnection.defineAttribute(String)
instead of calling the constructor directly.- Parameters:
name
- of the attribute
-
-
Method Details
-
allowedValues
Overwrite current setting of allowedValues with the argument List.- Parameters:
values
- , aList<String>
of allowed values- Returns:
- this
-
allowedValue
Add an allowed value to the current list of allowed values for this attribute definition- Parameters:
value
- an allowed value for this attribute- Returns:
- this
-
ordered
Specifies whether the values allowed by this attribute definition are ordered.- Parameters:
value
- boolean, if this attribute is ordered- Returns:
- this
-
minimum
The minimum number of times this attribute must be provided for a triple.- Parameters:
value
- , the minimum number of times this attribute can be specified- Returns:
- this
- Throws:
Exception
- ifvalue
is invalid
-
maximum
The maximum number of times this attribute can be provided with a triple.- Parameters:
value
- the maximum number of times this attribute can be specified- Returns:
- this
- Throws:
Exception
- ifvalue
is invalid
-
add
Pass the current attribute definition to AllegroGraph for defining.- Returns:
- this
- Throws:
AGHttpException
- if there is an error with the request
-