--- In jena-dev@yahoogroups.com, Dave Reynolds <der@...> wrote:
>
> Michael Schneider wrote:
> > --- In jena-dev@yahoogroups.com, Dave Reynolds <der@> wrote:
> >> In N3 this would then look like:
> >>
> >> :instX1 :haveA :instY2.
> >> _:s1 a rdf:Statement; rdf:subject :instX1;
> >> rdf:predicate :haveA; rdf:object :instY2 .
> >> _:s1 :isComment [a :Comment; dc:author "mike"; dc:date "..." etc].
> >
> > But what I see is that 'rdf:Reification'
>
> I think you mean 'rdf:Statement'
>
> > is not an owl:Class,
> > but an rdfs:Class. And so I would expect that it should not be allowed
> > within OWL-DL to construct statements like:
> >
> > _:s1 a rdf:Statement .
>
> Ah but an OWL reasoner doesn't know anything about rdf:Statement at all
> so just that model will validate as OWL/full because there is an
> undeclared class.
Oh, I see! Yes, there are several RDF constructs which OWL does not
know about, and rdf:{Statement|subject|predicate|object} are such
unknown things. I seem to had some hidden thinking that, because OWL
has some RDF syntax and is part of the semantic web language canon, it
should know about every RDF construct. But, of course, OWL only needs
to know those things of RDF which are necessary to capture OWL's
concepts. OWL is actually an ontology definition language on its own,
not really dependent on RDF. Easy to oversee...
> The trick you need to pull is to add:
>
> rdf:Statement a owl:Class .
>
> That validates with the WonderWeb online validator.
>
> [One could argue over just how Kosher that statement is but it's
> certainly true we only use rdf:Statement as if it were a class, not as
> an instance as well, so I see no fundamental problem with claiming that
> as far as an OWL reasoner is concerned.]
Uh, that really works! Great! :) (Well, I even thought of this myself for
a second when I wrote my last post, but I did not dare to follow this
thought, or even put it on a public mailing list. ;-) )
Ok, but this alone will not yet help to do reasonable things: In the
moment I create some reified statement, everything is again classified
as OWL-FULL. So the properties "rdf:subject", "rdf:predicate" and
"rdf:object" have to be introduced into the scope of OWL-DL, too. Of
course with an analogue trick as above. The problem is that one cannot
make them into ObjectPropertyS, because:
* the rdf:object of a rdf:Statement can be both an individual or a
literal;
* the rdf:predicate is not even an rdfs:Resource, but it's a
rdf:Property (can be at least both ObjectProperty or DatatypeProperty);
* even the rdf:subject can be something else than an individual,
e.g. an rdf:Statement itself (ok, we can make rdf:Statement a subclass
of owl:Thing, but I would like to investigate the consequences first,
before doing a second hack after that "a owl:Class")
So I think it's best [FIXME!] to make those properties into
owl:AnnotationPropertyS, in the way described in section 7.1 of the
OWL Language Reference:
http://www.w3.org/TR/owl-ref/#Annotations
I have attached a little example ontology doing this, and which
contains two reified statements: one containing an object property as
its predicate, and one containing a datatype property as its predicate
and a string as its object. This ontology is classified as OWL-LITE by
both Pellet and the WonderWeb validator.
> Try using: http://phoebus.cs.man.ac.uk:9999/OWL/Validator
> it gives useful explanations of why the species classification fails to
> turn out as you expect.
And the pellet "demo" (indeed a complete OWL validator with species
identification) does this, too (I just had forgotten about the
existence of this web site):
http://www.mindswap.org/2003/pellet/demo
Well, this site not only tells me what's actually wrong with my
ontology ("undefined class"), it even tells me what to do, to bring my
OWL file into DL conformance! A cool, error correcting feature. :)
Cheers,
Michael
------- DEMO: Reification in OWL-LITE -----
<?xml version="1.0"?>
<rdf:RDF
xmlns="http://www.ex.org/owl-refication.owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xml:base="http://www.ex.org/owl-refication.owl">
<owl:Ontology rdf:about=""/>
<!-- introducing reification into OWL -->
<owl:Class
rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
<owl:AnnotationProperty
rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#subject"/>
<owl:AnnotationProperty
rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate"/>
<owl:AnnotationProperty
rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#object"/>
<!-- definitions of object property, datatype property and two
individuals -->
<owl:ObjectProperty rdf:ID="op"/>
<owl:DatatypeProperty rdf:ID="dp">
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</owl:DatatypeProperty>
<owl:Thing rdf:ID="x1"/>
<owl:Thing rdf:ID="x2"/>
<!-- reified statement with object property -->
<rdf:Statement rdf:ID="op_stmt">
<rdf:subject rdf:resource="#x1"/>
<rdf:predicate rdf:resource="#op"/>
<rdf:object rdf:resource="#x2"/>
</rdf:Statement>
<!-- reified statement with datatype property -->
<rdf:Statement rdf:ID="dp_stmt">
<rdf:subject rdf:resource="#x1"/>
<rdf:predicate rdf:resource="#dp"/>
<rdf:object
rdf:datatype="http://www.w3.org/2001/XMLSchema#string">foo</rdf:object>
</rdf:Statement>
</rdf:RDF>