org.daml.validator
Class ValidatorAPI

java.lang.Object
  |
  +--org.daml.validator.ValidatorAPI

public class ValidatorAPI
extends java.lang.Object

Implements an API to the DAML validator. After adding RDF Models to validate against, any RDF model can be validated. Any number of models can be validated against the backing set of models.


Constructor Summary
ValidatorAPI()
          Generate a Validator API instance using the default preferences file.
ValidatorAPI(java.lang.String preferenceFile)
          Generate a Validator API instance using a specified preferences file.
 
Method Summary
 void addModel(com.hp.hpl.mesa.rdf.jena.model.Model model)
          Add a RDF Model to the set of models used to validate against.
 void addURL(java.lang.String url, boolean recurse)
          Load a URL to create a RDF Model and add that to the set of models to validate against.
 void addURL(java.net.URL url, boolean recurse)
          Load a URL to create a RDF Model and add that to the set of models to validate against.
 void initialize()
          Initialize the validator.
static void main(java.lang.String[] args)
          Shows and example of how to use the ValidatorAPI.
 void setMaxIndications(int maxIndications)
          Set the upper limit on the number of indications reported.
 java.util.Vector validateModel(com.hp.hpl.mesa.rdf.jena.model.Model model, java.lang.String ident)
          Validate an RDF model against the models previously added.
 java.util.Vector validateURL(java.lang.String url)
          Validate a daml file located at a URL against the previously stored models.
 java.util.Vector validateURL(java.net.URL url)
          Validate a daml file located at a URL against the previously stored models.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorAPI

public ValidatorAPI()
             throws java.lang.Exception
Generate a Validator API instance using the default preferences file.


ValidatorAPI

public ValidatorAPI(java.lang.String preferenceFile)
             throws java.lang.Exception
Generate a Validator API instance using a specified preferences file.

Parameters:
preferenceFile - Pathname or URL of the preference file to use.
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Shows and example of how to use the ValidatorAPI.

java.lang.Exception

initialize

public void initialize()
Initialize the validator. This clears out all model and indication information from the validator instance.


setMaxIndications

public void setMaxIndications(int maxIndications)
Set the upper limit on the number of indications reported. Processing stops when the limit is reached.

Parameters:
maxIndications - The maximum number of indications to find.

addModel

public void addModel(com.hp.hpl.mesa.rdf.jena.model.Model model)
Add a RDF Model to the set of models used to validate against.

Parameters:
model - RDF Model to add to the backing model.

addURL

public void addURL(java.net.URL url,
                   boolean recurse)
            throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Load a URL to create a RDF Model and add that to the set of models to validate against. When recurse is true then any referenced namespaces are also loaded.

Parameters:
url - URL to load and add to the backing model.
recurse - If true, referenced namespaces are also loaded.
com.hp.hpl.mesa.rdf.jena.model.RDFException

addURL

public void addURL(java.lang.String url,
                   boolean recurse)
            throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Load a URL to create a RDF Model and add that to the set of models to validate against. When recurse is true then any referenced namespaces are also loaded. Any XML Schema files are added to the datatype validator.

Parameters:
url - URL to load and add to the backing model.
recurse - When true, referenced namespaces are also loaded.
com.hp.hpl.mesa.rdf.jena.model.RDFException

validateModel

public java.util.Vector validateModel(com.hp.hpl.mesa.rdf.jena.model.Model model,
                                      java.lang.String ident)
                               throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Validate an RDF model against the models previously added.

Parameters:
model - Model to validate.
ident - URL of the model (or some string identifier) for indication messages
Returns:
A Vector of Indication objects.
com.hp.hpl.mesa.rdf.jena.model.RDFException

validateURL

public java.util.Vector validateURL(java.lang.String url)
                             throws com.hp.hpl.mesa.rdf.jena.model.RDFException,
                                    java.io.IOException
Validate a daml file located at a URL against the previously stored models.

Parameters:
url - URL to load.
Returns:
A Vector of Indication objects.
com.hp.hpl.mesa.rdf.jena.model.RDFException
java.io.IOException

validateURL

public java.util.Vector validateURL(java.net.URL url)
                             throws com.hp.hpl.mesa.rdf.jena.model.RDFException,
                                    java.io.IOException
Validate a daml file located at a URL against the previously stored models.

Parameters:
url - URL to load.
Returns:
A Vector of Indication objects.
com.hp.hpl.mesa.rdf.jena.model.RDFException
java.io.IOException