[Pellet-users] Getting Properties with a given domain (corrected: sorry)
Evren Sirin
evren at clarkparsia.com
Mon Mar 5 15:03:09 UTC 2007
There is a bug in KnowledgeBase.getDomains which was supposed to call
KnowledgeBase.ensureConcistency (or KnowledgeBase.prepare at the least)
but didn't. That's when role.getDomain() would be computed (from
role.getDomains() plus other class axioms using a technique called role
absorption). If you manually call reasoner.getKB().prepare() in your
code you will see that issue is solved. However, I must also note that
the results of KnowledgeBase.getDomains() is not complete. It may have
some inferred domains in the result but it is not guaranteed to have
them all (same is true for getRanges function, too) because it would be
too costly to compute all the domains and it is not always intuitive.
People generally only think of rdfs:domain to define the domain of a
property but if you have an axiom SubClassOf(restriction(p,
minCardinality(1), C) then the class C should be inferred as a domain of
property p. If you really want all the domains (resp. ranges) for a
property, you can use the logically complete KnowledgeBase.hasDomain
(resp. KnowledgeBase.hasRange) function by iterating through the
possibilities.
Hope this helps,
Evren
On 3/5/07 5:17 AM, Álvaro Ramos wrote:
> Hi,
>
> I send the appropriate files now... sorry for the spam.
>
>
> I am using Pellet together with the OWL-API I load the Simple ontology
> from an owl file (attached). When I execute the code from SWOOP that
> supposedly retrieves all the properties that have as domain a given
> class I obtain none. Specifically, I am using a very simple ontology
> to further test this behaviour. I am trying to retrieve the properties
> with domain "Class_1".
>
> Debugging and looking into the Pellet code I have arrived to the method
>
> public Set getDomains(ATermAppl name) in KnowledgeBase
>
> There the domain of the property is obtained via
>
> ATermAppl domain = prop.getDomain();
>
> However if I inspect the Role 'prop' I see that the field 'domain'
> (that is returned by getDomain()) is null, while the field 'domains'
> contains
> [http://www.owl-ontologies.com/Ontology_simple.owl#ParentClass]. Is it
> possible that the error lies here?
>
> Probably I am doing something wrong before calling the SWOOP method
> Set getPropertiesWithDomain(OWLClass c, boolean inherited). Would
> someone help me out?
>
> The whole code of my test is attached.
>
> Best regards,
> Álvaro
>
>
More information about the Pellet-users
mailing list