Examples of OWLDataProperty


Examples of org.semanticweb.owlapi.model.OWLDataProperty

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLDataRange dr = Integer();
        OWLClass base = Class(iri("A"));
        axioms.add(SubClassOf(base, DataExactCardinality(3, prop, dr)));
        return axioms;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

    @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\"\nStuff");
        axioms.add(DataPropertyAssertion(prop, ind, literal));
        return axioms;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

    @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, DataSomeValuesFrom(propP, dt)));
        axioms.add(Declaration(dt));
        axioms.add(Declaration(propP));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange intdr = df.getIntegerOWLDatatype();
        OWLDataRange floatdr = df.getFloatOWLDatatype();
        OWLDataRange intersection = df.getOWLDataIntersectionOf(intdr, floatdr);
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = df.getOWLDataPropertyRangeAxiom(p,
                intersection);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

        // properties etc. For example, if we want to restrict the range of the
        // :hasAge data property to 18 or more we specify its range as this data
        // range
        PrefixManager pm = new DefaultPrefixManager(null, null,
                "http://www.semanticweb.org/ontologies/dataranges#");
        OWLDataProperty hasAge = factory.getOWLDataProperty(":hasAge", pm);
        OWLDataPropertyRangeAxiom rangeAxiom = factory
                .getOWLDataPropertyRangeAxiom(hasAge, integerGE18);
        OWLOntology ontology = manager.createOntology(IRI
                .create("http://www.semanticweb.org/ontologies/dataranges"));
        // Add the range axiom to our ontology
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

        // an age greater than 18. To do this, we will create a restriction
        // along a hasAge property, with a filler that corresponds to the set of
        // integers greater than 18. First get a reference to our hasAge
        // property
        OWLDataFactory factory = man.getOWLDataFactory();
        OWLDataProperty hasAge = factory.getOWLDataProperty(IRI.create(base
                + "hasAge"));
        // For completeness, we will make hasAge functional by adding an axiom
        // to state this
        OWLFunctionalDataPropertyAxiom funcAx = factory
                .getOWLFunctionalDataPropertyAxiom(hasAge);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

        OWLObjectPropertyAssertionAxiom propertyAssertion = factory
                .getOWLObjectPropertyAssertionAxiom(hasWife, john, mary);
        manager.addAxiom(ontology, propertyAssertion);
        // Now let's specify that :John is aged 51. Get hold of a data property
        // called :hasAge
        OWLDataProperty hasAge = factory.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 = factory
                .getOWLDataPropertyAssertionAxiom(hasAge, john, 51);
        manager.addAxiom(ontology, dataPropertyAssertion);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

        OWLAxiom axiom3 = factory.getOWLObjectPropertyAssertionAxiom(
                hasDaughter, john, susan);
        manager.applyChange(new AddAxiom(ont, axiom3));
        // John hasAge 33 In this case, hasAge is a data property, which we need
        // a reference to
        OWLDataProperty hasAge = factory.getOWLDataProperty(IRI
                .create(ontologyIRI + "#hasAge"));
        // We create a data property assertion instead of an object property
        // assertion
        OWLAxiom axiom4 = factory.getOWLDataPropertyAssertionAxiom(hasAge,
                john, 33);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLDataRange oneOf = DataOneOf(Literal(30), Literal(31f));
        OWLDataProperty p = DataProperty(iri("p"));
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(p, oneOf);
        axioms.add(ax);
        axioms.add(Declaration(p));
        assertEquals(getOnt().getAxioms(), axioms);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataProperty

        assertSame(call1, call2);
    }

    @Test
    public void getOWLTopDataProperty() {
        OWLDataProperty call1 = dataFactory.getOWLTopDataProperty();
        OWLDataProperty call2 = dataFactory.getOWLTopDataProperty();
        assertSame(call1, call2);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.