org.topbraid.spin.constraints
Class SPINConstraints

java.lang.Object
  extended by org.topbraid.spin.constraints.SPINConstraints

public class SPINConstraints
extends java.lang.Object

Performs SPIN constraint checking on one or more instances, based on the spin:constraints defined on the types of those instances.

Author:
Holger Knublauch

Constructor Summary
SPINConstraints()
           
 
Method Summary
static void addConstraintViolationsRDF(java.util.List<ConstraintViolation> cvs, Model result, boolean createSource)
          Creates an RDF representation (instances of spin:ConstraintViolation) from a collection of ConstraintViolation Java objects.
static java.util.List<ConstraintViolation> check(Model model, java.util.List<SPINStatistics> stats, ProgressMonitor monitor)
          Checks all instances in a given Model against all spin:constraints and returns a List of constraint violations.
static java.util.List<ConstraintViolation> check(Model model, ProgressMonitor monitor)
          Checks all instances in a given Model against all spin:constraints and returns a List of constraint violations.
static java.util.List<ConstraintViolation> check(Resource resource, java.util.List<SPINStatistics> stats, ProgressMonitor monitor)
          Checks all spin:constraints for a given Resource.
static java.util.List<ConstraintViolation> check(Resource resource, ProgressMonitor monitor)
          Checks all spin:constraints for a given Resource.
static boolean isConstraintProperty(Property property)
          Checks if a given property is a SPIN constraint property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPINConstraints

public SPINConstraints()
Method Detail

addConstraintViolationsRDF

public static void addConstraintViolationsRDF(java.util.List<ConstraintViolation> cvs,
                                              Model result,
                                              boolean createSource)
Creates an RDF representation (instances of spin:ConstraintViolation) from a collection of ConstraintViolation Java objects.

Parameters:
cvs - the violation objects
result - the Model to add the results to
createSource - true to also create the spin:violationSource

check

public static java.util.List<ConstraintViolation> check(Resource resource,
                                                        ProgressMonitor monitor)
Checks all spin:constraints for a given Resource.

Parameters:
resource - the instance to run constraint checks on
monitor - an (optional) progress monitor (currently ignored)
Returns:
a List of ConstraintViolations (empty if all is OK)

check

public static java.util.List<ConstraintViolation> check(Resource resource,
                                                        java.util.List<SPINStatistics> stats,
                                                        ProgressMonitor monitor)
Checks all spin:constraints for a given Resource.

Parameters:
resource - the instance to run constraint checks on
stats - an (optional) List to add statistics to
monitor - an (optional) progress monitor (currently ignored)
Returns:
a List of ConstraintViolations (empty if all is OK)

check

public static java.util.List<ConstraintViolation> check(Model model,
                                                        ProgressMonitor monitor)
Checks all instances in a given Model against all spin:constraints and returns a List of constraint violations. A ProgressMonitor can be provided to enable the user to get intermediate status reports and to cancel the operation.

Parameters:
model - the Model to operate on
monitor - an optional ProgressMonitor
Returns:
a List of ConstraintViolations

check

public static java.util.List<ConstraintViolation> check(Model model,
                                                        java.util.List<SPINStatistics> stats,
                                                        ProgressMonitor monitor)
Checks all instances in a given Model against all spin:constraints and returns a List of constraint violations. A ProgressMonitor can be provided to enable the user to get intermediate status reports and to cancel the operation.

Parameters:
model - the Model to operate on
stats - an (optional) List to write statistics reports to
monitor - an optional ProgressMonitor
Returns:
a List of ConstraintViolations

isConstraintProperty

public static boolean isConstraintProperty(Property property)
Checks if a given property is a SPIN constraint property. This is defined as a property that is spin:constraint or a sub-property of it.

Parameters:
property - the property to check
Returns:
true if property is a constraint property