Package au.csiro.ontology.model

Examples of au.csiro.ontology.model.Role


            // Add role axioms
            for (String r1 : roles.keySet()) {
                String parentRole = roles.get(r1).get("parentrole");

                if (!"".equals(parentRole)) {
                    Role lhs = getRole(r1, ri);
                    Role rhs = getRole(parentRole, ri);
                    statedAxioms.add(new RoleInclusion(new Role[] { lhs }, rhs));
                }

                String rightId = roles.get(r1).get("rightID");
                if (!"".equals(rightId)) {
                    Role lhs1 = getRole(r1, ri);
                    Role lhs2 = getRole(rightId, ri);
                    statedAxioms.add(new RoleInclusion(new Role[] { lhs1, lhs2 }, lhs1));
                }
            }

            // Add concept axioms
View Full Code Here


        Role[] lhss = new Role[size];
        for (int i = 0; i < size; i++) {
            lhss[i] = new NamedRole(sub.get(i).asOWLObjectProperty().toStringID());
        }

        Role rhs = new NamedRole(sup.asOWLObjectProperty().toStringID());

        if (lhss.length == 1 || lhss.length == 2) {
            return new RoleInclusion(lhss, rhs);
        } else {
            problems.add("Unable to import axiom "+a.toString()+". RoleChains longer than 2 not supported.");
View Full Code Here

    private Axiom transformOWLSubObjectPropertyOfAxiom(OWLSubObjectPropertyOfAxiom a) {
        OWLObjectPropertyExpression sub = a.getSubProperty();
        OWLObjectPropertyExpression sup = a.getSuperProperty();

        Role lhs = new NamedRole(sub.asOWLObjectProperty().toStringID());
        Role rhs = new NamedRole(sup.asOWLObjectProperty().toStringID());

        return new RoleInclusion(new Role[]{lhs}, rhs);
    }
View Full Code Here

        return new RoleInclusion(new Role[] {}, new NamedRole(exp.asOWLObjectProperty().toStringID()));
    }

    private Axiom transformOWLTransitiveObjectPropertyAxiom(OWLTransitiveObjectPropertyAxiom a) {
        OWLObjectPropertyExpression exp = a.getProperty();
        Role r = new NamedRole(exp.asOWLObjectProperty().toStringID());
        return new RoleInclusion(new Role[] { r, r }, r);
    }
View Full Code Here

            // Add role axioms
            for (String r1 : roles.keySet()) {
                String parentRole = roles.get(r1).get("parentrole");

                if (!"".equals(parentRole)) {
                    Role lhs = getRole(r1, ri);
                    Role rhs = getRole(parentRole, ri);
                    statedAxioms.add(new RoleInclusion(new Role[] { lhs }, rhs));
                }

                String rightId = roles.get(r1).get("rightID");
                if (!"".equals(rightId)) {
                    Role lhs1 = getRole(r1, ri);
                    Role lhs2 = getRole(rightId, ri);
                    statedAxioms.add(new RoleInclusion(new Role[] { lhs1, lhs2 }, lhs1));
                }
            }

            // Add concept axioms
View Full Code Here

        Concept disease = f.createNamedConcept("Disease");
        Concept heartDisease = f.createNamedConcept("HeartDisease");
        Concept criticalDisease = f.createNamedConcept("CriticalDisease");
       
        // The factory can also be used to create roles
        Role actsOn = f.createNamedRole("acts-on");
        Role partOf = f.createNamedRole("part-of");
        Role contIn = f.createNamedRole("cont-in");
        Role hasLoc = f.createNamedRole("has-loc");
       
        // Finally, the factory can be used to create axioms
        Concept lhs = endocardium;
        Concept rhs = f.createConjunction(
                tissue,
                f.createExistential((NamedRole) contIn, heartWall),
                f.createExistential((NamedRole) contIn, heartValve)
        );
        baseAxioms.add(f.createConceptInclusion(lhs, rhs));
       
        lhs = heartWall;
        rhs = f.createConjunction(
                bodyWall,
                f.createExistential((NamedRole) partOf, heart)
        );
        baseAxioms.add(f.createConceptInclusion(lhs, rhs));
       
        lhs = heartValve;
        rhs = f.createConjunction(
                bodyValve,
                f.createExistential((NamedRole) partOf, heart)
        );
        baseAxioms.add(f.createConceptInclusion(lhs, rhs));
       
        lhs = endocarditis;
        rhs = f.createConjunction(
                inflammation,
                f.createExistential((NamedRole) hasLoc, endocardium)
        );
        baseAxioms.add(f.createConceptInclusion(lhs, rhs));

        lhs = inflammation;
        rhs = f.createConjunction(
                disease,
                f.createExistential(actsOn, tissue)
        );
        baseAxioms.add(f.createConceptInclusion(lhs, rhs));
       
        lhs = f.createConjunction(
                heartDisease,
                f.createExistential(hasLoc, heartValve)
        );
        rhs = criticalDisease;
        baseAxioms.add(f.createConceptInclusion(lhs, rhs));
       
        // There is no direct support in the API to create an equivalence axiom
        // so it has to be created using two concept inclusion axioms
        lhs = heartDisease;
        rhs = f.createConjunction(
                disease,
                f.createExistential(hasLoc, heart)
        );
        baseAxioms.add(f.createConceptInclusion(lhs, rhs));
        baseAxioms.add(f.createConceptInclusion(rhs, lhs));
       
        Role[] rlhs = new Role[]{partOf, partOf};
        Role rrhs = partOf;
        baseAxioms.add(f.createRoleInclusion(rlhs, rrhs));
       
        rlhs = new Role[]{partOf};
        rrhs = contIn;
        baseAxioms.add(f.createRoleInclusion(rlhs, rrhs));
View Full Code Here

        Concept duringExcersice = f.createNamedConcept("309604004");
        Concept interview = f.createNamedConcept("108217004");
        Concept present = f.createNamedConcept("52101004");
       
        // The factory can also be used to create roles
        Role associatedWith = f.createNamedRole("47429007");
       
        // We need to define exactly what the identifier for the new concept
        // will be
        Concept historyCardioStandardNonAnginalChestPainExertion = f.createNamedConcept("pce_24220");
       
View Full Code Here

        Concept tallBottle = f.createNamedConcept("tallBottle");
        Concept wideBottle = f.createNamedConcept("wideBottle");
        Concept wineBottle = f.createNamedConcept("wineBottle");
       
        // Create all the roles
        Role isMadeOf = f.createNamedRole("isMadeOf");
       
        // Create all the features
        Feature hasHeight = f.createNamedFeature("hasHeight");
        Feature hasWidth = f.createNamedFeature("hasWidth");
       
View Full Code Here

TOP

Related Classes of au.csiro.ontology.model.Role

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.