Class ValidatableParameterMap

java.lang.Object
org.aksw.faraday_cage.engine.ValidatableParameterMap

public class ValidatableParameterMap extends Object
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.

  • Method Details

    • 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 the Model attached to the given Resource.
      Parameters:
      root - this Resource needs to be backed by a Model
    • add

      Add all remaining Statements from a given StmtIterator to this ValidatableParameterMap
    • add

      public ValidatableParameterMap add(Property p, RDFNode node)
      Add a Statement to this ValidatableParameterMap by specifying its predicate and object. If the object is not a literal, its subgraph is also added to the Model backing this ValidatableParameterMap by depth-first search. Infinite loops from cyclical subgraphs are prevented by maintaining a set of visited resources.
    • init

      public ValidatableParameterMap init()
      Initializes this ValidatableParameterMap. 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 an Optional.
    • get

      public RDFNode get(Property p)
      Get the first object for a given property as an Optional.
    • parametrize

      public Model parametrize(Resource exNode)
      Apply the parameters stored in this ValidatableParameterMap to the given Resource representing a Parameterized.
      Returns:
      the parameter graph for the given Resource
    • getValidationModel

      public Model getValidationModel()
    • createResource

      public Resource createResource()
    • createResource

      public Resource createResource(String url)
    • createLiteral

      public Literal createLiteral(String s)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object