Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLClass


public class SubClassOfAxiomAnnotatedTestCase extends
        AbstractAnnotatedAxiomRoundTrippingTestCase {

    @Override
    protected OWLAxiom getMainAxiom(Set<OWLAnnotation> annos) {
        OWLClass clsA = Class(iri("A"));
        OWLClass clsB = Class(iri("B"));
        return df.getOWLSubClassOfAxiom(clsA, clsB, annos);
    }
View Full Code Here


        OWLOntology ontology = createOntology();
        String ontName = ontology.getOntologyID().getOntologyIRI().get()
                .toString();
        StructuralReasoner reasoner = new StructuralReasoner(ontology,
                new SimpleConfiguration(), BufferingMode.BUFFERING);
        OWLClass cls = Class(IRI(ontName + "#Koala"));
        reasoner.getSubClasses(cls, false);
        reasoner.getSuperClasses(cls, false);
    }
View Full Code Here

    private OWLReasoner reasoner;

    @Nonnull
    private OWLOntology createOntology() {
        OWLOntology o = getOWLOntology("ont");
        OWLClass clsA = getClsA();
        OWLClass clsB = getClsB();
        OWLClass clsC = getClsC();
        OWLClass clsD = getClsD();
        OWLClass clsE = getClsE();
        OWLClass clsF = getClsF();
        OWLClass clsG = getClsG();
        OWLClass clsK = getClsK();
        OWLOntologyManager man = o.getOWLOntologyManager();
        man.addAxiom(o, SubClassOf(clsG, OWLThing()));
        man.addAxiom(o, SubClassOf(OWLThing(), clsG));
        man.addAxiom(o, EquivalentClasses(clsA, clsB));
        man.addAxiom(o, SubClassOf(clsC, clsB));
View Full Code Here

        OWLOntology ontology = createOntology();
        Set<OWLSubClassOfAxiom> axioms = ontology
                .getAxioms(AxiomType.SUBCLASS_OF);
        assertEquals(1, axioms.size());
        OWLSubClassOfAxiom ax = axioms.iterator().next();
        OWLClass subCls = Class(SUBCLASS_IRI);
        OWLClass supCls = Class(SUPERCLASS_IRI);
        assertEquals(subCls, ax.getSubClass());
        assertEquals(supCls, ax.getSuperClass());
    }
View Full Code Here

@SuppressWarnings("javadoc")
public class StructuralReasonerTestCase extends TestBase {

    @Test
    public void testClassHierarchy() {
        OWLClass clsX = Class(iri("X"));
        OWLClass clsA = Class(iri("A"));
        OWLClass clsAp = Class(iri("Ap"));
        OWLClass clsB = Class(iri("B"));
        OWLOntology ont = getOWLOntology("ont");
        OWLOntologyManager man = ont.getOWLOntologyManager();
        man.addAxiom(ont, EquivalentClasses(OWLThing(), clsX));
        man.addAxiom(ont, SubClassOf(clsB, clsA));
        man.addAxiom(ont, EquivalentClasses(clsA, clsAp));
View Full Code Here

        man.removeAxiom(ont, SubClassOf(clsA, OWLThing()));
        testClassHierarchy(reasoner);
    }

    private void testClassHierarchy(@Nonnull StructuralReasoner reasoner) {
        OWLClass clsX = Class(iri("X"));
        OWLClass clsA = Class(iri("A"));
        OWLClass clsAp = Class(iri("Ap"));
        OWLClass clsB = Class(iri("B"));
        NodeSet<OWLClass> subsOfA = reasoner.getSubClasses(clsA, true);
        assertEquals(1, subsOfA.getNodes().size());
        assertTrue(subsOfA.containsEntity(clsB));
        NodeSet<OWLClass> subsOfAp = reasoner.getSubClasses(clsAp, true);
        assertEquals(1, subsOfAp.getNodes().size());
View Full Code Here

    @Nonnull
    @Override
    protected Set<OWLAxiom> getAxioms() {
        OWLIndividual ind = createIndividual();
        OWLClass cls = createClass();
        OWLAxiom ax = df.getOWLClassAssertionAxiom(cls, ind);
        return singleton(ax);
    }
View Full Code Here

@SuppressWarnings("javadoc")
public class BuiltInClassTestCase {

    @Test
    public void testOWLThing() {
        OWLClass thing = OWLThing();
        assertTrue(thing.isOWLThing());
        assertFalse(thing.isOWLNothing());
    }
View Full Code Here

        assertFalse(desc.isOWLNothing());
    }

    @Test
    public void testOWLNothing() {
        OWLClass nothing = OWLNothing();
        assertTrue(nothing.isOWLNothing());
        assertFalse(nothing.isOWLThing());
    }
View Full Code Here

    @Nonnull
    private static final String NS = "urn:test";

    @Test
    public void shouldDoCompleteRoundtrip() throws Exception {
        OWLClass a = Class(IRI(NS + "#A"));
        OWLDataProperty p = df.getOWLDataProperty(IRI(NS + "#P"));
        SWRLVariable x = df.getSWRLVariable(IRI(NS + "#X"));
        SWRLVariable y = df.getSWRLVariable(IRI(NS + "#Y"));
        OWLOntology ontology = m.createOntology(IRI(NS));
        Set<SWRLAtom> body = new TreeSet<>();
View Full Code Here

TOP

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

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.