Package org.aksw.faraday_cage.engine
Class ValidatableParameterMap
java.lang.Object
org.aksw.faraday_cage.engine.ValidatableParameterMap
A
ValidatableParameterMap serves as registry of parameters that can be used
to configure a ValidatableParameterMap.
A ParameterMap holds a list of Property instances upon its
initialization, therefore acting as a registry of allowed Propertys.
Furthermore, a ValidatableParameterMap supports setting values of its parameters
either directly or automatically.
Calling init()} on a given ValidatableParameterMap will change its state to
initialized and prevent further modification of its values, effectively making it immutable.
It is mandatory to call init() before obtaining values from a ValidatableParameterMap.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forValidatableParameterMap -
Method Summary
Modifier and TypeMethodDescriptionAdd a Statement to thisValidatableParameterMapby specifying its predicate and object.add(StmtIterator it)builder()Obtain a builder instancecreateLiteral(String s)createResource(String url)static ValidatableParameterMapbooleanGet the first object for a given property as anOptional.getOptional(Property p)Get the first object for a given property as anOptional.inthashCode()init()Initializes thisValidatableParameterMap.Get a stream of objects for the given property.parametrize(Resource exNode)Apply the parameters stored in thisValidatableParameterMapto the givenResourcerepresenting aParameterized.Populate the ValidatableParameterMap with data taken from theModelattached to the givenResource.
-
Method Details
-
emptyInstance
-
builder
Obtain a builder instance- Returns:
- a fresh builder instance
-
populate
Populate the ValidatableParameterMap with data taken from theModelattached to the givenResource.- Parameters:
root- thisResourceneeds to be backed by aModel
-
add
-
add
Add a Statement to thisValidatableParameterMapby specifying its predicate and object. If the object is not a literal, its subgraph is also added to theModelbacking thisValidatableParameterMapby depth-first search. Infinite loops from cyclical subgraphs are prevented by maintaining a set of visited resources. -
init
Initializes thisValidatableParameterMap. Initializing effectively disables all writing operations (attempting to write will result in exceptions) and enables all reading operations. -
listPropertyObjects
Get a stream of objects for the given property. -
getOptional
Get the first object for a given property as anOptional. -
get
Get the first object for a given property as anOptional. -
parametrize
Apply the parameters stored in thisValidatableParameterMapto the givenResourcerepresenting aParameterized.- Returns:
- the parameter graph for the given
Resource
-
getValidationModel
-
createResource
-
createResource
-
createLiteral
-
hashCode
public int hashCode() -
equals
-