Package org.aksw.faraday_cage.engine
Class ValidatableParameterMap
- java.lang.Object
-
- org.aksw.faraday_cage.engine.ValidatableParameterMap
-
public class ValidatableParameterMap extends Object
AValidatableParameterMapserves as registry of parameters that can be used to configure aValidatableParameterMap.A
ParameterMapholds a list ofPropertyinstances upon its initialization, therefore acting as a registry of allowedPropertys.
Furthermore, aValidatableParameterMapsupports setting values of its parameters eitherdirectlyorautomatically.
Callinginit()} on a givenValidatableParameterMapwill change its state to initialized and prevent further modification of its values, effectively making it immutable. It is mandatory to callinit()before obtaining values from aValidatableParameterMap.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValidatableParameterMap.BuilderBuilder forValidatableParameterMap
-
Method Summary
Modifier and Type Method Description ValidatableParameterMapadd(Property p, RDFNode node)Add a Statement to thisValidatableParameterMapby specifying its predicate and object.ValidatableParameterMapadd(StmtIterator it)static ValidatableParameterMap.Builderbuilder()Obtain a builder instanceLiteralcreateLiteral(String s)ResourcecreateResource()ResourcecreateResource(String url)static ValidatableParameterMapemptyInstance()booleanequals(Object o)RDFNodeget(Property p)Get the first object for a given property as anOptional.Optional<RDFNode>getOptional(Property p)Get the first object for a given property as anOptional.ModelgetValidationModel()inthashCode()ValidatableParameterMapinit()Initializes thisValidatableParameterMap.Stream<RDFNode>listPropertyObjects(Property p)Get a stream of objects for the given property.Modelparametrize(Resource exNode)Apply the parameters stored in thisValidatableParameterMapto the givenResourcerepresenting aParameterized.ValidatableParameterMappopulate(Resource root)Populate the ValidatableParameterMap with data taken from theModelattached to the givenResource.
-
-
-
Method Detail
-
emptyInstance
public static ValidatableParameterMap emptyInstance()
-
builder
public static ValidatableParameterMap.Builder builder()
Obtain a builder instance- Returns:
- a fresh builder instance
-
populate
public ValidatableParameterMap populate(Resource root)
Populate the ValidatableParameterMap with data taken from theModelattached to the givenResource.- Parameters:
root- thisResourceneeds to be backed by aModel
-
add
public ValidatableParameterMap add(StmtIterator it)
-
add
public ValidatableParameterMap add(Property p, RDFNode node)
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
public ValidatableParameterMap init()
Initializes thisValidatableParameterMap. Initializing effectively disables all writing operations (attempting to write will result in exceptions) and enables all reading operations.
-
listPropertyObjects
public Stream<RDFNode> listPropertyObjects(Property p)
Get a stream of objects for the given property.
-
getOptional
public Optional<RDFNode> getOptional(Property p)
Get the first object for a given property as anOptional.
-
parametrize
public Model parametrize(Resource exNode)
Apply the parameters stored in thisValidatableParameterMapto the givenResourcerepresenting aParameterized.- Returns:
- the parameter graph for the given
Resource
-
getValidationModel
public Model getValidationModel()
-
createResource
public Resource createResource()
-
-