Package au.csiro.ontology.model

Examples of au.csiro.ontology.model.Conjunction


                            mapRoles(conjs, rvs);
                        }
                    }

                    final ConceptInclusion axiom = new ConceptInclusion(
                            getConcept(c1, ci), new Conjunction(conjs));
                    statedAxioms.add(axiom);

                    if (primitive.get(c1).equals("0")) {
                        statedAxioms.add(new ConceptInclusion(new Conjunction(
                                conjs), getConcept(c1, ci)));
                    }
                }
            }
View Full Code Here


                    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);
View Full Code Here

                final List<Concept> concepts = new ArrayList<Concept>();
                concepts.add(value);
                for (String[] datatype : cdsMap.get(compId)) {
                    mapDatatype(concepts, datatype);
                }
                final Conjunction result = new Conjunction(concepts);
                if (log.isTraceEnabled()) {
                    log.trace("Mapping CD info: " + result.toString());
                }
                return result;
            } else {
                return value;
            }
View Full Code Here

            if (equalsOperatorId.equals(operatorId)) {
                Concept[] concepts = {
                        new Existential(getRole(unitRoleId, ri), getConcept(unitId, ci)),
                        new Datatype(feature, Operator.EQUALS, value), };

                conjs.add(new Existential(getRole(roleGroupId, ri), new Conjunction(concepts)));
            } else {
                log.error("Unknown operator: " + operatorId);
            }
        }
View Full Code Here

                                    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 {
                                    // Needs a role group
                                    conjs.add(new Existential(new NamedRole("RoleGroup"), exis));
                                }
                            }
                        }
                    }

                    axioms.add(new ConceptInclusion(new NamedConcept(c1), new Conjunction(conjs)));

                    if (primitive.get(c1).equals("0")) {
                        axioms.add(new ConceptInclusion(new Conjunction(conjs), new NamedConcept(c1)));
                    }
                }
            }
           
            Statistics.INSTANCE.setTime("rf1 loading", System.currentTimeMillis() - start);
View Full Code Here

            int i = 0;
            for (; i < concepts.size(); i++) {
                conjs[i] = concepts.get(i);
            }
   
            return new ConceptInclusion(new Conjunction(conjs), NamedConcept.BOTTOM_CONCEPT);
        } catch(UnsupportedOperationException e) {
            problems.add(e.getMessage());
            return null;
        }
    }
View Full Code Here

                   
                    // Create conjunctions with all restrictions
                    if(conjuncts.size() == 1) {
                        push(conjuncts.get(0));
                    } else if(!conjuncts.isEmpty()){
                        push(new Conjunction(conjuncts));
                    }
                } else {
                    throw new RuntimeException("Unsupporter OWLDataRange: "+
                            range.getClass().getName());
                }
            }

            public void visit(OWLObjectOneOf e) {
                // TODO: implement to support EL profile
                unimplemented(e);
            }

            public void visit(OWLObjectHasSelf e) {
                // TODO: implement to support EL profile
               
                // There is no model object to support this.
               
                /*
                 * A self-restriction ObjectHasSelf( OPE ) consists of an object
                 * property expression OPE, and it contains all those
                 * individuals that are connected by OPE to themselves.
                 */
               
                /*Role r = new Role<>(e.getProperty().asOWLObjectProperty().toStringID());*/

                unimplemented(e);
            }

            public void visit(OWLObjectMaxCardinality e) {
                unimplemented(e);
            }

            public void visit(OWLObjectExactCardinality e) {
                unimplemented(e);
            }

            public void visit(OWLObjectMinCardinality e) {
                unimplemented(e);
            }

            public void visit(OWLObjectHasValue e) {
                // TODO: implement to support EL profile
               
                // We do not support individuals
                unimplemented(e);
            }

            public void visit(OWLObjectAllValuesFrom e) {
                unimplemented(e);
            }

            public void visit(OWLObjectSomeValuesFrom e) {
                NamedRole r = new NamedRole(e.getProperty().asOWLObjectProperty().toStringID());
                e.getFiller().accept(this);
                try {
                    push(new Existential(r, pop()));
                } catch(EmptyStackException ex) {
                    problems.add("Unable to add axiom " + e + " because of previous problems.");
                }
            }

            public void visit(OWLObjectComplementOf e) {
                unimplemented(e);
            }

            public void visit(OWLObjectUnionOf e) {
                unimplemented(e);
            }

            public void visit(OWLObjectIntersectionOf e) {
                List<Concept> items = new ArrayList<Concept>();
               
                for (OWLClassExpression desc : e.getOperands()) {
                    desc.accept(this);
                    try {
                        items.add(pop());
                    } catch(EmptyStackException ex) {
                        problems.add("Unable to add conjunct " + desc + " because of previous problems.");
                    }
                }
               
                if(!items.isEmpty()) {
                    Conjunction conj = new Conjunction(items);
                    push(conj);
                }
            }

            public void visit(OWLClass e) {
View Full Code Here

                            mapRoles(conjs, rvs);
                        }
                    }

                    final ConceptInclusion axiom = new ConceptInclusion(
                            getConcept(c1, ci), new Conjunction(conjs));
                    statedAxioms.add(axiom);

                    if (primitive.get(c1).equals("0")) {
                        statedAxioms.add(new ConceptInclusion(new Conjunction(
                                conjs), getConcept(c1, ci)));
                    }
                }
            }
View Full Code Here

                    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);
View Full Code Here

                final List<Concept> concepts = new ArrayList<Concept>();
                concepts.add(value);
                for (String[] datatype : cdsMap.get(compId)) {
                    mapDatatype(concepts, datatype);
                }
                final Conjunction result = new Conjunction(concepts);
                if (log.isTraceEnabled()) {
                    log.trace("Mapping CD info: " + result.toString());
                }
                return result;
            } else {
                return value;
            }
View Full Code Here

TOP

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

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.