aehrc / snorocket

The Snorocket Description Logic classifier for EL++ with concrete domains support
Apache License 2.0
22 stars 6 forks source link

Role Inclusions and Role Groups #6

Closed davetrig closed 8 years ago

davetrig commented 8 years ago

Hi again, I'm having an issue trying to model a role inclusion while implementing the implicit role group that was discussed in issue #4. I have an example that has a role locatedIn and a right identity role partOf:

        Concept root = Factory.createNamedConcept("ROOT");
        Concept heart = Factory.createNamedConcept("Heart");
        Concept heartValve = Factory.createNamedConcept("Heart-Valve");
        Concept heartDisease = Factory.createNamedConcept("Heart-Disease");
        Concept heartValveDisease = Factory.createNamedConcept("Heart-Valve-Disease");

        Role locatedIn = Factory.createNamedRole("located-in");
        Role partOf = Factory.createNamedRole("part-of");

        axioms.add(Factory.createRoleInclusion(new Role[]{locatedIn, partOf}, locatedIn));

        axioms.add(Factory.createConceptInclusion(heart, root));

        Concept c, conj;

        c = heartValve;
        conj = Factory.createConjunction(root, Factory.createExistential(partOf, heart));
        axioms.add(Factory.createConceptInclusion(c, conj));

        c = heartDisease;
        conj = Factory.createConjunction(root, Factory.createExistential(locatedIn, heart));
        axioms.add(Factory.createConceptInclusion(c, conj));
        axioms.add(Factory.createConceptInclusion(conj, c));

        c = heartValveDisease;
        conj = Factory.createConjunction(root, Factory.createExistential(locatedIn, heartValve));
        axioms.add(Factory.createConceptInclusion(c, conj));

As expected in this example, Heart Valve Disease is subsumed by Heart Disease. However, when I add the implicit role groups discussed in issue #4, it no longer works (code below). I can see how adding the role group would affect this, but how do I model the role inclusion and role group such that Heart Valve Disease gets subsumed by Heart Disease? Do I need to add axioms both with and without the implicit role group, or is there something else I'm missing?

Thanks, Dave

        Concept root = Factory.createNamedConcept("ROOT");
        Concept heart = Factory.createNamedConcept("Heart");
        Concept heartValve = Factory.createNamedConcept("Heart-Valve");
        Concept heartDisease = Factory.createNamedConcept("Heart-Disease");
        Concept heartValveDisease = Factory.createNamedConcept("Heart-Valve-Disease");

        Role locatedIn = Factory.createNamedRole("located-in");
        Role partOf = Factory.createNamedRole("part-of");
        Role roleGroup = Factory.createNamedRole("roleGroup");

        axioms.add(Factory.createRoleInclusion(new Role[]{locatedIn, partOf}, locatedIn));

        axioms.add(Factory.createConceptInclusion(heart, root));

        Concept c, conj;

        c = heartValve;
        conj = Factory.createConjunction(root, Factory.createExistential(roleGroup, Factory.createExistential(partOf, heart)));
        axioms.add(Factory.createConceptInclusion(c, conj));

        c = heartDisease;
        conj = Factory.createConjunction(root, Factory.createExistential(roleGroup, Factory.createExistential(locatedIn, heart)));
        axioms.add(Factory.createConceptInclusion(c, conj));
        axioms.add(Factory.createConceptInclusion(conj, c));

        c = heartValveDisease;
        conj = Factory.createConjunction(root, Factory.createExistential(roleGroup, Factory.createExistential(locatedIn, heartValve)));
        axioms.add(Factory.createConceptInclusion(c, conj));
ametke commented 8 years ago

Hi davetrig,

I think your problem is in the new role chain definition. You need to include the role group. Replacing the role chain definition with something like this should do it:

axioms.add(Factory.createRoleInclusion(new Role[]{locatedIn, roleGroup, partOf}, locatedIn));

Hope this works.

davetrig commented 8 years ago

That did the trick. I figured I had to get roleGroup in there somewhere, but just couldn't figure out where.

Thanks again for all your help!

ametke commented 8 years ago

Yes, that should work.

On Tue, Jun 14, 2016 at 12:46 PM, davetrig notifications@github.com wrote:

One more question: how would that work for subtyping of roles? For example, in SNOMED CT, there's:

Due to (attribute) ⊑ Associated with (attribute)

Without the roleGroup, it would be

Role dueTo = new NamedRole("Due to (attribute)"); Role assocWith = new NamedRole("Associated with (attribute)"); axioms.add(Factory.createRoleInclusion(new Role[]{dueTo}, assocWith);

Is it just a matter of adding the roleGroup to the chain, making it a composition? Like:

axioms.add(Factory.createRoleInclusion(new Role[]{dueTo, roleGroup}, assocWith);

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aehrc/snorocket/issues/6#issuecomment-225765740, or mute the thread https://github.com/notifications/unsubscribe/AAV3dKvZtIufRxPaXtJYu1NS4moDSHt1ks5qLhX5gaJpZM4I0cx0 .