Package au.csiro.ontology.model

Examples of au.csiro.ontology.model.Concept


            }
        }
    }

    protected Concept getConcept(String id, Map<String, Concept> ci) {
        Concept c = ci.get(id);
        if (c == null) {
            c = new NamedConcept(id);
            ci.put(id, c);
        }
        return c;
View Full Code Here


                }

                if (numElems == 0) {
                    // do nothing
                } else if (numElems == 1 && numParents == 1) {
                    Concept lhs = getConcept(c1, ci);
                    Concept rhs = getConcept(prs.iterator().next(), ci);
                    statedAxioms.add(new ConceptInclusion(lhs, rhs));
                } else {
                    List<Concept> conjs = new ArrayList<Concept>();

                    // Add parents
View Full Code Here

            if (rvs.size() > 1) {
                Concept[] innerConjs = new Concept[rvs.size()];
                int j = 0;
                for (RoleValuePair rv : rvs) {
                    NamedRole role = getRole(rv.role, ri);
                    Concept filler = resolveFiller(getConcept(rv.value, ci), rv.id);
                    Existential exis = new Existential(role, filler);
                    innerConjs[j++] = exis;
                }
                // Wrap with a role group
                conjs.add(new Existential(getRole(roleGroupId, ri), new Conjunction(innerConjs)));
            } else {
                RoleValuePair first = rvs.iterator().next();
                NamedRole role = getRole(first.role, ri);
                Concept filler = resolveFiller(getConcept(first.value, ci), first.id);
                Existential exis = new Existential(role, filler);
                if (neverGroupedIds.contains(first.role)) {
                    // Does not need a role group
                    conjs.add(exis);
                } else {
View Full Code Here

                        for (Set<RoleValuePair> rvs : groupRoles(relsVal)) {
                            if (rvs.size() > 1) {
                                List<Concept> innerConjs = new ArrayList<Concept>();
                                for (RoleValuePair rv : rvs) {
                                    NamedRole role = new NamedRole(rv.role);
                                    Concept filler = new NamedConcept(rv.value);
                                    Existential exis = new Existential(role, filler);
                                    innerConjs.add(exis);
                                }
                                // Wrap with a role group
                                conjs.add(new Existential(new NamedRole("RoleGroup"), new Conjunction(innerConjs)));
                            } else {
                                RoleValuePair first = rvs.iterator().next();
                                NamedRole role = new NamedRole(first.role);
                                Concept filler = new NamedConcept(first.value);
                                Existential exis = new Existential(role, filler);
                                if (metadata.getNeverGroupedIds().contains(first.role)) {
                                    // Does not need a role group
                                    conjs.add(exis);
                                } else {
View Full Code Here

    private Axiom transformOWLSubClassOfAxiom(OWLSubClassOfAxiom a) {
        OWLClassExpression sub = a.getSubClass();
        OWLClassExpression sup = a.getSuperClass();
       
        try {
            Concept subConcept = getConcept(sub);
            Concept superConcept = getConcept(sup);
            return new ConceptInclusion(subConcept, superConcept);
        } catch(UnsupportedOperationException e) {
            problems.add(e.getMessage());
            return null;
        }
View Full Code Here

        int size = exps.size();

        for (int i = 0; i < size - 1; i++) {
            try {
                OWLClassExpression e1 = exps.get(i);
                Concept concept1 = getConcept(e1);
                for (int j = i; j < size; j++) {
                    OWLClassExpression e2 = exps.get(j);
                    if (e1 == e2)
                        continue;
                    Concept concept2 = getConcept(e2);
                    axioms.add(new ConceptInclusion(concept1, concept2));
                    axioms.add(new ConceptInclusion(concept2, concept1));
                }
            } catch(UnsupportedOperationException e) {
                problems.add(e.getMessage());
View Full Code Here

            }
        }
    }

    protected Concept getConcept(String id, Map<String, Concept> ci) {
        Concept c = ci.get(id);
        if (c == null) {
            c = new NamedConcept(id);
            ci.put(id, c);
        }
        return c;
View Full Code Here

                }

                if (numElems == 0) {
                    // do nothing
                } else if (numElems == 1 && numParents == 1) {
                    Concept lhs = getConcept(c1, ci);
                    Concept rhs = getConcept(prs.iterator().next(), ci);
                    statedAxioms.add(new ConceptInclusion(lhs, rhs));
                } else {
                    List<Concept> conjs = new ArrayList<Concept>();

                    // Add parents
View Full Code Here

            if (rvs.size() > 1) {
                Concept[] innerConjs = new Concept[rvs.size()];
                int j = 0;
                for (RoleValuePair rv : rvs) {
                    NamedRole role = getRole(rv.role, ri);
                    Concept filler = resolveFiller(getConcept(rv.value, ci), rv.id);
                    Existential exis = new Existential(role, filler);
                    innerConjs[j++] = exis;
                }
                // Wrap with a role group
                conjs.add(new Existential(getRole(roleGroupId, ri), new Conjunction(innerConjs)));
            } else {
                RoleValuePair first = rvs.iterator().next();
                NamedRole role = getRole(first.role, ri);
                Concept filler = resolveFiller(getConcept(first.value, ci), first.id);
                Existential exis = new Existential(role, filler);
                if (neverGroupedIds.contains(first.role)) {
                    // Does not need a role group
                    conjs.add(exis);
                } else {
View Full Code Here

            }
            return new Conjunction(conjs.toArray(new Concept[conjs.size()]));
        } else if(obj instanceof au.csiro.snorocket.core.model.Existential) {
            au.csiro.snorocket.core.model.Existential ex = (au.csiro.snorocket.core.model.Existential) obj;
            String roleId = (String) factory.lookupRoleId(ex.getRole());
            Concept con = transformToModel(ex.getConcept());
            return new Existential(new NamedRole(roleId), con);
        } else if(obj instanceof au.csiro.snorocket.core.model.Datatype) {
            au.csiro.snorocket.core.model.Datatype dt = (au.csiro.snorocket.core.model.Datatype) obj;
            String featureId = factory.lookupFeatureId(dt.getFeature());
            Literal l = transformLiteralToModel(dt.getLiteral());
View Full Code Here

TOP

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

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.