0

Let's consider a

(1) P Domain CSuper
(2) CSub subClassOf CSuper

Using Jena, I'm trying to list the declared properties for CSub. What I believe is that P mustn't be listed as a declared property for CSub. My justification: P is a declared property for CSub, iff CSub is a domain for P, from (1) CSuper is a domain for P which doesn't imply that CSub is also a domain; (1) means that if (x, y) is P, then x is CSuper, clearly x may (not) be CSub.

The surprising thing is that Jena is listing P as a declared property for CSub when using listDeclaredProperties method even using OntModelSpec.OWL_DL_MEM_RULE_INF or Pellet! Am I missing something?

Update: What does a declared property for some class mean? Does it mean the classes that the property is a domain of them!

Median Hilal
  • 1,483
  • 9
  • 17

1 Answers1

2

You want:

theClass.listDeclaredProperties(false);

From the documentation:

listDeclaredProperties() Equivalent to calling listDeclaredProperties(boolean) with default value direct = false.

direct - If true, restrict the properties returned to those directly associated with this class. If false, the properties of super-classes of this class will not be listed among the declared properties of this class.

I think you've misunderstood declared properties. This returns properties that a class may (or must) have. Suppose we have a class hierarchy:

A > B > C

and also:

P domain B

All Bs and Cs may have property P -- no contradiction there. However it's not true that all As may have property P -- the not-Bs are the problem.

Community
  • 1
  • 1
user205512
  • 8,798
  • 29
  • 28
  • Well, this seems clear. However, what does a declared property for some class mean? Does it mean the classes that the property is a domain of them? If this is true, then all As and Bs will have the P, i.e. not all Bs and Cs! – Median Hilal Mar 04 '15 at 11:52
  • In RDF schema it will simply mean domain, I think. (I'm not sure whether it includes properties without an explicit domain) OWL may be more complex, I can't recall. – user205512 Mar 04 '15 at 16:10