Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAxiom


        if (!(destination instanceof RDFJsonLDDocumentFormat)) {
            return false;
        }
        Set<OWLAxiom> toRemove = new HashSet<>();
        for (OWLAxiom ax : others) {
            OWLAxiom reannotated = ax.getAxiomWithoutAnnotations()
                    .getAnnotatedAxiom(reannotate(ax.getAnnotations()));
            toRemove.add(reannotated);
        }
        axioms.removeAll(toRemove);
        return true;
View Full Code Here


    public void testCorrectAxiomAnnotated() throws OWLOntologyCreationException {
        OWLOntology ontology = createOntology();
        OWLNamedIndividual subject = NamedIndividual(IRI("http://Example.com#myBuilding"));
        OWLObjectProperty predicate = ObjectProperty(IRI("http://Example.com#located_at"));
        OWLNamedIndividual object = NamedIndividual(IRI("http://Example.com#myLocation"));
        OWLAxiom ax = ObjectPropertyAssertion(predicate, subject, object);
        assertTrue(ontology.containsAxiom(ax, EXCLUDED,
                AxiomAnnotations.IGNORE_AXIOM_ANNOTATIONS));
        Set<OWLAxiom> axioms = ontology
                .getAxiomsIgnoreAnnotations(ax, EXCLUDED);
        assertEquals(1, axioms.size());
        OWLAxiom theAxiom = axioms.iterator().next();
        assertTrue(theAxiom.isAnnotated());
    }
View Full Code Here

        OWLAxiomTreeComparator() {}

        @Override
        public int compare(Tree<OWLAxiom> o1, Tree<OWLAxiom> o2) {
            OWLAxiom ax1 = o1.getUserObject();
            OWLAxiom ax2 = o2.getUserObject();
            // Equivalent classes axioms always come last
            if (ax1 instanceof OWLEquivalentClassesAxiom) {
                return 1;
            }
            if (ax2 instanceof OWLEquivalentClassesAxiom) {
View Full Code Here

        List<OWLAxiom> axiomsList = new ArrayList<>(axioms);
        Collections.sort(axiomsList);
        Set<OWLAxiom> normalised = new HashSet<>();
        for (OWLAxiom ax : axiomsList) {
            assert ax != null;
            OWLAxiom dup = duplicateObject(ax);
            normalised.add(dup);
        }
        return normalised;
    }
View Full Code Here

        OWLClassExpression descA = df.getOWLObjectSomeValuesFrom(prop, clsA);
        OWLClassExpression descB = df.getOWLObjectSomeValuesFrom(prop, clsB);
        Set<OWLClassExpression> classExpressions = new HashSet<>();
        classExpressions.add(descA);
        classExpressions.add(descB);
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(classExpressions);
        m.applyChange(new AddAxiom(ontA, ax));
        OWLOntology ontB = roundTrip(ontA);
        assertTrue(ontB.getAxioms().contains(ax));
    }
View Full Code Here

        OWLObjectProperty prop = createObjectProperty();
        OWLClassExpression filler = df.getOWLObjectIntersectionOf(clsB, clsC);
        OWLCardinalityRestriction<?> restriction = df
                .getOWLObjectMinCardinality(3, prop, filler);
        assertTrue(restriction.isQualified());
        OWLAxiom ax = df.getOWLSubClassOfAxiom(clsA, restriction);
        return singleton(ax);
    }
View Full Code Here

    @Test
    public void testOWLClassDeclarationAxiom()
            throws OWLOntologyCreationException {
        OWLClass cls = createClass();
        OWLAxiom ax = Declaration(cls);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getClassesInSignature().contains(cls));
    }
View Full Code Here

    @Test
    public void testOWLObjectPropertyDeclarationAxiom()
            throws OWLOntologyCreationException {
        OWLObjectProperty prop = createObjectProperty();
        OWLAxiom ax = Declaration(prop);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getObjectPropertiesInSignature().contains(prop));
    }
View Full Code Here

        Set<OWLAnnotation> annos = new HashSet<>();
        OWLAnnotationProperty annoPropA = AnnotationProperty(iri("annoPropA"));
        OWLAnnotationProperty annoPropB = AnnotationProperty(iri("annoPropB"));
        annos.add(Annotation(annoPropA, Literal("Test", "en")));
        annos.add(Annotation(annoPropB, Literal("Test", "")));
        OWLAxiom ax = SubPropertyChainOf(props, propD, annos);
        Set<OWLAxiom> axioms = new HashSet<>();
        axioms.add(ax);
        return axioms;
    }
View Full Code Here

    @Test
    public void testOWLDataPropertyDeclarationAxiom()
            throws OWLOntologyCreationException {
        OWLDataProperty prop = createDataProperty();
        OWLAxiom ax = Declaration(prop);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getDataPropertiesInSignature().contains(prop));
    }
View Full Code Here

TOP

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

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.