Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDataProperty


    }

    @Test
    public void testOWLDataPropertyDeclarationAxiom()
            throws OWLOntologyCreationException {
        OWLDataProperty prop = createDataProperty();
        OWLAxiom ax = Declaration(prop);
        OWLOntology ont = m.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        m.applyChange(new AddAxiom(ont, ax));
        assertTrue(ont.getDataPropertiesInSignature().contains(prop));
View Full Code Here


    @Test
    public void shouldRoundTrip() throws Exception {
        OWLClass c = Class(IRI(NS + "#C"));
        OWLClass d = Class(IRI(NS + "#D"));
        OWLObjectProperty p = ObjectProperty(IRI(NS + "#p"));
        OWLDataProperty q = DataProperty(IRI(NS + "#q"));
        OWLIndividual i = AnonymousIndividual();
        OWLOntology ontology = m.createOntology(IRI(NS));
        List<AddAxiom> changes = new ArrayList<>();
        changes.add(new AddAxiom(ontology, SubClassOf(c, ObjectHasValue(p, i))));
        changes.add(new AddAxiom(ontology, ClassAssertion(d, i)));
View Full Code Here

    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange intdr = Integer();
        OWLDataRange floatdr = Float();
        OWLDataRange union = DataUnionOf(intdr, floatdr);
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(p, union);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

    @Test
    public void shouldSearchDataProperties()
            throws OWLOntologyCreationException {
        // given
        OWLOntology o = m.createOntology();
        OWLDataProperty c = DataProperty(IRI("urn:c"));
        OWLDataProperty d = DataProperty(IRI("urn:d"));
        OWLDataProperty e = DataProperty(IRI("urn:e"));
        OWLAxiom ax = SubDataPropertyOf(c, d);
        OWLClass x = Class(IRI("urn:x"));
        OWLAxiom ax2 = DataPropertyDomain(c, x);
        OWLAxiom ax3 = DataPropertyRange(c, Boolean());
        OWLAxiom ax4 = EquivalentDataProperties(c, e);
View Full Code Here

    @Test
    public void shouldRoundTripInvalidDisjointDataProperties()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        // given
        OWLDataProperty e1 = DataProperty(IRI("urn:test1"));
        OWLDataProperty e2 = DataProperty(IRI("urn:test2"));
        OWLDataProperty e3 = DataProperty(IRI("urn:test3"));
        // given
        OWLAxiom wrongAxiom = DisjointDataProperties(e1);
        OWLAxiom validAxiom = DisjointDataProperties(e2, e3);
        // when
        addAxioms(wrongAxiom, validAxiom);
View Full Code Here

    @Test
    public void shouldRoundTripInvalidEquivalentDataProperties()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        // given
        OWLDataProperty e1 = DataProperty(IRI("urn:test1"));
        OWLDataProperty e2 = DataProperty(IRI("urn:test2"));
        OWLDataProperty e3 = DataProperty(IRI("urn:test3"));
        // given
        OWLAxiom wrongAxiom = EquivalentDataProperties(e1);
        OWLAxiom validAxiom = EquivalentDataProperties(e2, e3);
        // when
        addAxioms(wrongAxiom, validAxiom);
View Full Code Here

    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange intdr = Integer();
        OWLDataRange complement = DataComplementOf(intdr);
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(p, complement);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLNamedIndividual ind = NamedIndividual(iri("i"));
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLLiteral literal = Literal("Test \"literal\"");
        axioms.add(DataPropertyAssertion(prop, ind, literal));
        OWLLiteral literal2 = Literal("Test 'literal'");
        axioms.add(DataPropertyAssertion(prop, ind, literal2));
        OWLLiteral literal3 = Literal("Test \"\"\"literal\"\"\"");
View Full Code Here

    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLClass clsA = Class(iri("A"));
        OWLDatatype dt = Datatype(iri("B"));
        OWLDataProperty propP = DataProperty(iri("p"));
        axioms.add(SubClassOf(clsA, DataAllValuesFrom(propP, dt)));
        axioms.add(Declaration(dt));
        axioms.add(Declaration(propP));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataProperty propA = DataProperty(iri("pA"));
        OWLDataProperty propB = DataProperty(iri("pB"));
        OWLDataProperty propC = DataProperty(iri("pC"));
        axioms.add(DisjointDataProperties(propA, propB, propC));
        axioms.add(Declaration(propA));
        axioms.add(Declaration(propB));
        axioms.add(Declaration(propC));
        return axioms;
View Full Code Here

TOP

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

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.