The library facilitates management of OWL 2 based ontology which describes a web service as defined in
W3C "Web Services Description Language (WSDL) Version 2.0: RDF Mapping" specification.
The wsdl2-rdf-core is based on The OWL API, but its API is quite abstract so it would possible to use other library in the future.
The main class is an Wsdl2RdfOntology ontology class which can be either created from scratch
Wsdl2RdfOntology ontology =
Wsdl2RdfFactory.newInstance().createWsdl2RdfOntology(URI.create("http://test"));
or from existent ontology file
InputStream in = LoadWsdl2RdfOntologyTest.class.getResourceAsStream("http://service.rdf");
Wsdl2RdfOntology ontology = Wsdl2RdfFactory.newInstance().loadWsdl2RdfOntology(in);
All future work is done through this object.
According the WSDL 2.0: RDF Mapping specification all WSDL 2.0 artifacts have their own unique IRIs.
All ontology modifications are done providing these IRIs in a form of URIs.
Here is a simple example that creates a new ontology and defines an interface and an operation for it.
Wsdl2RdfOntology ontology =
Wsdl2RdfFactory.newInstance().createWsdl2RdfOntology(URI.create("http://my_service"));
URI interfaceURI = ontology.addInterface("my_interface");
ontology.addInterfaceOperation(interfaceURI, "my_operation");
The library includes more than a hundred jUnit tests which are a great source of examples.