Hello all,

Can rdf/xml format be used to serialize all features of OWL? Are there any situations where you would like to use owl/xml serialization over rdf/xml serialization?

I was reading a paper on SQWRL[1] where they mentioned that there is no serialization for some OWL constructs. I searched around but couldn't find anything on this (constructs that cannot be serialized by rdf/xml).

Thank you in advance.

[1] O'Connor, M.J. and Das, A. "SQWRL: a Query Language for OWL" OWL: Experiences and Directions (OWLED), 6th International Workshop, Chantilly, VA, 2009.

asked 24 Aug '11, 11:49

Raghava's gravatar image

accept rate: 0%


After going through the answer by Michael Schneider for this question I see that only OWL 2 DL can be mapped safely to RDF. So does it mean rdf/xml serialization should only be used for OWL 2 DL?

(24 Aug '11, 15:04) Raghava Raghava's gravatar image

The paper only says there is no canonical representation of some OWL constructs in RDF, in other words, the same OWL construct can be expressed as several different RDF graphs. I only skimmed Michael's answer in the link you posted, but AFAICT he doesn't say anywhere that only OWL 2 DL can be safely mapped to RDF.

(25 Aug '11, 10:44) cygri ♦ cygri's gravatar image

@cygri Thank you for the answer and sorry for the misrepresentation :)

(25 Aug '11, 12:24) Raghava Raghava's gravatar image

You could create an OWL ontology that uses literals or URIs with Unicode codepoints not allowed in XML -- but this would be a hack, illegal in other XML languages, and it applies to all RDF data, not only OWL. I always wondered why RDF/XML was choosen as default serialization although it cannot express all valid RDF graphs.

(26 Aug '11, 03:48) Jakob Jakob's gravatar image

Every OWL 2 ontology given in the OWL 2 Structural Specification (this includes all OWL 2 DL ontologies, but goes beyond) can be translated into a corresponding RDF graph via the OWL 2 Mapping to RDF Graphs. Since OWL/XML is a serialization syntax for the (abstract) OWL 2 Structural Specification, and since RDF/XML is a serialization syntax for (abstract) RDF graphs, this means that every OWL/XML document can be translated into an RDF/XML document. *) The other way round (the reverse RDF mapping from RDF to the native OWL syntax) is, however, /not/ generally possible, but is only safe for OWL 2 DL.

If outside OWL 2 DL, there are many dangers to not safely get from RDF to the native OWL 2 syntax. One example is when RDF lists are used as normal entities instead of argument lists for OWL constructs, e.g., if used for something like ":me :traveledCountries (Argentina Belarus China)". There is simply no translation rule for constructs like this in the reverse RDF mapping. Another example is when it cannot be determined for a property what the exact kind of property is: ObjectProperty, DatatypeProperty or AnnotationProperty. This is especially often the case for RDFS vocabularies, where you typically "only" have rdf:Property declarations and no additional OWL declarations. The reverse RDF mapping fails in such a case. Some tools (e.g. the OWL API) go beyond the reverse RDF mapping and try to make some "best guess" about such a property's exact entity type, but there is generally no safe way to find it out.

Finally, when would I want to use OWL/XML? I think it is the best serialization and data-exchange syntax for ontologies created with an ontology editor that applies an internal ontology representation following the OWL 2 native syntax, with the option to create ontologies beyond OWL 2 DL (which may make sense occasionally), and if one intends to use such ontologies only with ontology tools of this kind. I think, Protege4 counts as such a tool. **) One can then store and restore ontologies without any changes, while with RDF/XML, at least when outside OWL 2 DL, there are no guarantees for successful reconstruction (actually, the RDF Mapping does not even guarantee a precise reconstruction for OWL 2 DL ontologies, but only a /semantically/ equivalent reconstruction).

(* I am not going to mention that there are syntactic corner cases where RDF/XML fails to serialize an RDF graph...

(** I haven't installed Protege4 right now, so I cannot tell whether it uses OWL/XML or not, but it is probably at least an option for exporting ontologies, since it is supported by the OWL API, which is used by Protege4 internally.

permanent link

answered 25 Aug '11, 14:00

Michael%20Schneider's gravatar image

Michael Schn... ♦
accept rate: 34%

thank you for the detailed response :), that was very helpful.

(29 Aug '11, 18:54) Raghava Raghava's gravatar image

You sholuld take a look at this detailed answer about the different syntaxes of OWL.

permanent link

answered 24 Aug '11, 12:18

Antoine%20Zimmermann's gravatar image

Antoine Zimm... ♦
accept rate: 34%

Thank you for the link. That was helpful. It is mentioned in that link that non-OWL 2 DL Ontologies cannot be serialized in owl/xml. I might be missing this from that link but I still could not get an answer to my two questions.

(24 Aug '11, 13:50) Raghava Raghava's gravatar image

@Raghava: There are many non-OWL 2 DL ontologies that can still be serialized in OWL/XML. See the distinction being made in http://www.w3.org/TR/2009/REC-owl2-syntax-20091027/#Ontologies between "OWL 2 ontologies" and "OWL 2 DL ontologies": the set of OWL 2 DL ontologies is defined via a number of syntactic restrictions on the set of all OWL 2 ontologies. OWL/XML allows to represent all OWL 2 ontologies, not just the OWL 2 DL ontologies. However, what you cannot always do is mapping your OWL/XML to RDF/XML and back into OWL/XML: the step from RDF to OWL/XML works safely only for OWL 2 DL.

(25 Aug '11, 18:47) Michael Schn... ♦ Michael%20Schneider's gravatar image

I might add that the OWL Structural Spec allows to represent /every/ RDF triple by either an object property assertion or a data property assertion (this is, however, /not/ possible in OWL 2 /DL/). Hence, you can (ab)use OWL/XML to even serialize every RDF graph and thus all "OWL 2 Full ontologies". However, this trick is dangerous, as it is not "roundtrip-proof": You can start from a "triple" ObjectPropertyAssertion(rdf:type :u :C) in OWL/XML, mapping this into RDF/XML yields ":u rdf:type :C", and reverse-mapping this to OWL/XML gives ClassAssertion(:C :u) - the semantics has changed!

(25 Aug '11, 19:04) Michael Schn... ♦ Michael%20Schneider's gravatar image

All of OWL can be serialized as RDF/XML. And I don't think the paper you cite makes claims to the contrary. Instead, it says that different tools could represent the same OWL using "slightly different" RDF. Thus, "SPARQL queries may perform differently when applied to ontologies produced by different tools".

XML serialization of OWL is designed for use by XML tools (e.g., tools using, for example, XQuery). Although the XML serialization is designed as an exchange syntax for OWL 2, RDF/XML is the only required exchange syntax for OWL.

If the above critique of SPARQL was an issue (I have not experienced these problems), chances are it could also be applied to the use of XQuery with XML serialization of OWL.

permanent link

answered 25 Aug '11, 02:29

irene_polikoff's gravatar image

accept rate: 21%

edited 25 Aug '11, 02:43

Thank you for the answer. That answers my questions :)

(25 Aug '11, 12:24) Raghava Raghava's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 24 Aug '11, 11:49

question was seen: 3,597 times

last updated: 29 Aug '11, 18:54