Package org.semanticweb.owlapi.apibinding.OWLFunctionalSyntaxFactory

Examples of org.semanticweb.owlapi.apibinding.OWLFunctionalSyntaxFactory.IRI


public class IRICharSequenceTestCase {

    @Test
    public void testCharAt() {
        String str = "http://owlapi.sourceforge.net#ABC";
        IRI iri = IRI(str);
        for (int i = 0; i < str.length(); i++) {
            assertEquals(str.charAt(i), iri.charAt(i));
        }
    }
View Full Code Here


    }

    @Test
    public void testCharAtNoRemainder() {
        String str = "http://owlapi.sourceforge.net";
        IRI iri = IRI(str);
        for (int i = 0; i < str.length(); i++) {
            assertEquals(str.charAt(i), iri.charAt(i));
        }
    }
View Full Code Here

    @Nonnull
    private static final String TEST_ONTOLOGY_IRI_STRING = "http://test.it/check1";

    @Test
    public void shouldFindSameHashCode() {
        IRI iri1 = IRI(TEST_ONTOLOGY_IRI_STRING);
        IRI iri2 = IRI(TEST_ONTOLOGY_IRI_STRING);
        assertEquals(iri1.hashCode(), iri2.hashCode());
        assertEquals(iri1, iri2);
    }
View Full Code Here

        assertEquals(iri1, iri2);
    }

    @Test
    public void shouldFindSameHashCodeForIDs() {
        IRI iri1 = IRI(TEST_ONTOLOGY_IRI_STRING);
        IRI iri2 = IRI(TEST_ONTOLOGY_IRI_STRING);
        assertEquals(iri1.hashCode(), iri2.hashCode());
        OWLOntologyID id1 = new OWLOntologyID(of(iri1), absent());
        OWLOntologyID id2 = new OWLOntologyID(of(iri2), absent());
        assertEquals(id1.hashCode(), id2.hashCode());
    }
View Full Code Here

        assertEquals(id1.hashCode(), id2.hashCode());
    }

    @Test
    public void shouldFindSameHashCodeForIDs2() {
        IRI iri1 = IRI(TEST_ONTOLOGY_IRI_STRING);
        IRI iri2 = IRI(TEST_ONTOLOGY_IRI_STRING);
        assertEquals(iri1.hashCode(), iri2.hashCode());
        OWLOntologyID id1 = new OWLOntologyID(of(iri1), absent());
        OWLOntologyID id2 = new OWLOntologyID(of(iri2), absent());
        assertEquals(id1.hashCode(), id2.hashCode());
        assertEquals(id1, id2);
    }
View Full Code Here

    // this is an experiment, if the manager were to keep all versions of an
    // ontology together in a multimap or something
    @Test
    public void testVersionedIDComparisons() {
        IRI iri1 = IRI(TEST_ONTOLOGY_IRI_STRING);
        IRI iri2 = IRI(TEST_ONTOLOGY_IRI_STRING);
        assertEquals(iri1.hashCode(), iri2.hashCode());
        assertEquals(iri1, iri2);
        OWLOntologyID unversionedID = new OWLOntologyID(of(iri1), absent());
        String version1IRIString = TEST_ONTOLOGY_IRI_STRING + "/version1";
        IRI version1IRI = IRI(version1IRIString);
        OWLOntologyID version1ID = new OWLOntologyID(of(iri2), of(version1IRI));
        assertEquals("null vs v1 base IRIs", unversionedID.getOntologyIRI(),
                version1ID.getOntologyIRI());
        assertNotEquals(unversionedID.getVersionIRI(),
                version1ID.getVersionIRI());
        assertNotEquals("null version vs version1", unversionedID.hashCode(),
                version1ID.hashCode());
        assertNotEquals("null version vs version1", unversionedID, version1ID);
        OWLOntologyID duplicateVersion1ID = new OWLOntologyID(
                of(IRI(TEST_ONTOLOGY_IRI_STRING)), of(IRI(version1IRIString)));
        assertEquals(" two version1 ids", version1ID, duplicateVersion1ID);
        OWLOntologyID differentBasedVersion1ID = new OWLOntologyID(
                of(IRI(TEST_ONTOLOGY_IRI_STRING + "-of-doom")),
                of(IRI(version1IRIString)));
        assertNotEquals("version1 of two base IRIs", version1ID,
                differentBasedVersion1ID);
        IRI version2IRI = IRI(TEST_ONTOLOGY_IRI_STRING + "/version2");
        IRI iri3 = IRI(TEST_ONTOLOGY_IRI_STRING);
        OWLOntologyID version2ID = new OWLOntologyID(of(iri3), of(version2IRI));
        assertNotEquals("version1 vs version2", version1ID.hashCode(),
                version2ID.hashCode());
        assertNotEquals("version1 vs version2", version1ID, version2ID);
    }
View Full Code Here

    }

    @Test
    public void testCharAtNoPrefix() {
        String str = "#ABC";
        IRI iri = IRI(str);
        for (int i = 0; i < str.length(); i++) {
            assertEquals(str.charAt(i), iri.charAt(i));
        }
    }
View Full Code Here

    }

    @Test
    public void testSubSequence() {
        String str = "http://owlapi.sourceforge.net#ABC";
        IRI iri = IRI(str);
        for (int i = 0; i < str.length(); i++) {
            for (int j = i; j < str.length(); j++) {
                assertEquals(str.subSequence(i, j), iri.subSequence(i, j));
            }
        }
    }
View Full Code Here

    }

    @Test
    public void testLength() {
        String str = "http://owlapi.sourceforge.net#ABC";
        IRI iri = IRI(str);
        assertEquals(str.length(), iri.length());
    }
View Full Code Here

    }

    @Test
    public void testLengthNoRemainder() {
        String str = "http://owlapi.sourceforge.net";
        IRI iri = IRI(str);
        assertEquals(str.length(), iri.length());
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.apibinding.OWLFunctionalSyntaxFactory.IRI

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.