Examples of OWLClassExpression


Examples of org.semanticweb.owlapi.model.OWLClassExpression

        return dataFactory.getOWLObjectComplementOf(operand);
    }

    private OWLClassExpression All() {
        OWLObjectProperty prop;
        OWLClassExpression filler;
        jj_consume_token(OPENPAR);
        jj_consume_token(ALL);
        prop = RoleName();
        filler = ConceptExpression();
        jj_consume_token(CLOSEPAR);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

        boolean foundRel2 = false;
        Set<OWLSubClassOfAxiom> axioms = owlOntology
                .getSubClassAxiomsForSubClass(c);
        assertEquals(3, axioms.size());
        for (OWLSubClassOfAxiom axiom : axioms) {
            OWLClassExpression superClass = axiom.getSuperClass();
            if (superClass instanceof OWLObjectExactCardinality) {
                OWLObjectExactCardinality cardinality = (OWLObjectExactCardinality) superClass;
                OWLClassExpression filler = cardinality.getFiller();
                assertFalse(filler.isAnonymous());
                IRI iri = filler.asOWLClass().getIRI();
                if (iri.equals(bridge.oboIdToIRI("PR:000005116"))) {
                    foundRel1 = true;
                    assertEquals(1, cardinality.getCardinality());
                } else if (iri.equals(bridge.oboIdToIRI("PR:000027122"))) {
                    foundRel2 = true;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

                    for (OWLSubClassOfAxiom ax : axioms) {
                        assert ax != null;
                        addChange(new RemoveAxiom(ont, ax));
                        superClasses.add(ax.getSuperClass());
                    }
                    OWLClassExpression combinedSuperClass = getDataFactory()
                            .getOWLObjectIntersectionOf(superClasses);
                    addChange(new AddAxiom(ont, getDataFactory()
                            .getOWLSubClassOfAxiom(cls, combinedSuperClass)));
                }
            }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

                assert ax != null;
                addChange(new RemoveAxiom(ont, ax));
                descs.add(ax.getSuperClass());
            }
        }
        OWLClassExpression equivalentClass = getDataFactory()
                .getOWLObjectIntersectionOf(descs);
        Set<OWLClassExpression> equivalentClasses = new HashSet<>();
        equivalentClasses.add(cls);
        equivalentClasses.add(equivalentClass);
        addChange(new AddAxiom(targetOntology, getDataFactory()
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

            classExpressions = new ArrayList<>(inputClassExpressions);
        }
        if (classExpressions.isEmpty()) {
            return;
        }
        OWLClassExpression desc = classExpressions.iterator().next();
        if (classExpressions.size() == 1) {
            write(desc);
            return;
        }
        classExpressions.remove(0);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

        }
        // 2) Make the values disjoint
        addChange(new AddAxiom(targetOntology, getDataFactory()
                .getOWLDisjointClassesAxiom(valuePartitionClasses)));
        // 3) Add a covering axiom to the value partition
        OWLClassExpression union = getDataFactory().getOWLObjectUnionOf(
                valuePartitionClasses);
        addChange(new AddAxiom(targetOntology, getDataFactory()
                .getOWLSubClassOfAxiom(valuePartitionClass, union)));
        // 4) Make the property functional
        addChange(new AddAxiom(targetOntology, getDataFactory()
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

        IRI isInferredIRI = IRI.create(Obo2OWLConstants.OIOVOCAB_IRI_PREFIX,
                "is_inferred");
        boolean hasAnnotation = false;
        Set<OWLSubClassOfAxiom> axioms = owl.getAxioms(AxiomType.SUBCLASS_OF);
        for (OWLSubClassOfAxiom axiom : axioms) {
            OWLClassExpression superClassCE = axiom.getSuperClass();
            OWLClassExpression subClassCE = axiom.getSubClass();
            if (!superClassCE.isAnonymous() && !subClassCE.isAnonymous()) {
                OWLClass superClass = (OWLClass) superClassCE;
                OWLClass subClass = (OWLClass) subClassCE;
                if (superClass.getIRI().equals(t1)
                        && subClass.getIRI().equals(t3)) {
                    Set<OWLAnnotation> annotations = axiom.getAnnotations();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

            // Do we have a range restriction imposed on our super property?
            for (OWLObjectPropertyRangeAxiom rngAx : rangeAxioms) {
                if (getPropertyManager().isSubPropertyOf(
                        axiom.getSuperProperty(), rngAx.getProperty())) {
                    // Imposed range restriction!
                    OWLClassExpression imposedRange = rngAx.getRange();
                    // There must be an axiom that imposes a range on the last
                    // prop in the chain
                    List<OWLObjectPropertyExpression> chain = axiom
                            .getPropertyChain();
                    if (!chain.isEmpty()) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

    /* Parser */
    @Nonnull
    @Override
    public OWLClassExpression parseClassExpression() {
        OWLClassExpression desc = parseUnion();
        if (!eof(consumeToken())) {
            throw new ExceptionBuilder().withKeyword(EOF).build();
        }
        return desc;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLClassExpression

     */
    private OWLClassExpression parseNonNaryClassExpression() {
        String tok = peekToken();
        if (NOT.matches(tok)) {
            consumeToken();
            OWLClassExpression complemented = parseNestedClassExpression(false);
            return dataFactory.getOWLObjectComplementOf(complemented);
        } else if (isObjectPropertyName(tok) || INVERSE.matches(tok)) {
            return parseObjectRestriction();
        } else if (isDataPropertyName(tok)) {
            // Data restriction
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.