Examples of createOntology()


Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        @Nonnull
        File ontologyByVersion = folder.newFile("tempversion.owl");
        @Nonnull
        File ontologyByOtherPath = folder.newFile("tempother.owl");
        OWLOntologyManager manager = m;
        OWLOntology ontology = manager.createOntology(new OWLOntologyID(
                Optional.of(IRI.create(ontologyByName)), Optional.of(IRI
                        .create(ontologyByVersion))));
        manager.saveOntology(ontology, IRI.create(ontologyByName));
        manager.saveOntology(ontology, IRI.create(ontologyByVersion));
        manager.saveOntology(ontology, IRI.create(ontologyByOtherPath));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        manager.saveOntology(ontology, IRI.create(ontologyByName));
        manager.saveOntology(ontology, IRI.create(ontologyByVersion));
        manager.saveOntology(ontology, IRI.create(ontologyByOtherPath));
        manager = m1;
        OWLDataFactory factory = manager.getOWLDataFactory();
        OWLOntology ontology1 = manager.createOntology(IRI
                .create(importsBothNameAndVersion));
        OWLOntology ontology2 = manager.createOntology(IRI
                .create(importsBothNameAndOther));
        List<AddImport> changes = new ArrayList<>();
        changes.add(new AddImport(ontology1, factory
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        manager.saveOntology(ontology, IRI.create(ontologyByOtherPath));
        manager = m1;
        OWLDataFactory factory = manager.getOWLDataFactory();
        OWLOntology ontology1 = manager.createOntology(IRI
                .create(importsBothNameAndVersion));
        OWLOntology ontology2 = manager.createOntology(IRI
                .create(importsBothNameAndOther));
        List<AddImport> changes = new ArrayList<>();
        changes.add(new AddImport(ontology1, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByName))));
        changes.add(new AddImport(ontology1, factory
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        // above manner does not "add them to an ontology". They are merely
        // objects that allow us to reference certain objects (classes etc.) for
        // use in class expressions, and axioms (which can be added to an
        // ontology). Lets create an ontology, and add a declaration axiom to
        // the ontology that declares the above class
        OWLOntology ontology = manager
                .createOntology(IRI
                        .create("http://www.semanticweb.org/owlapi/ontologies/ontology"));
        // We can add a declaration axiom to the ontology, that essentially adds
        // the class to the signature of our ontology.
        OWLDeclarationAxiom declarationAxiom = factory
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://www.semanticweb.org/ontologies/dataranges#");
        OWLDataProperty hasAge = factory.getOWLDataProperty(":hasAge", pm);
        OWLDataPropertyRangeAxiom rangeAxiom = factory
                .getOWLDataPropertyRangeAxiom(hasAge, integerGE18);
        OWLOntology ontology = manager.createOntology(IRI
                .create("http://www.semanticweb.org/ontologies/dataranges"));
        // Add the range axiom to our ontology
        manager.addAxiom(ontology, rangeAxiom);
        // For creating datatype restrictions on integers or doubles there are
        // some convenience methods on OWLDataFactory For example: Create a data
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

     */
    @Test
    public void shouldUseDataranges() throws Exception {
        OWLOntologyManager man = OWLManager.createOWLOntologyManager();
        String base = "http://org.semanticweb.datarangeexample";
        OWLOntology ont = man.createOntology(IRI.create(base));
        // We want to add an axiom to our ontology that states that adults have
        // an age greater than 18. To do this, we will create a restriction
        // along a hasAge property, with a filler that corresponds to the set of
        // integers greater than 18. First get a reference to our hasAge
        // property
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        // Set up a mapping, which maps the ontology to the document IRI
        SimpleIRIMapper mapper = new SimpleIRIMapper(ontologyIRI, documentIRI);
        manager.getIRIMappers().add(mapper);
        // Now create the ontology - we use the ontology IRI (not the physical
        // URI)
        OWLOntology ontology = manager.createOntology(ontologyIRI);
        // Now we want to specify that A is a subclass of B. To do this, we add
        // a subclass axiom. A subclass axiom is simply an object that specifies
        // that one class is a subclass of another class. We need a data factory
        // to create various object from. Each manager has a reference to a data
        // factory that we can use.
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

                .create("http://www.semanticweb.org/ontologies/myontology");
        // Here we have decided to call our ontology
        // "http://www.semanticweb.org/ontologies/myontology" If we publish our
        // ontology then we should make the location coincide with the ontology
        // IRI Now we have an IRI we can create an ontology using the manager
        OWLOntology ontology = manager.createOntology(ontologyIRI);
        // System.out.println("Created ontology: " + ontology);
        // In OWL 2 if an ontology has an ontology IRI it may also have a
        // version IRI The OWL API encapsulates ontology IRI and possible
        // version IRI information in an OWLOntologyID Each ontology knows about
        // its ID
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

        IRI versionIRI2 = IRI
                .create("http://www.semanticweb.org/ontologies/myontology2/newversion");
        OWLOntologyID ontologyID2 = new OWLOntologyID(
                Optional.of(ontologyIRI2), Optional.of(versionIRI2));
        // Now create the ontology
        OWLOntology ontology2 = manager.createOntology(ontologyID2);
        // Finally, if we don't want to give an ontology an IRI, in OWL 2 we
        // don't have to
        OWLOntology anonOntology = manager.createOntology();
        // This ontology is anonymous
        // System.out.println("Anonymous: " + anonOntology.isAnonymous());
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.createOntology()

                Optional.of(ontologyIRI2), Optional.of(versionIRI2));
        // Now create the ontology
        OWLOntology ontology2 = manager.createOntology(ontologyID2);
        // Finally, if we don't want to give an ontology an IRI, in OWL 2 we
        // don't have to
        OWLOntology anonOntology = manager.createOntology();
        // This ontology is anonymous
        // System.out.println("Anonymous: " + anonOntology.isAnonymous());
    }

    /**
 
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.