The OWLlink Interface provides an implementation-neutral mechanism for accessing OWL reasoner functionality. OWLlink relies on OWL 2 for the primitives of the modeling language, and is thus fully compatible with OWL. The set of OWLlink primitives described in this document cover basic reasoner managment, assertion of axioms and elementary ask functionality. An extension mechanism is provided in order to easily add any required functionality in a controlled way to the core language. This document defines a concrete binding of OWLlink into [HTTP/1.1] and [XML Schema]. A structural specification of OWLlink is given in an accompanying document [OWLlink Structural Specification].
This version of the OWLlink structural specification refers to the public OWL 2 working draft as of April 11th 2008 (http://www.w3.org/TR/2008/WD-owl2-syntax-20080411/) and will soon be superseded by an updated specification in order to align with the latest OWL 2 working draft or recommendation.
This document is being published as one of a set of 3 documents:
The OWLlink Working Group seeks public feedback on these Working Drafts. Please send your comments to public-comments@owllink.org or post to the public discussion forum at http://www.owllink.org/forum/.
Contents |
OWLlink is defined in terms of a structural specification [OWLlink Structural Specification]. The following describes a binding of the specification to a concrete communication protocol, namely XML over HTTP. Note that this is only one conceivable binding. Other bindings may utilize [SOAP] or another particular Remote Message Invocation protocol.
The HTTP/XML binding of OWLlink uses HTTP as its underlying communication protocol for exchanging XML content between a reasoner and a client. More technically, the reasoner has to accept HTTP POST requests and responds as appropriate according to the OWLlink specification. The requests as well as responses have to consist of XML data according to the [ OWLlink HTPP/XML Schema] available at owllink-xml-20081001.xsd. The schema is obtained by a translation of the objects from the UML diagrams of the OWLlink specification according to the translation rules described in Section 2.2.
Note that the HTTP/XML binding is not intended to be backwards compatible with existing implementations of the [DIG 1.1] specification. However, it relies on the [OWL 2 XML Serialization] for the primitives of the ontology language, and is thus fully compatible with OWL. As a result, implementors of the XML binding of OWLlink can re-use their implementation of OWL 2 parsers to parse the OWL 2 specific contents of OWLlink primitives.
Editor's Note: The namespace for the XML serialization is not finalized. It will follow the OWL 2 namespace definitions. However this is not finalized yet (see [issue 109]).
A common transport mechanism for communicating with an OWLlink server is through [HTTP/1.1] protocol and communication by messages. XML is a verbose format and large Knowledge Bases may require a lot of information to be transferred over the wire. It has been observed with DIG 1.1 implementations that this can introduce a considerable overhead into the communication process. In order to alleviate this, OWLlink servers should support the use of compression, with message pay-loads being compressed before transfer. This is done with help of the standard compression technology of the HTTP/1.1 transport mechanism. For instance, a server will include Content-Encoding: gzip in the header of each HTTP message to specify that the content has been compressed according to the gzip specification. Alternatively, an OWLlink HTTP/XML implementation could make use of methods developed within the Efficient XML Interchange initiative [EXI]
An OWLlink session is mapped to an HTTP connection and is typically established upon sending the first request. HTTP servers are in general allowed to close the HTTP connection at their own discretion, which in effect terminates the OWLlink session. In order to prevent this from happening, the client can include the keepAlive in the header of each HTTP request it sends. Note that closing an OWLlink session does not imply the release of the Knowledge Base. OWLlink HTTP servers are required to recognize this HTTP header and implement its functionality according to the HTTP/1.1 specification.
Messages are sent using the HTTP POST requests. The content type for messages is text/xml. The Content-Length must be explicitly set and confirm to the HTTP standard.
The [ XML syntax for OWLlink] is defined as an [XML Schema] and available as a separate document. It has been obtained by a straightforward translation of the structural specification from the [OWLlink Specification] in the following way:
Certain global conditions on OWLlink XML documents that are related to the communication cannot be captured in an XML Schema, i.e. the correspondence of requests and responses. Furthermore, the root element of any OWLlink XML document written in this syntax must be either ol:RequestMessage for bundling requests or ol:ResponseMessage for bundling responses.
The XML schema presented in this document covers the entire OWLlink specification including all management, tell and ask primitives.
Following a straightforward translation of the OWLlink specification into an XML schema the content body of a HTTP message is either the root element RequestMessage or a ResponseMessage containing requests resp. responses. Each Request need to be acknowledged with a Response element as described in the OWLlink specification document in the order matching with the order of the corresponding requests.
<ol:RequestMessage> [request #1] [request #2] [ ... ] [request #n] </ol:RequestMessage>
<ol:ResponseMessage> [response #1 (for request #1)] [response #2 (for request #2)] [ ... ] [response #n (for request #n)] </ol:ResponseMessage>
If a server cannot process a request, it should attempt to recover gracefully, and process other pending requests as if the error did not happen. If, however, this recovery is not possible, after sending the Error response, the server should close the OWLlink session. If the OWLlink client or server detects a violation of the HTTP protocol such as invalid headers, it should respond as specified in the HTTP standard and then close the HTTP connection, i.e. the OWLlink session.
To enable the embedding of new requests and responses into XML messages, implementors should use the redefinition mechanism of XML Schema and extend the ol:Request and ol:Response element groups. We strongly encourage the definition of two files: one which contains the schema file of the new elements with a separate namespace and one file which redefined the OWLlink schema. Otherwise, if two different extensions directly extend the OWLlink schema without defining a new namespace it is not possible to use them at the same time because XML schema does not allow for the redefinition of two schemas at the same time.
For instance, let us assume that some extension defines a new Knowledge Base request and an additional request with a corresponding response. This extension can be defined in a separate XML schema file with a separate namespace.
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ol="http://www.owllink.org/owllink-xml" targetNamespace="http://www.owllink.org/owllink-xml/sampleExtensionDef" elementFormDefault="qualified" attributeFormDefault="qualified"> <xsd:import namespace="http://www.w3.org/ns/owl2-xml" schemaLocation="owl2.xsd"/> <xsd:import namespace="http://www.owllink.org/owllink-xml" schemaLocation="owllink-xml.xsd"/> <!-- simple request without additional parameters--> <xsd:element name="NewRequest1" type="ol:Request"/> <!-- simple KBRequest without additional parameters--> <xsd:element name="NewKBRequest1" type="ol:KBRequest"/> <!-- complex request --> <xsd:element name="NewKBRequest2"> <xsd:complexType> <xsd:complexContent> <xsd:extension base="ol:KBRequest"> [...definition...] </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:element> <!-- complex response --> <xsd:element name="NewResponse1"> <xsd:complexType> <xsd:complexContent> <xsd:extension base="ol:Response"> [...definition...] </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:element> <!-- complex KBResponse --> <xsd:element name="NewKBResponse1"> <xsd:complexType> <xsd:complexContent> <xsd:extension base="ol:KBResponse"> [...definition...] </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:element> </xsd:schema>
The next step is to redefine the OWLlink schema. It is not necessary to modify the original OWLlink file; rather, a new file (e.g., sampleExtension.xsd) of the following form can be used:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ol="http://www.owllink.org/owllink-xml" xmlns:ext="http://www.owllink.org/owllink-xml/sampleExtensionDef" targetNamespace="http://www.owllink.org/owllink-xml" elementFormDefault="qualified" attributeFormDefault="qualified"> <xsd:import namespace="http://www.w3.org/ns/owl2-xml" schemaLocation="owl2.xsd"/> <xsd:import namespace="http://www.owllink.org/owllink-xml/sampleExtensionDef" schemaLocation="sampleExtensionDef.xsd"/> <xsd:redefine schemaLocation="owllink-xml.xsd"> <xsd:group name="Request"> <xsd:choice> <xsd:group ref="ol:Request"/> <xsd:element ref="ext:NewRequest1"/> <xsd:element ref="ext:NewKBRequest1"/> <xsd:element ref="ext:NewKBRequest2"/> </xsd:choice> </xsd:group> <xsd:group name="Response"> <xsd:choice> <xsd:group ref="ol:Response"/> <xsd:element ref="ext:NewResponse1"/> <xsd:element ref="ext:NewKBResponse1"/> </xsd:choice> </xsd:group> </xsd:redefine> </xsd:schema>
<?xml version="1.0" encoding="UTF-8"?> <RequestMessage xmlns="http://www.owllink.org/owllink-xml"> <GetDescription/> </RequestMessage>
The answer response Description must contained the reasoner name (e.g. MyOwnReasoner), the version of the reasoner as well as of the supported OWLlink protocol. In addition, it answers with the set of supported settings (Setting element) and (read-only) properties (Property element) as well as with supported OWLlink extensions (Extension). For instance, in the following sample response message the reasoner states that it supports the following profiles: OWL-DL and OWL-R DL. In addition, OWL-DL is used as the profile for newly created Knowledge Bases by default. The default values can be overridden for each Knowledge Base separately as shown in Section 4.2 . The ignoresAnnotations Property informs that the reasoner ignores annotation and that this behavior can not be changed.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ResponseMessage [ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> <!ENTITY ole "http://www.owllink.org/owllink-ext-xml/"> ]> <ResponseMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ox="http://www.w3.org/ns/owl2-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <Description ol:name="MyOwnReasoner"> <OWLlinkVersion major="1" minor="0"/> <ReasonerVersion major="1" minor="0"/> <Property ol:key="ignoresAnnotations"> <Datatype ol:URI="&xsd;boolean"/> <Literal>true</Literal> </Property> <Property ol:key="ignoresDeclarations"> <Datatype ol:URI="&xsd;boolean"/> <Literal>true</Literal> </Property> <Setting ol:key="selectedProfile"> <OneOf> <Literal ol:URI="&xsd;string">OWL-DL</Literal> <Literal ol:URI="&xsd;string">OWL-R DL</Literal> </OneOf> <Literal>OWL-DL</Literal> </Setting> <Setting ol:key="uniqueNameAssumption"> <Datatype ol:URI="&xsd;boolean"/> <Literal>true</Literal> </Setting> <SupportedExtension ol:URI="&ole;retraction"/> <SupportedExtension ol:URI="&ole;told"/> </Description> </ResponseMessage>
<?xml version="1.0" encoding="UTF-8"?> <RequestMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <Set ol:kb="KB_1" ol:key="selectedProfile"> <Literal>OWL-R DL</Literal> </Set> </RequestMessage>If the Set has not been refused an OK will be returned, otherwise an Error
<?xml version="1.0" encoding="UTF-8"?> <ResponseMessage xmlns="http://www.owllink.org/owllink-xml"> <OK/> </ResponseMessage>
<?xml version="1.0" encoding="UTF-8"?> <RequestMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <GetSettings ol:kb="KB_1"/> </RequestMessage>The corresponding ResponseMessage will contain all settings of the specified Knowledge Base.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ResponseMessage [ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> ]> <ResponseMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <Settings> <Setting ol:key="selectedProfile"> <OneOf> <Literal ol:URI="&xsd;string">OWL-DL</Literal> <Literal ol:URI="&xsd;string">OWL-R DL</Literal> </OneOf> <Literal>OWL-R DL</Literal> </Setting> <Setting ol:key="uniqueNameAssumption"> <Datatype ol:URI="&xsd;boolean"/> <Literal>true</Literal> </Setting> </Settings> </ResponseMessage>
<?xml version="1.0" encoding="UTF-8"?> <RequestMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ox="http://www.w3.org/ns/owl2-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <CreateKB ol:kb="KB_1"/> <Tell ol:kb="KB_1"> <ox:SubClassOf> <ox:OWLClass ox:URI="A"/> <ox:OWLClass ox:URI="B"/> </ox:SubClassOf> <ox:SubClassOf> <ox:OWLClass ox:URI="B"/> <ox:OWLClass ox:URI="C"/> </ox:SubClassOf> </Tell> <IsClassSatisfiable ol:kb="KB_1"> <ox:OWLClass ox:URI="A"/> </IsClassSatisfiable> </RequestMessage>
According to the [OWLlink Structural Specification] every single Request must be acknowledged with a corresponding Response considering the ordered sequence of request elements. Both the CreateKB and the Tell request is acknowledged and the BooleanResponse positively answers the ask about the satisfiability of the given class.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ResponseMessage [ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> <!ENTITY ole "http://www.owllink.org/owllink-ext-xml/"> ]> <ResponseMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ox="http://www.w3.org/ns/owl2-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <OK/> <OK/> <BooleanResponse ol:result="true"/> </ResponseMessage>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE RequestMessage [ <!ENTITY owl "http://www.w3.org/2002/07/owl'"> ]> <RequestMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ox="http://www.w3.org/ns/owl2-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <CreateKB ol:kb="KB_1"/> <!-- Some tells in KB_1 --> <Tell ol:kb="KB_1"> <ox:SubClassOf> <ox:OWLClass ox:URI="B"/> <ox:OWLClass ox:URI="A"/> </ox:SubClassOf> <ox:SubClassOf> <ox:OWLClass ox:URI="C"/> <ox:OWLClass ox:URI="A"/> </ox:SubClassOf> <ox:EquivalentClasses> <ox:OWLClass ox:URI="D"/> <ox:OWLClass ox:URI="E"/> </ox:EquivalentClasses> <ox:ClassAssertion> <ox:OWLClass ox:URI="A"/> <ox:Individual ox:URI="iA"/> </ox:ClassAssertion> </Tell> <!-- Some asks --> <GetAllClasses ol:kb="KB_1"/> <GetEquivalentClasses ol:kb="KB_1"> <ox:OWLClass ox:URI="D"/> </GetEquivalentClasses> <IsClassSubsumedBy ol:kb="KB_1"> <ox:OWLClass ox:URI="&owl;Thing"/> <ox:OWLClass ox:URI="&owl;Nothing"/> </IsClassSubsumedBy> <GetSubClasses ol:kb="KB_1"> <ox:OWLClass ox:URI="C"/> </GetSubClasses> <!-- Some tells in KB_2 --> <CreateKB ol:kb="KB_2" ol:name="MyKB_2"/> <Tell ol:kb="KB_2"> <ox:SubClassOf> <ox:OWLClass ox:URI="A"/> <ox:OWLClass ox:URI="B"/> </ox:SubClassOf> </Tell> <!-- KB Management --> <ReleaseKB ol:kb="KB_1"/> <!-- One more ask --> <GetAllClasses ol:kb="KB_1"/> </RequestMessage>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ResponseMessage [ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> <!ENTITY owl "http://www.w3.org/2002/07/owl'"> <!ENTITY ole "http://www.owllink.org/owllink-ext-xml/"> ]> <ResponseMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ox="http://www.w3.org/ns/owl2-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <KB ol:kb="KB_1"/> <KB ol:kb="KB_2"/> <!-- tell --> <OK/> <!-- asks --> <SetOfClasses> <ox:OWLClass ox:URI="A"/> <ox:OWLClass ox:URI="B"/> <ox:OWLClass ox:URI="C"/> <ox:OWLClass ox:URI="D"/> <ox:OWLClass ox:URI="E"/> </SetOfClasses> <SetOfClasses> <ox:OWLClass ox:URI="E"/> </SetOfClasses> <BooleanResponse ol:result="false"/> <SetOfClassSynsets> <ClassSynset> <ox:OWLClass ox:URI="&owl;Nothing"/> </ClassSynset> </SetOfClassSynsets> <!-- some tells in KB_2 --> <OK/> <!-- KB management --> <OK/> <!-- One more ask --> <KBError ol:errorMessage="KB KB_1 does not exist!"/> </ResponseMessage>
<?xml version="1.0" encoding="UTF-8"?> <RequestMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ox="http://www.w3.org/ns/owl2-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <CreateKB ol:kb="KB_2"/> <Tell ol:kb="KB_2"> <ox:SubClassOf> <ox:OWLClass ox:URI="B"/> <ox:OWLClass ox:URI="A"/> </ox:SubClassOf> <ox:SubClassOf> <ox:OWLClass ox:URI="C"/> <ox:OWLClass ox:URI="A"/> </ox:SubClassOf> <ox:SubClassOf> <ox:OWLClass ox:URI="D"/> <ox:OWLClass ox:URI="B"/> </ox:SubClassOf> <ox:SubClassOf> <ox:OWLClass ox:URI="D"/> <ox:OWLClass ox:URI="C"/> </ox:SubClassOf> <ox:SubClassOf> <ox:OWLClass ox:URI="E"/> <ox:OWLClass ox:URI="D"/> </ox:SubClassOf> <ox:EquivalentClasses> <ox:OWLClass ox:URI="A"/> <ox:OWLClass ox:URI="EquiA"/> </ox:EquivalentClasses> <ox:EquivalentClasses> <ox:OWLClass ox:URI="C"/> <ox:OWLClass ox:URI="EquiC"/> </ox:EquivalentClasses> </Tell> <GetSubClassHierarchy ol:kb="KB_2"/> <ReleaseKB ol:kb="KB_2"/> </RequestMessage>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ResponseMessage [ <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> <!ENTITY owl "http://www.w3.org/2002/07/owl'"> <!ENTITY ole "http://www.owllink.org/owllink-ext-xml/"> ]> <ResponseMessage xmlns="http://www.owllink.org/owllink-xml" xmlns:ox="http://www.w3.org/ns/owl2-xml" xmlns:ol="http://www.owllink.org/owllink-xml"> <ClassHierarchy> <ClassSubClassPair> <ClassSynset> <ox:OWLClass ox:URI="A"/> <ox:OWLClass ox:URI="EquiA"/> </ClassSynset> <SetOfSubClassSynsets> <ClassSynset> <ox:OWLClass ox:URI="B"/> </ClassSynset> <ClassSynset> <ox:OWLClass ox:URI="C"/> <ox:OWLClass ox:URI="EquiC"/> </ClassSynset> </SetOfSubClassSynsets> </ClassSubClassPair> <ClassSubClassPair> <ClassSynset> <ox:OWLClass ox:URI="B"/> </ClassSynset> <SetOfSubClassSynsets> <ClassSynset> <ox:OWLClass ox:URI="D"/> </ClassSynset> </SetOfSubClassSynsets> </ClassSubClassPair> <ClassSubClassPair> <ClassSynset> <ox:OWLClass ox:URI="C"/> <ox:OWLClass ox:URI="EquiC"/> </ClassSynset> <SetOfSubClassSynsets> <ClassSynset> <ox:OWLClass ox:URI="D"/> </ClassSynset> </SetOfSubClassSynsets> </ClassSubClassPair> <ClassSubClassPair> <ClassSynset> <ox:OWLClass ox:URI="D"/> </ClassSynset> <SetOfSubClassSynsets> <ClassSynset> <ox:OWLClass ox:URI="E"/> </ClassSynset> </SetOfSubClassSynsets> </ClassSubClassPair> </ClassHierarchy> </ResponseMessage>