Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLLiteral


                    .isInLexicalSpace(verifyNotNull(literal.getLiteral().trim()));
        }

        protected int
                translateInteger(IRI mainNode, OWLRDFVocabulary predicate) {
            OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate,
                    true);
            if (literal == null) {
                return 0;
            }
            try {
                return Integer.parseInt(literal.getLiteral().trim());
            } catch (NumberFormatException e) {
                return 0;
            }
        }
View Full Code Here


        @Override
        public OWLDataHasValue translate(@Nonnull IRI mainNode) {
            getConsumer().consumeTriple(mainNode, RDF_TYPE.getIRI(),
                    OWL_RESTRICTION.getIRI());
            OWLLiteral lit = getConsumer().getLiteralObject(mainNode,
                    OWL_HAS_VALUE, true);
            assert lit != null;
            IRI propertyIRI = getConsumer().getResourceObject(mainNode,
                    OWL_ON_PROPERTY, true);
            assert propertyIRI != null;
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        OWLAnnotationProperty prop = AnnotationProperty(iri("prop"));
        OWLLiteral lit = Literal("Test", "");
        OWLAnnotation anno1 = df.getOWLAnnotation(prop, lit);
        OWLAnnotationProperty prop2 = AnnotationProperty(iri("prop2"));
        OWLAnnotation anno2 = df.getOWLAnnotation(prop2, lit);
        Set<OWLAnnotation> annos = new HashSet<>();
        // Add two annotations per axiom
View Full Code Here

        assertTrue(ont.containsAxiom(axiom, EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }

    @Test
    public void testOntologyContainsAnnotatedAxiom() {
        OWLLiteral annoLiteral = Literal("value");
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        OWLAnnotation anno = Annotation(annoProp, annoLiteral);
        OWLAxiom axiom = SubClassOf(Class(iri("A")), Class(iri("B")),
                singleton(anno));
        OWLOntology ont = getOWLOntology("testont");
View Full Code Here

public class AnnotationPropertyReferencesTestCase extends TestBase {

    @Test
    public void testContainsReferenceForAnnotationAssertion() {
        OWLAnnotationProperty ap = AnnotationProperty(iri("prop"));
        OWLLiteral val = Literal("Test", "");
        OWLAnnotationSubject subject = Class(iri("A")).getIRI();
        OWLAnnotationAssertionAxiom ax = AnnotationAssertion(ap, subject, val);
        OWLOntology ont = getOWLOntology("Ont");
        ont.getOWLOntologyManager().addAxiom(ont, ax);
        assertTrue(ont.containsAnnotationPropertyInSignature(ap.getIRI(),
View Full Code Here

    }

    @Test
    public void testContainsReferenceForAxiomAnnotation() {
        OWLAnnotationProperty ap = AnnotationProperty(iri("prop"));
        OWLLiteral val = Literal("Test", "");
        OWLAnnotation anno = df.getOWLAnnotation(ap, val);
        OWLSubClassOfAxiom ax = df.getOWLSubClassOfAxiom(Class(iri("A")),
                Class(iri("B")), singleton(anno));
        OWLOntology ont = getOWLOntology("Ont");
        ont.getOWLOntologyManager().addAxiom(ont, ax);
View Full Code Here

    }

    @Test
    public void testContainsReferenceForOntologyAnnotation() {
        OWLAnnotationProperty ap = AnnotationProperty(iri("prop"));
        OWLLiteral val = Literal("Test");
        OWLAnnotation anno = df.getOWLAnnotation(ap, val);
        OWLOntology ont = getOWLOntology("Ont");
        ont.getOWLOntologyManager().applyChange(
                new AddOntologyAnnotation(ont, anno));
        assertTrue(ont.containsAnnotationPropertyInSignature(anno.getProperty()
View Full Code Here

    @Override
    protected OWLOntology createOntology() {
        try {
            OWLOntology ont = m.createOntology();
            OWLAnnotationProperty prop = AnnotationProperty(IRI("http://www.semanticweb.org/ontologies/test/annotationont#prop"));
            OWLLiteral value = Literal(33);
            OWLAnnotation annotation = df.getOWLAnnotation(prop, value);
            ont.getOWLOntologyManager().applyChange(
                    new AddOntologyAnnotation(ont, annotation));
            ont.getOWLOntologyManager().addAxiom(ont, Declaration(prop));
            return ont;
View Full Code Here

    @Nonnull
    @Override
    protected Set<OWLAxiom> getAxioms() {
        OWLIndividual subj = createIndividual();
        OWLDataProperty prop = createDataProperty();
        OWLLiteral obj = df.getOWLLiteral("TestConstant");
        OWLAxiom ax = df.getOWLNegativeDataPropertyAssertionAxiom(prop, subj,
                obj);
        return singleton(ax);
    }
View Full Code Here

        OWLClass clsA = Class(IRI("http://ont.com#A"));
        OWLClass clsB = Class(IRI("http://ont.com#B"));
        OWLSubClassOfAxiom sca = SubClassOf(clsA, clsB);
        m.addAxiom(ont, sca);
        OWLAnnotationProperty rdfsComment = RDFSComment();
        OWLLiteral lit = Literal("Hello world");
        OWLAnnotationAssertionAxiom annoAx1 = AnnotationAssertion(rdfsComment,
                clsA.getIRI(), lit);
        m.addAxiom(ont, annoAx1);
        OWLAnnotationPropertyDomainAxiom annoAx2 = df
                .getOWLAnnotationPropertyDomainAxiom(rdfsComment, clsA.getIRI());
View Full Code Here

TOP

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

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.