Package au.csiro.ontology.model

Examples of au.csiro.ontology.model.RoleInclusion


                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
            log.info("Creating axioms for " + primitive.size() + " active concepts");
View Full Code Here


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

                if (!"".equals(parentRole)) {
                    axioms.add(new RoleInclusion(new NamedRole(r1), new NamedRole(parentRole)));
                }

                String rightId = roles.get(r1).get("rightID");
                if (!"".equals(rightId)) {
                    axioms.add(new RoleInclusion(new Role[] { new NamedRole(r1), new NamedRole(rightId) },
                            new NamedRole(r1)));
                }
            }

            // Add concept axioms
View Full Code Here

        }

        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.");
            return null;
        }
    }
View Full Code Here

        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[]{lhs}, rhs);
    }

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

    }

    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

        for (OWLSubObjectPropertyOfAxiom ax : a.asSubObjectPropertyOfAxioms()) {
            OWLObjectPropertyExpression sub = ax.getSubProperty();
            OWLObjectPropertyExpression sup = ax.getSuperProperty();

            axioms.add(
                    new RoleInclusion(new NamedRole(sub.asOWLObjectProperty().toStringID()),
                    new NamedRole(sup.asOWLObjectProperty().toStringID()))
            );
        }
        return axioms;
    }
View Full Code Here

                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
            log.info("Creating axioms for " + primitive.size() + " active concepts");
View Full Code Here

                ConceptInclusion ci = (ConceptInclusion)aa;
                Concept lhs = ci.getLhs();
                Concept rhs = ci.getRhs();
                res.add(new GCI(transformConcept(lhs), transformConcept(rhs)));
            } else if(aa instanceof RoleInclusion) {
                RoleInclusion ri = (RoleInclusion)aa;
                Role[] lh = ri.getLhs();
                NamedRole[] lhs = new NamedRole[lh.length];
                for(int i = 0; i < lh.length; i++) {
                    lhs[i] = (NamedRole) lh[i];
                }
                NamedRole rhs = (NamedRole) ri.getRhs();
                int[] lhsInt = new int[lhs.length];
                for(int i = 0; i < lhsInt.length; i++) {
                    lhsInt[i] = factory.getRole(lhs[i].getId());
                }
                res.add(new RI(lhsInt, factory.getRole(rhs.getId())));
View Full Code Here

            NF4 nf4 = it.next();
            int r = nf4.getR();
            int s = nf4.getS();
           
            res.add(
                new RoleInclusion(
                    new NamedRole(factory.lookupRoleId(r).toString()),
                    new NamedRole(factory.lookupRoleId(s).toString())
                )
            );
        }
       
        for(Iterator<NF5> it = ontologyNF5.iterator(); it.hasNext(); ) {
            NF5 nf5 = it.next();
            int r = nf5.getR();
            int s = nf5.getS();
            int t = nf5.getT();
           
            res.add(
                new RoleInclusion(
                    new Role[] {
                            new NamedRole(factory.lookupRoleId(r).toString()),
                            new NamedRole(factory.lookupRoleId(s).toString())
                    },
                    new NamedRole(factory.lookupRoleId(t).toString())
                )
            );
        }
       
        for(IntIterator it = reflexiveRoles.iterator(); it.hasNext(); ) {
            int r = it.next();
            res.add(
                new RoleInclusion(
                    new Role[] {},
                    new NamedRole(factory.lookupRoleId(r).toString())
                )
            );
        }
View Full Code Here

TOP

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

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.