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[]) |
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.
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.
schemaLocation | : URL | |
targetNS | : URI |
Exception |
com.hp.gloze.Gloze.Gloze | ( | URL[] | schemaLocation, | |
URI[] | targetNS | |||
) | throws Exception |
Construct an instance of Gloze given multiple schema locations and target namespaces.
schemaLocation | : array of URLs | |
targetNS | : array of URIs |
Exception |
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.
url | : schema URL |
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.
namespace |
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.
namespace | : URI | |
url | : schema location URL | |
schemaMap | : Maps schema location to schema instance |
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).
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. |
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.
namespace | : the preferred namespace | |
schemaLocation | ||
defaultNS | : used if no namespace is supplied | |
schemaMap | : updated with the new schema mapping |
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.
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.
source | RDF | |
target | file | |
base | URI for XML | |
model | containing a prefix map. |
OntModel com.hp.gloze.Gloze.xsd_to_owl | ( | File | source, | |
String | base | |||
) | throws Exception |
Lift XML schema to OWL ontology.
source | schema | |
base | of the 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.
xml | input document to lift | |
url | location of the input document (required for relative schema location) | |
base | : URI of the input document base |
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.
xml | input document | |
url | location of the input document (required for resolving relative schema location) | |
base | : URI of input document base | |
model | output model |
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.
model | containing the RDF meta-data | |
uri | the (named) root of the XML output |
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.
resource | resource representing the root of the 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.