Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDatatypeDefinitionAxiom


    }

    @Test
    public void shouldBuildDatatypeDefinition() {
        // given
        OWLDatatypeDefinitionAxiom expected = df.getOWLDatatypeDefinitionAxiom(
                d, df.getDoubleOWLDatatype(), annotations);
        BuilderDatatypeDefinition builder = new BuilderDatatypeDefinition(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
View Full Code Here


        // OWLDatatypeDefintionAxiom Get hold of a named datarange (datatype)
        // that will be used to assign a name to our above datatype
        OWLDatatype concessionaryAgeDatatype = factory.getOWLDatatype(
                ":ConcessionaryAge", pm);
        // Now create a datatype definition axiom
        OWLDatatypeDefinitionAxiom datatypeDef = factory
                .getOWLDatatypeDefinitionAxiom(concessionaryAgeDatatype,
                        concessionaryAge);
        // Add the definition to our ontology
        manager.addAxiom(ontology, datatypeDef);
        // Dump our ontology
View Full Code Here

        head.add(df.getSWRLClassAtom(a, x));
        OWLAnnotation ann = df.getOWLAnnotation(df.getRDFSLabel(),
                df.getOWLLiteral("test", ""));
        SWRLRule rule = df.getSWRLRule(body, head, singleton(ann));
        ontology.getOWLOntologyManager().addAxiom(ontology, rule);
        OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(
                df.getOWLDatatype(IRI.create("urn:mydatatype")),
                df.getOWLDatatypeMaxExclusiveRestriction(200D),
                singleton(df.getOWLAnnotation(df.getRDFSLabel(),
                        df.getOWLLiteral("datatype definition"))));
        ontology.getOWLOntologyManager().addAxiom(ontology, def);
View Full Code Here

    }

    @Nonnull
    OWLOntology prepareOntology1() throws OWLOntologyCreationException {
        OWLOntology ontology = m.createOntology(IRI(NS));
        OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(
                df.getOWLDatatype(IRI.create("urn:mydatatype")),
                df.getOWLDatatypeMaxExclusiveRestriction(200D),
                singleton(df.getOWLAnnotation(df.getRDFSLabel(),
                        df.getOWLLiteral("datatype definition"))));
        ontology.getOWLOntologyManager().addAxiom(ontology, def);
View Full Code Here

                + "        <owl:annotatedTarget>\n"
                + "            <rdfs:Datatype rdf:about=\"http://www.w3.org/2001/XMLSchema#double\"/>\n"
                + "        </owl:annotatedTarget>\n"
                + "    </owl:Axiom></rdf:RDF>";
        OWLOntology o = loadOntologyFromString(s);
        OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(
                df.getOWLDatatype(IRI.create("urn:mydatatype")),
                df.getDoubleOWLDatatype(),
                singleton(df.getOWLAnnotation(df.getRDFSLabel(),
                        df.getOWLLiteral("datatype definition", ""))));
        assertTrue(o.getAxioms().contains(def));
View Full Code Here

        private void translateEquivalentDataRanges(@Nonnull IRI subject,
                @Nonnull IRI predicate, @Nonnull IRI object) {
            OWLDatatype datatype = df.getOWLDatatype(subject);
            OWLDataRange dataRange = consumer.translateDataRange(object);
            OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(
                    datatype, dataRange, getPendingAnnotations());
            addAxiom(def);
            consumeTriple(subject, predicate, object);
        }
View Full Code Here

        OWLOntology o = m.createOntology(IRI
                .create("http://www.semanticweb.org/ontologies/dataranges"));
        // Add the range axiom to our ontology
        m.addAxiom(o, rangeAxiom);
        // Now create a datatype definition axiom
        OWLDatatypeDefinitionAxiom datatypeDef = df
                .getOWLDatatypeDefinitionAxiom(
                        df.getOWLDatatype(IRI
                                .create("http://www.semanticweb.org/ontologies/dataranges#age")),
                        integerGE18);
        // Add the definition to our ontology
View Full Code Here

    }


    @Override
  protected int compareObjectOfSameType(OWLObject object) {
        OWLDatatypeDefinitionAxiom other = (OWLDatatypeDefinitionAxiom) object;
        int diff = getDatatype().compareTo(other.getDatatype());
        if (diff != 0) {
            return diff;
        }
        return getDataRange().compareTo(other.getDataRange());
    }
View Full Code Here

            return true;
        }
        if (!(obj instanceof OWLDatatypeDefinitionAxiom)) {
            return false;
        }
        OWLDatatypeDefinitionAxiom other = (OWLDatatypeDefinitionAxiom) obj;
        return datatype.equals(other.getDatatype()) && dataRange.equals(other.getDataRange());
    }
View Full Code Here

TOP

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

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.