Package au.csiro.snorocket.core.model

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


     */
    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

        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

                }
                // TODO remove
               
                // The problem is likely to be in this method call!
                if(!containsExistentialInNF3s(nf2.rhsR, nf2.rhsB, nf2.lhsA)) {
                    NF3 nnf = NF3.getInstance(nf2.rhsR, nf2.rhsB, factory.getConcept(new Existential(nf2.rhsR,
                            new au.csiro.snorocket.core.model.Concept(nf2.rhsB))));
                    //as.addAxiom(nnf); // Needed for incremental
                    addTerm(nnf);
                    numNf3++;
                   
View Full Code Here

            au.csiro.ontology.model.Datatype dt = (au.csiro.ontology.model.Datatype) c;
            return new Datatype(factory.getFeature(((NamedFeature) dt.getFeature()).getId()), dt.getOperator(),
                    transformLiteral(dt.getLiteral()));
        } else if(c instanceof au.csiro.ontology.model.Existential) {
            au.csiro.ontology.model.Existential e = (au.csiro.ontology.model.Existential) c;
            return new Existential(factory.getRole(((NamedRole) e.getRole()).getId()),
                    transformConcept(e.getConcept()));
        } else {
            throw new RuntimeException("Unexpected AbstractConcept "+c.getClass().getName());
        }
    }
View Full Code Here

                sb.append(" + ");
                sb.append(printInternalObject(cons[i]));
            }
            return sb.toString();
        } else if(o instanceof Existential) {
            Existential e = (Existential)o;
            AbstractConcept c = e.getConcept();
            int role = e.getRole();
            return factory.lookupRoleId(role)+"."+printInternalObject(c);
        } else if(o instanceof Datatype) {
            StringBuilder sb = new StringBuilder();
            Datatype d = (Datatype)o;
            String feature = factory.lookupFeatureId(d.getFeature());
View Full Code Here

            for(AbstractConcept ac : con.getConcepts()) {
                concepts.add(transform(ac));
            }
            return new au.csiro.ontology.model.Conjunction(concepts);
        } else if(o instanceof Existential) {
            Existential e = (Existential)o;
            AbstractConcept c = e.getConcept();
            Concept iconcept = transform(c);
            int role = e.getRole();
            NamedRole irole = new NamedRole(factory.lookupRoleId(role).toString());
            return new au.csiro.ontology.model.Existential(irole, iconcept);
        } else if(o instanceof Datatype) {
            Datatype d = (Datatype) o;
            String feature = factory.lookupFeatureId(d.getFeature());
View Full Code Here

                }
                // TODO remove
               
                // The problem is likely to be in this method call!
                if(!containsExistentialInNF3s(nf2.rhsR, nf2.rhsB, nf2.lhsA)) {
                    NF3 nnf = NF3.getInstance(nf2.rhsR, nf2.rhsB, factory.getConcept(new Existential(nf2.rhsR,
                            new au.csiro.snorocket.core.model.Concept(nf2.rhsB))));
                    //as.addAxiom(nnf); // Needed for incremental
                    addTerm(nnf);
                    numNf3++;
                   
View Full Code Here

            au.csiro.ontology.model.Datatype dt = (au.csiro.ontology.model.Datatype) c;
            return new Datatype(factory.getFeature(((NamedFeature) dt.getFeature()).getId()), dt.getOperator(),
                    transformLiteral(dt.getLiteral()));
        } else if(c instanceof au.csiro.ontology.model.Existential) {
            au.csiro.ontology.model.Existential e = (au.csiro.ontology.model.Existential) c;
            return new Existential(factory.getRole(((NamedRole) e.getRole()).getId()),
                    transformConcept(e.getConcept()));
        } else {
            throw new RuntimeException("Unexpected AbstractConcept "+c.getClass().getName());
        }
    }
View Full Code Here

                sb.append(" + ");
                sb.append(printInternalObject(cons[i]));
            }
            return sb.toString();
        } else if(o instanceof Existential) {
            Existential e = (Existential)o;
            AbstractConcept c = e.getConcept();
            int role = e.getRole();
            return factory.lookupRoleId(role)+"."+printInternalObject(c);
        } else if(o instanceof Datatype) {
            StringBuilder sb = new StringBuilder();
            Datatype d = (Datatype)o;
            String feature = factory.lookupFeatureId(d.getFeature());
View Full Code Here

TOP

Related Classes of au.csiro.snorocket.core.model.Existential

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.