Package com.complexible.stardog.icv

# Class ConstraintFactory

java.lang.Object
com.complexible.stardog.icv.ConstraintFactory

public final class ConstraintFactory extends Object

Factory to simplify creating constraint objects.

Since:
  0.7
Version:
  6.0
Author:
  Michael Grove

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Constraint`
  `constraint(Iterable<Statement> theStatements)`
  Create an `integrity constraint` from a collection of statements.
  `static Set<Constraint>`
  `constraints(Iterable<Statement> theGraph)`
  Create a set of `integrity constraints` from a collection of statements.
  `static Set<Constraint>`
  `constraints(Iterator<Statement> theGraph)`
  Create a set of `integrity constraints` from a collection of statements.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### constraint

    public static Constraint constraint(Iterable<Statement> theStatements)
    Create an `integrity constraint` from a collection of statements. The statements must be equal to a single OWL axiom.
    Parameters:
      `theStatements` - the axiom as statements
    Returns:
      the new IC
    Throws:
      `IllegalArgumentException` - if the graph of the statements does not contain a single owl axiom, or contains more than one.

  - ### constraints

    public static Set<Constraint> constraints(Iterable<Statement> theGraph)
    Create a set of `integrity constraints` from a collection of statements.

  - ### constraints

    public static Set<Constraint> constraints(Iterator<Statement> theGraph)
    Create a set of `integrity constraints` from a collection of statements.