Re: declaredAs

[Just saw that there are more answers on this topic. Did not read the 
others, only Bijan's first one, and want to get this one out, to don't 
have a sleepless night. ;-) So maybe this one is already obsolete, when 
it is posted. Good night! :)]

Hi, Bijan!

Bijan Parsia wrote on 2007-08-07:

 > Now from use, you can derived all the "implied" resource kinds in a 
ontology by
 > inspecting all the (fully typed) axioms. What you can't do is put 
*checks* in
 > your ontology for being of a certain (set of) resource kinds. Some 
patterns are
 > easy enough: If you want to always enforce the OWL DL separated 
vocabulary criterion,
 > then implicit declarations are enough since *any* "duel use" is a 
violation.

 > But what if an author wants to distinguish between intended and 
accidental punning?
 > E.g., some classes I want to be usable as individuals and some not, 
and I don't want
 > any class to be a property? Use along *cannot* tell me this, and 
there is *no* way
 > to have this canned in advance (though there may be several well 
defined canned
 > versions we could use).

Holding myself straight to this concrete example: How would I express 
this in terms of declarations? I see how I can say that some name is 
allowed to stand for both, a class and an individual:

     :ClassOrIndividual owl:declaredAs owl:Class, owl:Individual .

But how can I say that another name can /only/ stand for a class and not 
an individual?

     :OnlyClass owl:declaredAs owl:Class .

I would need something like

     :OnlyClass owl:notAllowedAs owl:Individual .

Otherwise, what should my parser do when only having the first of these 
two declarations? It can either always deny ontologies, which contains 
some name, which is somewhere used in a way that is not explictly 
declared. In this case, the parser would show me the red card, if I say 
something like

     :OnlyClass a :ClassOrIndividual .

But this would be very restrictive, and would be very much against the 
"declarations are pure optional" spirit. But if only existing 
declarations were taken into account, what then would the two 
declarations above affect? I then see no difference between having 
declarations and having none:

     * An axiom ':ClassOrIndividual a :OnlyClass' will (intendendly) 
pass, because this matches the explicit declarations for both names.

     * A statement ':OnlyClass a :ClassOrIndividual' will 
(un-intendendly) pass, because there is no declaration which speaks 
against using ':OnlyClass' at an individual's position.

And now that we are finally at the point of discussing concrete 
examples, I like to come back to a small "BTW" in my first post:

     * Is there any list of concrete usecases for declarations? The 
above example (allowing or disallowing punning) would be one such 
usecase. Are there others? (And please no more examples of misspelled 
URIs anymore! ;-))

     * Are there any patterns, which tell me how to best work with 
declarations? At least my tool should know such pragmatics, but I (as a 
human and potential tool implementor) would like to see such 
best-practices, too.

 > (So, the *problem* is determining whether a pun is incidental or 
intended,
 > or signalling to users and extenders whether the original author intended
 > this class to be used as an individual. If we want to *publish* our 
intent,
 > we need to write it down.

Ok!

 > Declarations let us write it down. Hard to see any other way 
(although you
 > could imagine a declaration language that used patterns the way 
aboutEachPrefix could,
 > or other macro like things; but these are implementation details almost))

An alternative would perhaps be to follow the lines of XDoclets for 
Java. Within a comment, one could put in some "@DeclaredAsClass(C)" 
string or something similar what a parser can easily detect and which is 
hard to produce by accident. In OWL-1.1 we will have axiom comments 
(annotations), so this approach could be realized  independent of any 
serialization language. I would probably prefer to put all those 
declaration statements into a toplevel comment:

     Ontology(MyOnt comment(@DeclaredAsClass(C) 
@DeclaredAsObjectProperty(P) ...))

The advantages and disadvantages are similar to those of XDoclet comments:

     - Not directly supported by the language, just a convention

     + Not directly supported by the language, just a convention :). So 
a "full featured tool" is not really supposed to support it, but one can 
add a third party preprocessor plugin to run over an ontology before 
parsing.

     - a little cumbersome compared with direct language support

     + very flexible: one can invent other such "XDoclets", like 
'@NotAllowedAsIndividual(C)', or

          '@MacroExpansion( MyDisjointUnion(A B...) { Union(A B...) 
DisjointClasses(B...) } )'

     + allows experimenting with new features, which will perhaps some 
time get a change to go directly into the OWL language


Cheers,
Michael

Received on Tuesday, 7 August 2007 20:38:53 UTC