In RDF/XML, it is possible to specify anonymous resources as follows (where
(EDIT: The above fragment is syntactically incorrect RDF/XML: see Antoine's answer for the correct version)
This describes the situation where
My question: is there a generally accepted way of specifying and dealing with anonymous datatype literals? For instance, I can hack together something like this:
This gets at what I'm after, which is to assert that
Is there a better way?
Short answer: No, but... :-)
Let me start by saying that the OWL API's internal representation model mirrors the OWL 2 Structural Specification, which is (a superset of) the syntax of OWL 2 DL. This syntax of OWL has no concept of anonymous data values (i.e., anonymous instances of datatypes), only anonymous individuals are supported by this syntax. If you check through the details of the specification of the syntax, you will not find any treatment of anonymous individuals in positions where data values are expected. For example, the syntax definition for data property assertions requires object of sort "targetValue" in value position, which, according to the BNF given in Sec. 9.6, can only be a literal. Having a blank node in such a position would simply be a syntax error (blank nodes indicate anonymous individuals in the Structural Specification just as in RDF).
This is also reflected by the (reverse) OWL 2 RDF Mapping: there are no translation rules that would lead from an RDF graph with blank nodes in data value position to a corresponding ontology in the Structural Specification. For example, the only such rule that leads to an expression of the form "DataPropertyAssertion(...)" starts from an RDF triple having a literal in its object position (see Table 16).
It is also noteworthy in this context that the OWL 2 Direct Semantics, which is the Semantics of OWL 2 DL and which is defined on top of the OWL 2 Structural Specification, strictly separates between individuals (instances of classes) and data values (instances of datatypes), see Sec. 2.2. Hence, anonymous individuals can never be interpreted as data values under the OWL 2 Direct Semantics (and, therefore, never in OWL DL).
Consequently (at least to my best knowledge), OWL API does not support anonymous data values.
However, anonymous data values are allowed and interpreted as such in OWL 2 Full. They are allowed, because OWL 2 Full allows for arbitrary RDF graphs as valid syntax, in particular those RDF graphs having blank nodes in data value position. And they are interpreted as data values due to the specific nature of the semantics of OWL 2 Full, the OWL 2 RDF-Based Semantics, which is an extension of RDFS. Actually, data values are simply individuals under this semantics, in contrast to the OWL 2 Direct Semantics, which, as said above, strictly separates individuals from data values.
But while OWL 2 Full does the job, the OWLAPI does not help you, because the OWLAPI has not been designed to work with arbitrary RDF graphs (i.e., arbitrary OWL Full ontologies). While the OWLAPI pretty rarely reports a syntax error when given an RDF graphs for which there is no reverse RDF mapping to an ontology for the Structural Specification, what the OWLAPI actually does with such input is "repairing" such graphs into a form that matches its internal representation model, which, as said, mirrors the OWL 2 Structural Specification. This may then easily lead to changes that the original author did not intend, in particular, blank nodes in data value position will not be retained as such, simply because there is no way to represent them internally within the OWLAPI.
answered 16 Mar '12, 08:04
Michael Schn... ♦
There is a better (and correct) way to do that.
First, there is an error in your RDF/XML code. You cannot have a property element as a direct child of a property element. Here, you have
but you can write it in a more compact way:
Your second example does not introduced an anonymous literal. It actually introduce the literal
You can rewrite your second snippet as follows:
Alternatively, you may want to restrict the range of
If you write your examples in Turtle or NTriples, you can better see the RDF graph in terms of triples.
answered 16 Mar '12, 04:05
Antoine Zimm... ♦