Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLOntologyID


        OWLOntology initialOntology = m.createOntology();
        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


    @Test
    public void testMultipleVersionLoadsNoOntologyVersionIRIFirstTime()
            throws Exception {
        Optional<IRI> absent = Optional.<IRI> absent();
        assert absent != null;
        OWLOntologyID initialUniqueOWLOntologyID = new OWLOntologyID(i139,
                absent);
        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

        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI());
    }

    @Test
    public void testSingleVersionLoadChangeIRI() throws Exception {
        OWLOntologyID secondUniqueOWLOntologyID = new OWLOntologyID(i139, v2);
        OWLOntology secondOntology = m
                .createOntology(secondUniqueOWLOntologyID);
        OWLParser secondParser = new RDFXMLParser();
        // the following throws the exception
        secondParser.parse(new StringDocumentSource(INPUT), secondOntology,
View Full Code Here

        assertEquals(v2, secondOntology.getOntologyID().getVersionIRI());
    }

    @Test
    public void testSingleVersionLoadNoChange() 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());
View Full Code Here

    @Test
    public void testCreateOntologyWithIdWithVersionIRI()
            throws OWLOntologyCreationException {
        OWLOntologyManager manager = createManager();
        IRI versionIRI = IRI("http://version/1");
        OWLOntologyID id = new OWLOntologyID(of(ONTOLOGY_IRI), of(versionIRI));
        OWLOntology ontology = manager.createOntology(id);
        assertEquals(ONTOLOGY_IRI, ontology.getOntologyID().getOntologyIRI()
                .get());
        assertEquals(versionIRI, ontology.getOntologyID().getVersionIRI().get());
        assertEquals(versionIRI, manager.getOntologyDocumentIRI(ontology));
View Full Code Here

    }

    @Test
    public void testCreateOntologyWithId() throws OWLOntologyCreationException {
        OWLOntologyManager manager = createManager();
        OWLOntologyID id = new OWLOntologyID(of(ONTOLOGY_IRI), absent());
        OWLOntology ontology = manager.createOntology(id);
        assertEquals(ONTOLOGY_IRI, ontology.getOntologyID().getOntologyIRI()
                .get());
        assertEquals(ONTOLOGY_IRI, manager.getOntologyDocumentIRI(ontology));
    }
View Full Code Here

    private final OWLOntologyID mockOntologyID = new OWLOntologyID();

    @Before
    public void setUp() {
        when(mockOntology.getOntologyID()).thenReturn(
                new OWLOntologyID(Optional.of(IRI.create("urn:test:onto1")),
                        Optional.of(IRI.create("urn:test:onto1_1"))));
    }
View Full Code Here

    @Override
    protected OWLOntology createOntology() {
        IRI ontIRI = IRI("http://www.semanticweb.org/owlapi/ontology");
        IRI versionIRI = IRI("http://www.semanticweb.org/owlapi/ontology/version");
        OWLOntologyID ontologyID = new OWLOntologyID(of(ontIRI), of(versionIRI));
        try {
            return m.createOntology(ontologyID);
        } catch (OWLOntologyCreationException e) {
            throw new OWLRuntimeException(e);
        }
View Full Code Here

    @Test
    @Tests(method = "public Object visit(OWLOntology ontology)")
    public void shouldCreateViolationForOWLOntologyInOWL2DLProfile()
            throws Exception {
        OWLOntology o = OWLManager.createOWLOntologyManager().createOntology(
                new OWLOntologyID(Optional.of(IRI(START + "test")), Optional
                        .of(IRI(START + "test1"))));
        OWL2DLProfile profile = new OWL2DLProfile();
        int expected = 2;
        Class[] expectedViolations = {
                UseOfReservedVocabularyForOntologyIRI.class,
View Full Code Here

    @Test
    @Tests(method = "public Object visit(OWLOntology ont)")
    public void shouldCreateViolationForOWLOntologyInOWL2Profile()
            throws Exception {
        OWLOntology o = OWLManager.createOWLOntologyManager().createOntology(
                new OWLOntologyID(Optional.of(IRI("test")), Optional
                        .of(IRI("test1"))));
        OWL2Profile profile = new OWL2Profile();
        int expected = 2;
        Class[] expectedViolations = { OntologyIRINotAbsolute.class,
                OntologyVersionIRINotAbsolute.class };
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLOntologyID

Copyright © 2018 www.massapicom. 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.