Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDataProperty


            void
            shouldCreateViolationForOWLEquivalentDataPropertiesAxiomInOWL2RLProfile()
                    throws Exception {
        OWLOntology o = createOnto();
        OWLOntologyManager m = o.getOWLOntologyManager();
        OWLDataProperty dp = DataProperty(IRI("urn:test#test"));
        declare(o, DATAP, dp);
        m.addAxiom(o, EquivalentDataProperties(DATAP, dp));
        OWL2RLProfile profile = new OWL2RLProfile();
        int expected = 1;
        Class[] expectedViolations = { UseOfIllegalAxiom.class };
View Full Code Here


    @Test
    public void testDatatypeRestriction() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = m.createOntology(EXAMPLE_IRI);
        // Adults have an age greater than 18.
        OWLDataProperty hasAge = df.getOWLDataProperty(IRI.create(EXAMPLE_IRI
                + "hasAge"));
        // Create the restricted data range by applying the facet restriction
        // with a value of 18 to int
        OWLDataRange greaterThan18 = df.getOWLDatatypeRestriction(
                df.getIntegerOWLDatatype(), OWLFacet.MIN_INCLUSIVE,
View Full Code Here

        // Custom data ranges can be built up from these basic datatypes
        // Get hold of a literal that is an integer value 18
        OWLLiteral eighteen = df.getOWLLiteral(18);
        OWLDatatypeRestriction integerGE18 = df.getOWLDatatypeRestriction(
                integer, OWLFacet.MIN_INCLUSIVE, eighteen);
        OWLDataProperty hasAge = df
                .getOWLDataProperty(IRI
                        .create("http://www.semanticweb.org/ontologies/dataranges#hasAge"));
        OWLDataPropertyRangeAxiom rangeAxiom = df.getOWLDataPropertyRangeAxiom(
                hasAge, integerGE18);
        OWLOntology o = m.createOntology(IRI
View Full Code Here

        OWLNamedIndividual ql = df.getOWLNamedIndividual(qlIRI);
        OWLNamedIndividual rl = df.getOWLNamedIndividual(rlIRI);
        OWLObjectProperty speciesProperty = df.getOWLObjectProperty(species);
        OWLNamedIndividual full = df.getOWLNamedIndividual(fullIRI);
        OWLNamedIndividual dl = df.getOWLNamedIndividual(dlIRI);
        OWLDataProperty rdfXMLPremiseOntologyProperty = df
                .getOWLDataProperty(premiseIRI);
        for (OWLClassAssertionAxiom ax : testCasesOntology
                .getClassAssertionAxioms(profileIdentificationTestClass)) {
            OWLIndividual ind = ax.getIndividual();
            Collection<OWLLiteral> vals = values(
View Full Code Here

    }

    @Test
    public void testFunctionalDataProperty() {
        OWLOntology ont = getOWLOntology("Ont");
        OWLDataProperty prop = DataProperty(iri("prop"));
        assertFalse(isFunctional(prop, ont));
        OWLAxiom ax = FunctionalDataProperty(prop);
        m.addAxiom(ont, ax);
        assertTrue(isFunctional(prop, ont));
    }
View Full Code Here

        OWLObjectPropertyAssertionAxiom propertyAssertion = df
                .getOWLObjectPropertyAssertionAxiom(hasWife, john, mary);
        m.addAxiom(o, propertyAssertion);
        // Now let's specify that :John is aged 51.
        // Get hold of a data property called :hasAge
        OWLDataProperty hasAge = df.getOWLDataProperty(":hasAge", pm);
        // To specify that :John has an age of 51 we create a data property
        // assertion and add it to the ontology
        OWLDataPropertyAssertionAxiom dataPropertyAssertion = df
                .getOWLDataPropertyAssertionAxiom(hasAge, john, 51);
        m.addAxiom(o, dataPropertyAssertion);
View Full Code Here

    @Test
    public void shouldRoundTrip() throws Exception {
        OWLClass c = Class(IRI("urn:test#C"));
        OWLClass d = Class(IRI("urn:test#D"));
        OWLObjectProperty p = ObjectProperty(IRI("urn:test#p"));
        OWLDataProperty q = DataProperty(IRI("urn:test#q"));
        OWLIndividual i = AnonymousIndividual();
        OWLOntology ontology = m.createOntology();
        List<OWLOntologyChange> 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 testRoundTripWithAnonymousIndividuals() throws Exception {
        String ns = "http://test.com/genid#";
        IRI ont = IRI.create(ns + "ontology.owl");
        OWLNamedIndividual i = df.getOWLNamedIndividual(IRI.create(ns, "i"));
        OWLObjectProperty p = df.getOWLObjectProperty(IRI.create(ns, "p"));
        OWLDataProperty q = df.getOWLDataProperty(IRI.create(ns, "q"));
        OWLOntology ontology = m.createOntology(ont);
        OWLIndividual ind = df.getOWLAnonymousIndividual();
        OWLObjectPropertyAssertionAxiom ax1 = df
                .getOWLObjectPropertyAssertionAxiom(p, i, ind);
        OWLDataPropertyAssertionAxiom ax2 = df
View Full Code Here

        return ont2;
    }

    // @Test
    public void checkVerify() {
        OWLDataProperty t = df.getOWLDataProperty(IRI.create("urn:test#t"));
        Set<OWLAxiom> ax1 = new HashSet<>();
        ax1.add(df.getOWLDataPropertyAssertionAxiom(t,
                df.getOWLAnonymousIndividual(), df.getOWLLiteral("test1")));
        ax1.add(df.getOWLDataPropertyAssertionAxiom(t,
                df.getOWLAnonymousIndividual(), df.getOWLLiteral("test2")));
View Full Code Here

    public void testDataPropertyAccessor() {
        OWLOntology ont = getOWLOntology("ontology");
        OWLAnnotationAssertionAxiom ax = createAnnotationAssertionAxiom();
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.getAnnotationAssertionAxioms(SUBJECT).contains(ax));
        OWLDataProperty cls = DataProperty(SUBJECT);
        Set<OWLAnnotationAssertionAxiom> axioms = ont
                .getAnnotationAssertionAxioms(cls.getIRI());
        assertTrue(axioms.contains(ax));
        assertTrue(annotations(axioms).contains(ax.getAnnotation()));
    }
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.