Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLClass


    }

    @Nonnull
    private OWLOntology createOntology(@Nonnull OWLAnnotationProperty p)
            throws OWLOntologyCreationException {
        OWLClass a = Class(IRI("http://test.org/MissingDeclaration.owl#A"));
        OWLOntology ontology = m.createOntology();
        OWLAxiom axiom = AnnotationAssertion(p, a.getIRI(), Literal("Hello"));
        m.addAxiom(ontology, axiom);
        return ontology;
    }
View Full Code Here


        AbstractFileRoundTrippingTestCase {

    @Test
    public void testContainsAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLClass clsA = Class(iri("A"));
        OWLClass clsB = Class(iri("B"));
        axioms.add(SubClassOf(clsA, clsB));
        assertEquals(axioms, getOnt().getAxioms());
    }
View Full Code Here

@SuppressWarnings("javadoc")
public class ShortFormProviderTestCase {

    @Test
    public void shouldFindShortForm() {
        OWLClass c = Class(IRI("http://www.ebi.ac.uk/fgpt/ontologies/test/TEST_00001> test:TEST_00001"));
        QNameShortFormProvider shortener = new QNameShortFormProvider();
        String shortform = shortener.getShortForm(c);
        assertEquals("test:TEST_00001", shortform);
    }
View Full Code Here

        assertEquals("test:TEST_00001", shortform);
    }

    @Test
    public void shouldFindShortFormForWoman() {
        OWLClass c = Class(IRI("http://www.example.org/#Woman"));
        QNameShortFormProvider shortener = new QNameShortFormProvider();
        String shortform = shortener.getShortForm(c);
        assertEquals("www:Woman", shortform);
    }
View Full Code Here

        assertEquals("www:Woman", shortform);
    }

    @Test
    public void shouldFindShortFormForSetPRefix() {
        OWLClass c = Class(IRI("http://www.example.org/#Woman"));
        Map<String, String> prefixes = new HashMap<>();
        prefixes.put("test", "http://www.example.org/#");
        QNameShortFormProvider shortener = new QNameShortFormProvider(prefixes);
        String shortform = shortener.getShortForm(c);
        assertEquals("test:Woman", shortform);
View Full Code Here

    @Before
    public void setUp() {
        OWLDataFactory dataFactory = new OWLDataFactoryImpl();
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://stuff.com/A/");
        OWLClass clsA = Class("A", pm);
        OWLClass clsB = Class("B", pm);
        OWLClass clsC = Class("C", pm);
        OWLClass clsD = Class("D", pm);
        OWLClass clsE = Class("E", pm);
        SWRLVariable varA = dataFactory.getSWRLVariable(IRI
                .create("http://other.com/A/VarA"));
        SWRLVariable varB = dataFactory.getSWRLVariable(IRI
                .create("http://other.com/A/VarA"));
        SWRLVariable varC = dataFactory.getSWRLVariable(IRI
View Full Code Here

public class EquivalentClassesTestCase extends AbstractRendererAndParser {

    @Nonnull
    @Override
    protected Set<OWLAxiom> getAxioms() {
        OWLClass clsA = createClass();
        OWLObjectProperty prop = createObjectProperty();
        OWLClassExpression descA = df.getOWLObjectSomeValuesFrom(prop,
                df.getOWLThing());
        Set<OWLClassExpression> classExpressions = new HashSet<>();
        classExpressions.add(clsA);
View Full Code Here

@SuppressWarnings("javadoc")
public class DLSyntaxTestCase extends TestBase {

    @Test
    public void testCommasOnDisjointThree() {
        OWLClass a = df.getOWLClass(IRI.create("urn:A"));
        OWLClass b = df.getOWLClass(IRI.create("urn:B"));
        OWLClass c = df.getOWLClass(IRI.create("urn:C"));
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(a, b, c);
        DLSyntaxObjectRenderer visitor = new DLSyntaxObjectRenderer();
        String render = visitor.render(ax);
        assertEquals("A ⊑ ¬ B, A ⊑ ¬ C, B ⊑ ¬ C", render);
    }
View Full Code Here

        assertEquals("A ⊑ ¬ B, A ⊑ ¬ C, B ⊑ ¬ C", render);
    }

    @Test
    public void testCommasOnDisjointTwo() {
        OWLClass a = df.getOWLClass(IRI.create("urn:A"));
        OWLClass b = df.getOWLClass(IRI.create("urn:B"));
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(a, b);
        DLSyntaxObjectRenderer visitor = new DLSyntaxObjectRenderer();
        String render = visitor.render(ax);
        assertEquals("A ⊑ ¬ B", render);
    }
View Full Code Here

        assertEquals("A ⊑ ¬ B", render);
    }

    @Test
    public void testCommasOnDisjointFour() {
        OWLClass a = df.getOWLClass(IRI.create("urn:A"));
        OWLClass b = df.getOWLClass(IRI.create("urn:B"));
        OWLClass c = df.getOWLClass(IRI.create("urn:C"));
        OWLClass d = df.getOWLClass(IRI.create("urn:D"));
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(a, b, c, d);
        DLSyntaxObjectRenderer visitor = new DLSyntaxObjectRenderer();
        String render = visitor.render(ax);
        assertEquals("A ⊑ ¬ B, A ⊑ ¬ C, A ⊑ ¬ D, B ⊑ ¬ C, B ⊑ ¬ D, C ⊑ ¬ D",
                render);
View Full Code Here

TOP

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

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.