Examples of Existential


Examples of au.csiro.ontology.model.Existential

        private Collection<Existential> get() {
            return items;
        }

        private void doAdd(NamedRole role, Concept concept) {
            items.add(new Existential(role, concept));
        }
View Full Code Here

Examples of au.csiro.ontology.model.Existential

    public static Concept createConjunction(Concept... concepts) {
        return new Conjunction(concepts);
    }

    public static Concept createExistential(Role role, Concept filler) {
        return new Existential(role, filler);
    }
View Full Code Here

Examples of au.csiro.ontology.model.Existential

            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());
            return new Datatype(new NamedFeature(featureId), dt.getOperator(), l);
View Full Code Here

Examples of au.csiro.ontology.model.Existential

            IConceptSet values = getLeaves(succ.lookupConcept(roleId));
            for (IntIterator itr2 = values.iterator(); itr2.hasNext(); ) {
                int valueInt = itr2.next();
                if (!factory.isVirtualConcept(valueInt)) {
                    final String valueId = factory.lookupConceptId(valueInt).toString();
                    result.add(new Existential(role, new NamedConcept(valueId)));
                } else {
                    final Concept valueConcept = getNecessary(contextIndex, taxonomy, valueInt);
                    final Existential x = new Existential(role, Builder.build(no, valueConcept));
                    result.add(x);
                }
            }
        }
View Full Code Here

Examples of au.csiro.ontology.model.Existential

            final List<Concept> list = new ArrayList<Concept>();
            final Builder b = new Builder(no);

            for (final Concept member: concepts) {
                if (member instanceof Existential) {
                    final Existential existential = (Existential) member;

                    b.build((NamedRole) existential.getRole(), build(no, existential.getConcept()));
                } else {
                    list.add(buildOne(no, member));
                }
            }
View Full Code Here

Examples of au.csiro.ontology.model.Existential

            }
        }

        private static Concept buildOne(NormalisedOntology no, Concept concept) {
            if (concept instanceof Existential) {
                final Existential existential = (Existential) concept;

                return new Existential(existential.getRole(), buildOne(no, existential.getConcept()));
            } else if (concept instanceof Conjunction) {
                return build(no, ((Conjunction) concept).getConcepts());
            } else if (concept instanceof NamedConcept) {
                return concept;
            } else if (concept instanceof Datatype) {
View Full Code Here

Examples of au.csiro.ontology.model.Existential

        private Collection<Existential> get() {
            return items;
        }

        private void doAdd(NamedRole role, Concept concept) {
            items.add(new Existential(role, concept));
        }
View Full Code Here

Examples of au.csiro.snorocket.core.model.Existential

     */
    boolean rule3(final IFactory factory, final Inclusion[] gcis) {
        boolean result = false;

        if (lhs instanceof Existential) {
            Existential existential = (Existential) lhs;
            final AbstractConcept cHat = existential.getConcept();
            if (!(cHat instanceof Concept)) {
                result = true;
                Concept a = getA(factory, cHat);
                gcis[0] = new GCI(cHat, a);
                gcis[1] = new GCI(new Existential(existential.getRole(), a),
                        rhs);
            }
        }

        return result;
View Full Code Here

Examples of au.csiro.snorocket.core.model.Existential

     */
    boolean rule6(final IFactory factory, final Inclusion[] gcis) {
        boolean result = false;

        if (rhs instanceof Existential) {
            Existential existential = (Existential) rhs;
            final AbstractConcept cHat = existential.getConcept();
            if (!(cHat instanceof Concept)) {
                result = true;
                Concept a = getA(factory, cHat);
                gcis[0] = new GCI(lhs,
                        new Existential(existential.getRole(), a));
                gcis[1] = new GCI(a, cHat);
            }
        }

        return result;
View Full Code Here

Examples of au.csiro.snorocket.core.model.Existential

        if (lhs instanceof Concept) {
            if (rhs instanceof Concept) {
                final int newLhs = lhs.hashCode();
                result = NF1a.getInstance(newLhs, rhs.hashCode());
            } else if (rhs instanceof Existential) {
                final Existential existential = (Existential) rhs;
                result = NF2.getInstance(lhs.hashCode(), existential.getRole(),
                        existential.getConcept().hashCode());
            } else if (rhs instanceof Datatype) {
                final Datatype datatype = (Datatype) rhs;
                result = NF7.getInstance(lhs.hashCode(), datatype);
            } else {
                throw new IllegalStateException("GCI is not in Normal Form: " +
                    "lhs is Concept but rhs is neither Concept, " +
                    "Existential nor Datatype; it is " + rhs);
            }
        } else if (lhs instanceof Conjunction) {
            final Conjunction conjunction = (Conjunction) lhs;
            final AbstractConcept[] concepts = conjunction.getConcepts();
            if (concepts.length == 1) {
                result = NF1a.getInstance(concepts[0].hashCode(),
                        rhs.hashCode());
            } else if (concepts.length == 2) {
                result = NF1b.getInstance(concepts[0].hashCode(),
                        concepts[1].hashCode(), rhs.hashCode());
            } else {
                throw new IllegalStateException(
                        "Conjunction should have exactly one or two "
                                + "Concepts not " + concepts.length + ": "
                                + conjunction);
            }
        } else if (lhs instanceof Existential) {
            Existential existential = (Existential) lhs;
            result = NF3.getInstance(existential.getRole(), existential
                    .getConcept().hashCode(), rhs.hashCode());
        } else if (lhs instanceof Datatype) {
            Datatype datatype = (Datatype) lhs;
            result = NF8.getInstance(datatype, rhs.hashCode());
        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.