Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLHasKeyAxiom


    }

    @Test
    public void shouldBuildHasKey() {
        // given
        OWLHasKeyAxiom expected = df.getOWLHasKeyAxiom(ce, ops, annotations);
        BuilderHasKey builder = new BuilderHasKey(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
View Full Code Here


    public void testCorrectAxioms() {
        OWLClass cls = Class(IRI("http://example.com/Person"));
        OWLDataProperty propP = DataProperty(IRI("http://example.com/dataProperty"));
        OWLObjectProperty propQ = ObjectProperty(IRI("http://example.com/objectPoperty"));
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLHasKeyAxiom owlHasKeyAxiom = HasKey(cls, propQ, propP);
        axioms.add(owlHasKeyAxiom);
        Set<OWLAxiom> axioms2 = getOnt().getAxioms();
        assertTrue(axioms2.containsAll(axioms));
    }
View Full Code Here

        annos.add(anno);
        OWLClassExpression ce = Class(iri("A"));
        OWLObjectProperty p1 = ObjectProperty(iri("p1"));
        OWLObjectProperty p2 = ObjectProperty(iri("p2"));
        OWLObjectProperty p3 = ObjectProperty(iri("p3"));
        OWLHasKeyAxiom ax = HasKey(annos, ce, p1, p2, p3);
        Set<OWLAxiom> axs = new HashSet<>();
        axs.add(ax);
        axs.add(Declaration(ap));
        axs.add(Declaration(p1));
        axs.add(Declaration(p2));
View Full Code Here

        return props;
    }

    @Override
  protected int compareObjectOfSameType(OWLObject object) {
        OWLHasKeyAxiom other = (OWLHasKeyAxiom) object;
        int diff = expression.compareTo(other.getClassExpression());
        if (diff != 0) {
            return diff;
        }
        return compareSets(propertyExpressions, other.getPropertyExpressions());
    }
View Full Code Here

            return true;
        }
        if (!(obj instanceof OWLHasKeyAxiom)) {
            return false;
        }
        OWLHasKeyAxiom other = (OWLHasKeyAxiom) obj;
        return expression.equals(other.getClassExpression()) && propertyExpressions.equals(other.getPropertyExpressions()) && other.getAnnotations().equals(getAnnotations());
    }
View Full Code Here

TOP

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

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.