Examples of OWLOntologyManager


Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        m.applyChange(new AddAxiom(o, ax));
    }

    @Test
    public void testUnsatisfiableClasses() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // Create a console progress monitor. This will print the reasoner
        // progress out to the console.
        ReasonerProgressMonitor progressMonitor = new LoggingReasonerProgressMonitor(
                LOG, "testUnsatisfiableClasses");
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        }
    }

    @Test
    public void testDescendants() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // Create a console progress monitor. This will print the reasoner
        // progress out to the console.
        ReasonerProgressMonitor progressMonitor = new LoggingReasonerProgressMonitor(
                LOG, "testDescendants");
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        }
    }

    @Test
    public void testPetInstances() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // Create a console progress monitor. This will print the reasoner
        // progress out to the console.
        ReasonerProgressMonitor progressMonitor = new LoggingReasonerProgressMonitor(
                LOG, "testPetInstances");
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        }
    }

    @Test
    public void testLookupRestrictions() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // We want to examine the restrictions on all classes.
        for (OWLClass c : o.getClassesInSignature()) {
            assert c != null;
            // collect the properties which are used in existential restrictions
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        }
    }

    @Test
    public void testComment() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // We want to add a comment to the pizza class.
        OWLClass quokkaCls = df.getOWLClass(IRI.create(KOALA_IRI + "#Quokka"));
        // the content of our comment: a string and a language tag
        OWLAnnotation commentAnno = df.getOWLAnnotation(df.getRDFSComment(),
                df.getOWLLiteral("A class which represents Quokkas", "en"));
        // Specify that the pizza class has an annotation
        OWLAxiom ax = df.getOWLAnnotationAssertionAxiom(quokkaCls.getIRI(),
                commentAnno);
        // Add the axiom to the ontology
        m.applyChange(new AddAxiom(o, ax));
        // add a version info annotation to the ontology
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        // add a version info annotation to the ontology
    }

    @Test
    public void testVersionInfo() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // We want to add a comment to the pizza class.
        OWLLiteral lit = df.getOWLLiteral("Added a comment to the pizza class");
        // create an annotation to pair a URI with the constant
        OWLAnnotationProperty owlAnnotationProperty = df
                .getOWLAnnotationProperty(OWLRDFVocabulary.OWL_VERSION_INFO
                        .getIRI());
        OWLAnnotation anno = df.getOWLAnnotation(owlAnnotationProperty, lit);
        // Now we can add this as an ontology annotation
        // Apply the change in the usual way
        m.applyChange(new AddOntologyAnnotation(o, anno));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        m.applyChange(new AddOntologyAnnotation(o, anno));
    }

    @Test
    public void testReadAnnotations() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        for (OWLClass cls : o.getClassesInSignature()) {
            // Get the annotations on the class that use the label property
            for (OWLAnnotation annotation : annotations(
                    o.getAnnotationAssertionAxioms(cls.getIRI()),
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        }
    }

    @Test
    public void testInferredOntology() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // Create the reasoner and classify the ontology
        OWLReasoner reasoner = reasonerFactory.createNonBufferingReasoner(o);
        reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
        // To generate an inferred ontology, use implementations of inferred
        // axiom generators
        List<InferredAxiomGenerator<? extends OWLAxiom>> gens = new ArrayList<>();
        gens.add(new InferredSubClassAxiomGenerator());
        OWLOntology infOnt = m.createOntology();
        // create the inferred ontology generator
        InferredOntologyGenerator iog = new InferredOntologyGenerator(reasoner,
                gens);
        iog.fillOntology(m.getOWLDataFactory(), infOnt);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

        iog.fillOntology(m.getOWLDataFactory(), infOnt);
    }

    @Test
    public void testMergedOntology() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o1 = loadPizzaOntology(m);
        OWLOntology o2 = m.createOntology(EXAMPLE_IRI);
        m.addAxiom(
                o2,
                df.getOWLDeclarationAxiom(df.getOWLClass(IRI.create(EXAMPLE_IRI
                        + "#Weasel"))));
        // Create our ontology merger
        OWLOntologyMerger merger = new OWLOntologyMerger(m);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager

    @Test
    public void testOntologyWalker() throws OWLException {
        // How to use an ontology walker to walk the asserted structure of an
        // ontology.
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // Create the walker
        OWLOntologyWalker walker = new OWLOntologyWalker(
                Collections.singleton(o));
        // Now ask our walker to walk over the ontology
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.