Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLObjectMaxCardinality


                    OWLObjectMinCardinality card = (OWLObjectMinCardinality) ce;
                    r = getIdentifier(card.getProperty());
                    cls2 = getIdentifier(card.getFiller());
                    min = card.getCardinality();
                } else if (ce instanceof OWLObjectMaxCardinality) {
                    OWLObjectMaxCardinality card = (OWLObjectMaxCardinality) ce;
                    r = getIdentifier(card.getProperty());
                    cls2 = getIdentifier(card.getFiller());
                    max = card.getCardinality();
                } else if (ce instanceof OWLObjectAllValuesFrom) {
                    OWLObjectAllValuesFrom all = (OWLObjectAllValuesFrom) ce;
                    OWLClassExpression filler = all.getFiller();
                    if (filler instanceof OWLClass) {
                        r = getIdentifier(all.getProperty());
                        cls2 = getIdentifier(filler);
                        allOnly = Boolean.TRUE;
                    } else if (filler instanceof OWLObjectComplementOf) {
                        OWLObjectComplementOf restriction = (OWLObjectComplementOf) filler;
                        r = getIdentifier(all.getProperty());
                        cls2 = getIdentifier(restriction.getOperand());
                        exact = 0;
                    }
                } else if (ce instanceof OWLObjectIntersectionOf) {
                    // either a min-max or a some-all combination
                    Set<OWLClassExpression> operands = ((OWLObjectIntersectionOf) ce)
                            .getOperands();
                    if (operands.size() == 2) {
                        for (OWLClassExpression operand : operands) {
                            if (operand instanceof OWLObjectMinCardinality) {
                                OWLObjectMinCardinality card = (OWLObjectMinCardinality) operand;
                                r = getIdentifier(card.getProperty());
                                cls2 = getIdentifier(card.getFiller());
                                min = card.getCardinality();
                            } else if (operand instanceof OWLObjectMaxCardinality) {
                                OWLObjectMaxCardinality card = (OWLObjectMaxCardinality) operand;
                                r = getIdentifier(card.getProperty());
                                cls2 = getIdentifier(card.getFiller());
                                max = card.getCardinality();
                            } else if (operand instanceof OWLObjectAllValuesFrom) {
                                OWLObjectAllValuesFrom all = (OWLObjectAllValuesFrom) operand;
                                r = getIdentifier(all.getProperty());
                                cls2 = getIdentifier(all.getFiller());
                                allOnly = Boolean.TRUE;
View Full Code Here


    }

    @Test
    public void shouldBuildObjectMaxCardinality() {
        // given
        OWLObjectMaxCardinality expected = df.getOWLObjectMaxCardinality(1, op,
                ce);
        BuilderObjectMaxCardinality builder = new BuilderObjectMaxCardinality(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
View Full Code Here

                    OWLObjectAllValuesFrom restriction = (OWLObjectAllValuesFrom) rhs;
                    return factory.getOWLObjectPropertyRangeAxiom(
                            restriction.getProperty(), restriction.getFiller());
                }
                if (rhs instanceof OWLObjectMaxCardinality) {
                    OWLObjectMaxCardinality restriction = (OWLObjectMaxCardinality) rhs;
                    if (restriction.getCardinality() == 1
                            && restriction.getFiller().isOWLThing()) {
                        return factory
                                .getOWLFunctionalObjectPropertyAxiom(restriction
                                        .getProperty());
                    }
                }
            } else if (lhs instanceof OWLObjectSomeValuesFrom) {
                OWLObjectSomeValuesFrom restriction = (OWLObjectSomeValuesFrom) lhs;
                if (restriction.getFiller().isOWLThing()) {
                    return factory.getOWLObjectPropertyDomainAxiom(
                            restriction.getProperty(), rhs);
                }
            }
            if (rhs instanceof OWLObjectComplementOf && !rhs.isAnonymous()) {
                return factory.getOWLDisjointClassesAxiom(lhs,
                        ((OWLObjectComplementOf) rhs).getOperand());
View Full Code Here

                return m_factory.getOWLObjectAllValuesFrom(d.getProperty().getSimplified(),m_factory.getOWLObjectComplementOf(filler));
            else if (filler.isOWLNothing())
                return m_factory.getOWLNothing();
            else {
                OWLObjectMinCardinality minCardinality=m_factory.getOWLObjectMinCardinality(d.getCardinality(),d.getProperty().getSimplified(),filler);
                OWLObjectMaxCardinality maxCardinality=m_factory.getOWLObjectMaxCardinality(d.getCardinality(),d.getProperty().getSimplified(),filler);
                return m_factory.getOWLObjectIntersectionOf(minCardinality,maxCardinality);
            }
        }
View Full Code Here

                            // Interpret as Range
                            OWLObjectAllValuesFrom restriction = (OWLObjectAllValuesFrom) rhs;
                            {if (true) return factory.getOWLObjectPropertyRangeAxiom(restriction.getProperty(), restriction.getFiller());}
                        }
                        if(rhs instanceof OWLObjectMaxCardinality) {
                            OWLObjectMaxCardinality restriction = (OWLObjectMaxCardinality) rhs;
                            if(restriction.getCardinality() == 1 && restriction.getFiller().isOWLThing()) {
                                {if (true) return factory.getOWLFunctionalObjectPropertyAxiom(restriction.getProperty());}
                            }
                        }
                    }
                    else if(lhs instanceof OWLObjectSomeValuesFrom) {
                        OWLObjectSomeValuesFrom restriction = (OWLObjectSomeValuesFrom) lhs;
                        if(restriction.getFiller().isOWLThing()) {
                            {if (true) return factory.getOWLObjectPropertyDomainAxiom(restriction.getProperty(), rhs);}
                        }
                    }
                    if(rhs instanceof OWLObjectComplementOf && !rhs.isAnonymous()) {
                        {if (true) return factory.getOWLDisjointClassesAxiom(lhs, ((OWLObjectComplementOf) rhs).getOperand());}
                    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLObjectMaxCardinality

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.