Examples of loadOntologyFromOntologyDocument()


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

   * @throws Exception
   */
  public static OOntology loadOntology(URL file) throws IOntologyException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    try {
      return new OOntology(manager.loadOntologyFromOntologyDocument(IRI.create(file)));
    } catch (OWLOntologyCreationException e) {
      throw new IOntologyException("Unable to create ontology "+file,e);
    } catch (URISyntaxException e) {
      throw new IOntologyException("Unable to create ontology "+file,e);
    }
View Full Code Here

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

            if (oConfSrc == null) {
                log.warn("No ONM configuration file found at path " + configPath
                         + ". Starting with blank scope set.");
            } else {
                try {
                    oConf = tempMgr.loadOntologyFromOntologyDocument(oConfSrc);
                } catch (OWLOntologyCreationException e) {
                    log.error("Cannot create the configuration ontology", e);
                }
            }
View Full Code Here

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

    @Test
    public void anonymousFromStream() throws Exception {
        InputStream in = getClass().getResourceAsStream(location_nameless);
        in.mark(Integer.MAX_VALUE);
        OWLOntologyManager onMgr = OWLManager.createOWLOntologyManager();
        OWLOntology o1 = onMgr.loadOntologyFromOntologyDocument(in);
        assertTrue(o1.isAnonymous());
        in.reset();
        // in = getClass().getResourceAsStream(location); // use if stream cannot be reset
        OWLOntologyID key = ontologyProvider.loadInStore(in, RDF_XML, false);
        assertNotNull(key);
View Full Code Here

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

        OWLOntologyID alias = new OWLOntologyID(IRI.create("nameless"), IRI.create(getClass()
                .getCanonicalName() + "#anonymousFromStreamWithCustomKeys().alias"));
        InputStream in = getClass().getResourceAsStream(location_nameless);
        in.mark(Integer.MAX_VALUE);
        OWLOntologyManager onMgr = OWLManager.createOWLOntologyManager();
        OWLOntology o1 = onMgr.loadOntologyFromOntologyDocument(in);
        assertTrue(o1.isAnonymous());
        in.reset();
        // in = getClass().getResourceAsStream(location); // use if stream cannot be reset
        OWLOntologyID key = ontologyProvider.loadInStore(in, RDF_XML, false, Origin.create(myKey),
            Origin.create(alias));
View Full Code Here

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

     */
    @Test
    public void anonymousFromURL() throws Exception {
        URL in = getClass().getResource(location_nameless);
        OWLOntologyManager onMgr = OWLManager.createOWLOntologyManager();
        OWLOntology o1 = onMgr.loadOntologyFromOntologyDocument(IRI.create(in));
        assertTrue(o1.isAnonymous());
        // in = getClass().getResourceAsStream(location); // use if stream cannot be reset
        OWLOntologyID key = ontologyProvider.loadInStore(IRI.create(in), RDF_XML, false);
        assertNotNull(key);
        assertFalse(key.isAnonymous());
View Full Code Here

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

                .getCanonicalName() + "#anonymousFromURLWithCustomKeys()"));
        OWLOntologyID alias = new OWLOntologyID(IRI.create("nameless"), IRI.create(getClass()
                .getCanonicalName() + "#anonymousFromURLWithCustomKeys().alias"));
        URL url = getClass().getResource(location_nameless);
        OWLOntologyManager onMgr = OWLManager.createOWLOntologyManager();
        OWLOntology o1 = onMgr.loadOntologyFromOntologyDocument(IRI.create(url));
        assertTrue(o1.isAnonymous());

        OWLOntologyID key = ontologyProvider.loadInStore(IRI.create(url), RDF_XML, false,
            Origin.create(myKey), Origin.create(alias));
        assertNotNull(key);
View Full Code Here

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

        OWLOntologyID expectedId = new OWLOntologyID(
                IRI.create("http://stanbol.apache.org/ontologies/test/naming/named-2"));
        InputStream in = getClass().getResourceAsStream(location);
        in.mark(Integer.MAX_VALUE);
        OWLOntologyManager onMgr = OWLManager.createOWLOntologyManager();
        OWLOntology o1 = onMgr.loadOntologyFromOntologyDocument(in);
        assertFalse(o1.isAnonymous());
        in.reset();
        assertEquals(expectedId, o1.getOntologyID());
        // in = getClass().getResourceAsStream(location); // use if stream cannot be reset
        OWLOntologyID key = ontologyProvider.loadInStore(in, RDF_XML, false);
View Full Code Here

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

        String location = "/ontologies/naming/named-1.owl";
        OWLOntologyID expectedId = new OWLOntologyID(
                IRI.create("http://stanbol.apache.org/ontologies/test/naming/named-1"));
        URL url = getClass().getResource(location);
        OWLOntologyManager onMgr = OWLManager.createOWLOntologyManager();
        OWLOntology o1 = onMgr.loadOntologyFromOntologyDocument(IRI.create(url));
        assertFalse(o1.isAnonymous());
        assertEquals(expectedId, o1.getOntologyID());
        // in = getClass().getResourceAsStream(location); // use if stream cannot be reset
        OWLOntologyID key = ontologyProvider.loadInStore(IRI.create(url), RDF_XML, false);
        assertNotNull(key);
View Full Code Here

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

        // Load the first ontology
        String location = "/ontologies/versiontest_v1.owl";
        InputStream in = getClass().getResourceAsStream(location);
        in.mark(Integer.MAX_VALUE);
        // Keep tack of the original in a separate ontology.
        OWLOntology o1 = onMgr.loadOntologyFromOntologyDocument(in);
        assertFalse(o1.isAnonymous());
        OWLOntologyID id1 = o1.getOntologyID();
        in.reset();
        // in = getClass().getResourceAsStream(location); // use if stream cannot be reset
        OWLOntologyID key = ontologyProvider.loadInStore(in, RDF_XML, false);
View Full Code Here

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

        // Now load the second version.
        location = "/ontologies/versiontest_v2.owl";
        in = getClass().getResourceAsStream(location);
        in.mark(Integer.MAX_VALUE);
        // Keep tack of the original in a separate ontology.
        OWLOntology o2 = onMgr.loadOntologyFromOntologyDocument(in);
        assertFalse(o2.isAnonymous());
        OWLOntologyID id2 = o2.getOntologyID();
        in.reset();
        // in = getClass().getResourceAsStream(location); // use if stream cannot be reset
        key = ontologyProvider.loadInStore(in, RDF_XML, false);
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.