Package org.semanticweb.owlapi.model

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


    public void shouldCreatePropertyAssertions() throws Exception {
        // We can specify the properties of an individual using property
        // assertions Get a copy of an ontology manager
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        IRI ontologyIRI = IRI.create("http://example.com/owl/families/");
        OWLOntology ontology = manager.createOntology(ontologyIRI);
        // Get hold of a data factory from the manager and set up a prefix
        // manager to make things easier
        OWLDataFactory factory = manager.getOWLDataFactory();
        PrefixManager pm = new DefaultPrefixManager(null, null,
                ontologyIRI.toString());
View Full Code Here

    @Test
    public void testIRTsConversion() throws Exception {
        IRI ontologyIRI = IRI.create("http://purl.obolibrary.org/obo/test.owl");
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        OWLOntology ontology = manager.createOntology(ontologyIRI);
        convert(ontology);
        String ontId = OWLAPIOwl2Obo.getOntologyId(ontology);
        assertEquals("test", ontId);
        IRI iri = IRI.create("http://purl.obolibrary.org/obo/OBI_0000306");
        String id = OWLAPIOwl2Obo.getIdentifier(iri);
View Full Code Here

        // OWLOntologyManagerFactoryRegistry.getOWLDataFactory(),
        // storerRegistry, parserRegistry);
        OWLOntologyManager testManager = OWLManager.createOWLOntologyManager();
        testManager.getOntologyStorers().set(new RioNTriplesStorerFactory(),
                new RioRDFXMLStorerFactory(), new RioTurtleStorerFactory());
        testOntologyEmpty = testManager.createOntology(testOntologyUri1);
        testOntologyKoala = testManager
                .loadOntologyFromOntologyDocument(getClass()
                        .getResourceAsStream("/koala.owl"));
        assertEquals(70, testOntologyKoala.getAxiomCount());
        testHandlerStatementCollector = new StatementCollector();
View Full Code Here

    // Extract the module axioms for the specified signature
    Set<OWLAxiom> moduleAxioms =
      ModularityUtils.extractModule( ontology, signature, moduleType );
    // Create an ontology for the module axioms 
    OWLOntology moduleOnt = manager.createOntology( moduleAxioms );
   
    // Get some figures about the extracted module and print them
    System.out.println( "The module contains "
      + moduleOnt.getLogicalAxiomCount() + " axioms, "
      + moduleOnt.getClassesInSignature().size() + " classes, and "
View Full Code Here

   */
  public static OOntology createOntology(URI uri) throws IOntologyException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    //manager.addOntologyStorer(new OWLXMLOntologyStorer());
    try{
      return new OOntology(manager.createOntology(IRI.create(uri)));
    } catch (OWLOntologyCreationException e) {
      throw new IOntologyException("Unable to create ontology "+uri,e);
    }
  }
 
View Full Code Here

   */
  public static OOntology createOntology(URI uri) throws IOntologyException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    //manager.addOntologyStorer(new OWLXMLOntologyStorer());
    try{
      return new OOntology(manager.createOntology(IRI.create(uri)));
    } catch (OWLOntologyCreationException e) {
      throw new IOntologyException("Unable to create ontology "+uri,e);
    }
  }
 
View Full Code Here

        }
        assertFalse(dummyiri.equals(mapper.getDocumentIRI(dummyiri)));

        // Create a new ontology in the test resources.
        OWLOntologyManager mgr = OWLOntologyManagerFactory.createOWLOntologyManager(null);
        OWLOntology o = mgr.createOntology(dummyiri);
        File f = new File(URI.create(url.toString() + "/dummycharacters.owl"));
        mgr.saveOntology(o, new WriterDocumentTarget(new FileWriter(f)));
        assertTrue(f.exists());

        ((AutoIRIMapper) mapper).update();
View Full Code Here

    private static OntologyInputSource<?> src1 = null, src2 = null;

    @BeforeClass
    public static void setup() throws Exception {
        OWLOntologyManager mgr = OWLOntologyManagerFactory.createOWLOntologyManager(null);
        src1 = new RootOntologySource(mgr.createOntology(baseIri));
        src2 = new RootOntologySource(mgr.createOntology(baseIri2));
        reset();
    }

    @After
View Full Code Here

    @BeforeClass
    public static void setup() throws Exception {
        OWLOntologyManager mgr = OWLOntologyManagerFactory.createOWLOntologyManager(null);
        src1 = new RootOntologySource(mgr.createOntology(baseIri));
        src2 = new RootOntologySource(mgr.createOntology(baseIri2));
        reset();
    }

    @After
    public void cleanup() throws Exception {
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.