com.hp.gloze.Gloze Class Reference

List of all members.

Public Member Functions

 Gloze ()
 Gloze (boolean silent)
 Gloze (URL schemaLocation, URI targetNS) throws Exception
 Gloze (URL[] schemaLocation, URI[] targetNS) throws Exception
void xml_to_rdf (File source, File target, URI base, Model model) throws Exception
Document rdf_to_xml (File source, File target, URI base, Model model) throws Exception
OntModel xsd_to_owl (File source, String base) throws Exception
Model lift (Document xml, URL url, URI base) throws Exception
boolean lift (Document xml, URL url, URI base, Model model) throws Exception
Document drop (Model model, URI uri) throws Exception
Document drop (Resource resource) throws Exception

Static Public Member Functions

static schema loadSchema (URL url) throws Exception
static void clearCache ()
static schema getCachedSchema (String namespace)
static schema initSchema (URI namespace, URL url, Map< URL, schema > schemaMap) throws Exception
static schema initSchemaXSI (Element element, URL location, String defaultNS, Map< URL, schema > schemaMap) throws Exception
static schema initSchemaLocation (URI namespace, URL schemaLocation, String defaultNS, Map< URL, schema > schemaMap) throws Exception, URISyntaxException
static void main (String args[])

Detailed Description

The programmatic interface for Gloze.


Constructor & Destructor Documentation

com.hp.gloze.Gloze.Gloze (  ) 

Create an instacen of Gloze.

com.hp.gloze.Gloze.Gloze ( boolean  silent  ) 

Construct an instance of Gloze. If no target is provided then the output is normally written to the console. This constructor provides the option to silence this output, and is useful for test purposes.

Parameters:
silent : boolean disables output where no target is supplied

com.hp.gloze.Gloze.Gloze ( URL  schemaLocation,
URI  targetNS 
) throws Exception

Construct an instance of Gloze for a schema with the given target namespace.

Parameters:
schemaLocation : URL
targetNS : URI
Exceptions:
Exception 

com.hp.gloze.Gloze.Gloze ( URL[]  schemaLocation,
URI[]  targetNS 
) throws Exception

Construct an instance of Gloze given multiple schema locations and target namespaces.

Parameters:
schemaLocation : array of URLs
targetNS : array of URIs
Exceptions:
Exception 


Member Function Documentation

static schema com.hp.gloze.Gloze.loadSchema ( URL  url  )  throws Exception [static]

Load schema with URL into a static cache. The schema is not associated with a gloze instance.

Parameters:
url : schema URL
Returns:
schema instance
Exceptions:
Exception 

static void com.hp.gloze.Gloze.clearCache (  )  [static]

Clear the static cache.

static schema com.hp.gloze.Gloze.getCachedSchema ( String  namespace  )  [static]

Get a schema from the static cache.

Parameters:
namespace 
Returns:
schema instance

static schema com.hp.gloze.Gloze.initSchema ( URI  namespace,
URL  url,
Map< URL, schema >  schemaMap 
) throws Exception [static]

Initialise a gloze instance with a schema given its URL and target namespace. The schemaMap is updated with the new mapping.

Parameters:
namespace : URI
url : schema location URL
schemaMap : Maps schema location to schema instance
Exceptions:
Exception 

static schema com.hp.gloze.Gloze.initSchemaXSI ( Element  element,
URL  location,
String  defaultNS,
Map< URL, schema >  schemaMap 
) throws Exception [static]

Initialise schema from schema location(s) defined in an xml element (typically the document element or an element corresponding to an xs:any wild-card).

Parameters:
element : potentially containing a schemaLocation
location : URL of this XML document.
defaultNS used instead of the schema URL.
schemaMap maps schema location to schema instance.
Exceptions:
Exception 

static schema com.hp.gloze.Gloze.initSchemaLocation ( URI  namespace,
URL  schemaLocation,
String  defaultNS,
Map< URL, schema >  schemaMap 
) throws Exception, URISyntaxException [static]

Add the schema, with given namespace and location, to the schema map.

Parameters:
namespace : the preferred namespace
schemaLocation 
defaultNS : used if no namespace is supplied
schemaMap : updated with the new schema mapping
Returns:
schema instance
Exceptions:
Exception 
URISyntaxException 

void com.hp.gloze.Gloze.xml_to_rdf ( File  source,
File  target,
URI  base,
Model  model 
) throws Exception

Lift XML to RDF metadata (given source and target files). The Gloze instance should be pre-initialised with the relevant XML schema.

Parameters:
source document
target file
base of the XML document
model for the RDF

Document com.hp.gloze.Gloze.rdf_to_xml ( File  source,
File  target,
URI  base,
Model  model 
) throws Exception

Drop RDF metadata into XML (given source and target files). The Gloze instance should be pre-initialised with the relevant XML schema. The model should be initialised with a prefix map used to define define xml namespaces.

Parameters:
source RDF
target file
base URI for XML
model containing a prefix map.
Returns:
XML document

OntModel com.hp.gloze.Gloze.xsd_to_owl ( File  source,
String  base 
) throws Exception

Lift XML schema to OWL ontology.

Parameters:
source schema
base of the ontology
Returns:
ontology

Model com.hp.gloze.Gloze.lift ( Document  xml,
URL  url,
URI  base 
) throws Exception

Lift XML (document) into RDF metadata, creating a new model. The Gloze instance should be pre-initialised with the relevant XML schema.

Parameters:
xml input document to lift
url location of the input document (required for relative schema location)
base : URI of the input document base
Returns:
model

boolean com.hp.gloze.Gloze.lift ( Document  xml,
URL  url,
URI  base,
Model  model 
) throws Exception

Lift XML (document) into RDF metadata, adding to existing model. The Gloze instance should be pre-initialised with the relevant XML schema.

Parameters:
xml input document
url location of the input document (required for resolving relative schema location)
base : URI of input document base
model output model
Returns:
boolean indicating success or failure.
Exceptions:
Exception 

Document com.hp.gloze.Gloze.drop ( Model  model,
URI  uri 
) throws Exception

Drop RDF model into XML (starting with named resource). The Gloze instance should be pre-initialised with the relevant XML schema.

Parameters:
model containing the RDF meta-data
uri the (named) root of the XML output
Returns:
XML Document

Document com.hp.gloze.Gloze.drop ( Resource  resource  )  throws Exception

Drop RDF resource into XML. The Gloze instance should be pre-initialised with the relevant XML schema.

Parameters:
resource resource representing the root of the XML document
Returns:
XML Document

static void com.hp.gloze.Gloze.main ( String  args[]  )  [static]

Gloze main program. The main input parameter is XML to lift or RDF to drop. This is followed by an (optional) sequence of targetNamespace schemaLocation pairs, followed by a single (optional) no-namespace schema location.


Generated on Mon Jun 18 16:02:38 2007 for Gloze by  doxygen 1.5.0