Examples of OWLOntologyID


Examples of org.semanticweb.owlapi.model.OWLOntologyID

    @SuppressWarnings("null")
    @Nonnull
    @Override
    public OWLDocumentFormat getOntologyFormat(@Nonnull OWLOntology ontology) {
        OWLOntologyID ontologyID = ontology.getOntologyID();
        return ontologyFormatsByOntology.get(ontologyID);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

    }

    @Override
    public OWLOntology createOntology() throws OWLOntologyCreationException {
        // Brand new ontology without a URI
        return createOntology(new OWLOntologyID());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

    }

    @Override
    public OWLOntology createOntology(@Nonnull IRI ontologyIRI)
            throws OWLOntologyCreationException {
        return createOntology(new OWLOntologyID(of(ontologyIRI), absent()));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

    @Override
    public OWLOntology createOntology(IRI ontologyIRI,
            Set<OWLOntology> ontologies, boolean copyLogicalAxiomsOnly)
            throws OWLOntologyCreationException {
        if (contains(ontologyIRI)) {
            throw new OWLOntologyAlreadyExistsException(new OWLOntologyID(
                    of(ontologyIRI), absent()));
        }
        OWLOntology ont = createOntology(ontologyIRI);
        Set<OWLAxiom> axioms = new HashSet<>();
        for (OWLOntology ontology : ontologies) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

    @Override
    public OWLOntology createOntology(Set<OWLAxiom> axioms, IRI ontologyIRI)
            throws OWLOntologyCreationException {
        if (contains(ontologyIRI)) {
            throw new OWLOntologyAlreadyExistsException(new OWLOntologyID(
                    of(ontologyIRI), absent()));
        }
        OWLOntology ont = createOntology(ontologyIRI);
        addAxioms(ont, axioms);
        return ont;
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

            }
        }
        if (ontByID != null) {
            return ontByID;
        }
        OWLOntologyID id = new OWLOntologyID(of(ontologyIRI), absent());
        IRI documentIRI = getDocumentIRIFromMappers(id, true);
        if (documentIRI != null) {
            if (documentIRIsByID.values().contains(documentIRI) && !allowExists) {
                throw new OWLOntologyDocumentAlreadyExistsException(documentIRI);
            }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

            @Nonnull OWLOntologyLoaderConfiguration configuration)
            throws OWLOntologyCreationException {
        if (loadCount.get() != importsLoadCount.get()) {
            LOGGER.error("Runtime Warning: Parsers should load imported ontologies using the makeImportLoadRequest method.");
        }
        fireStartedLoadingEvent(new OWLOntologyID(of(ontologyIRI), absent()),
                documentSource.getDocumentIRI(), loadCount.get() > 0);
        loadCount.incrementAndGet();
        broadcastChanges.set(false);
        Exception ex = null;
        OWLOntologyID idOfLoadedOntology = new OWLOntologyID();
        try {
            for (OWLOntologyFactory factory : ontologyFactories) {
                if (factory.canLoad(documentSource)) {
                    try {
                        // Note - there is no need to add the ontology here,
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

            + "    <owl:versionIRI rdf:resource=\"http://test.example.org/ontology/0139/version:1\" />\n"
            + "  </rdf:Description>  \n" + "</rdf:RDF>";

    @Test
    public void testMultipleVersionLoadChangeIRI() throws Exception {
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser initialParser = new RDFXMLParser();
        initialParser.parse(new StringDocumentSource(INPUT), initialOntology,
                config);
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        try {
            m.createOntology(secondUniqueOWLOntologyID);
            fail("Did not receive expected OWLOntologyDocumentAlreadyExistsException");
        } catch (OWLOntologyAlreadyExistsException e) {
            assertEquals(new OWLOntologyID(i139, v2), e.getOntologyID());
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

        }
    }

    @Test
    public void testMultipleVersionLoadNoChange() throws Exception {
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139, v1);
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(new StringDocumentSource(INPUT), initialOntology, config);
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v1);
        try {
            m.createOntology(secondUniqueOWLOntologyID);
            fail("Did not receive expected OWLOntologyAlreadyExistsException");
        } catch (OWLOntologyAlreadyExistsException e) {
            assertEquals(new OWLOntologyID(i139, v1), e.getOntologyID());
        }
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLOntologyID

        }
    }

    @Test
    public void testMultipleVersionLoadsExplicitOntologyIDs() throws Exception {
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139, v1);
        OWLOntology initialOntology = m
                .createOntology(initialUniqueOWLOntologyID);
        OWLParser parser = new RDFXMLParser();
        parser.parse(new StringDocumentSource(INPUT), initialOntology, config);
        assertEquals(i139, initialOntology.getOntologyID().getOntologyIRI());
        assertEquals(v1, initialOntology.getOntologyID().getVersionIRI());
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        OWLOntology secondOntology = m
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        secondParser.parse(new StringDocumentSource(INPUT), secondOntology,
                config);
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.