Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLLiteral


        public void handleStreaming(@Nonnull IRI subject,
                @Nonnull IRI predicate, @Nonnull String literal, IRI datatype,
                String lang) {
            // Convert all literals to OWLConstants
            OWLLiteral con = consumer.getOWLLiteral(literal, datatype, lang);
            handleStreaming(subject, predicate, con);
        }
View Full Code Here


        OWLAnonymousIndividual anonymousIndividual = anonymousIndividualSet
                .iterator().next();
        OWLAnnotationAssertionAxiom relAx = df.getOWLAnnotationAssertionAxiom(
                relProperty, IRI.create("http://example.com/ns#test"),
                anonymousIndividual);
        OWLLiteral notVisible = df.getOWLLiteral("Not visible", "");
        OWLAnnotationAssertionAxiom predAx = df.getOWLAnnotationAssertionAxiom(
                predProperty, anonymousIndividual, notVisible);
        assertTrue("should contain relax", annotationAxioms.contains(relAx));
        assertTrue("should contain predax", annotationAxioms.contains(predAx));
    }
View Full Code Here

        IRI tagIRI = getTagIRI(tagName);
        OWLDataFactory df = getDataFactory();
        OWLAnnotationProperty annotationProperty = df
                .getOWLAnnotationProperty(tagIRI);
        String unescapedString = getUnquotedString(value);
        OWLLiteral annotationValue = df.getOWLLiteral(unescapedString);
        return df.getOWLAnnotation(annotationProperty, annotationValue);
    }
View Full Code Here

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

        OWLClass uo0 = Class(IRI("http://purl.obolibrary.org/obo/UO_0000000"));
        OWLClass uo1 = Class(IRI("http://purl.obolibrary.org/obo/UO_0000001"));
        OWLAnnotationProperty id = AnnotationProperty(IRI("http://www.geneontology.org/formats/oboInOwl#id"));
        OWLAnnotationProperty abnormalSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#abnormal_slim"));
        OWLAnnotationProperty scalarSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#scalar_slim"));
        OWLLiteral literal = Literal("Wikipedia:Wikipedia", XSD_STRING);
        OWLAnnotationProperty unitSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#unit_slim"));
        OWLAnnotationProperty absentSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#absent_slim"));
        OWLObjectProperty isUnitOf = ObjectProperty(IRI("http://purl.obolibrary.org/obo/uo#is_unit_of"));
        OWLAnnotationProperty cellQuality = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#cell_quality"));
        OWLAnnotationProperty unitGroupSlim = AnnotationProperty(IRI("http://purl.obolibrary.org/obo/uo#unit_group_slim"));
View Full Code Here

        for (OWLAnnotation owlAnnotation : annotations) {
            OWLAnnotationProperty property = owlAnnotation.getProperty();
            if (property.isComment()) {
                OWLAnnotationValue value = owlAnnotation.getValue();
                if (value instanceof OWLLiteral) {
                    OWLLiteral literal = (OWLLiteral) value;
                    comments.add(literal.getLiteral());
                }
            }
        }
        // check that all remarks have been translated to rdfs:comment
        assertEquals(remarks.size(), comments.size());
View Full Code Here

            }
            for (IRI predicate : singleValuedLitTriplesByPredicate.keySet()) {
                Map<IRI, OWLLiteral> map = singleValuedLitTriplesByPredicate
                        .get(predicate);
                for (IRI subject : map.keySet()) {
                    OWLLiteral object = map.get(subject);
                    printTriple(subject, predicate, object);
                }
            }
            for (IRI subject : new ArrayList<>(resTriplesBySubject.keySet())) {
                Map<IRI, Collection<IRI>> map = resTriplesBySubject
View Full Code Here

                        .translateToFacetRestrictionSet(facetRestrictionList);
            } else if (!configuration.isStrict()) {
                // Try the legacy encoding
                for (IRI facetIRI : OWLFacet.FACET_IRIS) {
                    assert facetIRI != null;
                    OWLLiteral val;
                    while ((val = getLiteralObject(mainNode, facetIRI, true)) != null) {
                        restrictions.add(dataFactory.getOWLFacetRestriction(
                                OWLFacet.getFacet(facetIRI), val));
                    }
                }
View Full Code Here

                    }
                    mainNodeAnnotations.add(dataFactory.getOWLAnnotation(prop,
                            val, annosOnMainNodeAnnotations));
                    resVal = getResourceObject(mainNode, predicate, true);
                }
                OWLLiteral litVal = getLiteralObject(mainNode, predicate, true);
                while (litVal != null) {
                    OWLAnnotationProperty prop = dataFactory
                            .getOWLAnnotationProperty(predicate);
                    mainNodeAnnotations.add(dataFactory.getOWLAnnotation(prop,
                            litVal, annosOnMainNodeAnnotations));
View Full Code Here

    protected OWLLiteral getLiteralObject(IRI subject, IRI predicate,
            boolean consume) {
        Map<IRI, OWLLiteral> subjPredMap = singleValuedLitTriplesByPredicate
                .get(predicate);
        if (subjPredMap != null) {
            OWLLiteral obj = subjPredMap.get(subject);
            if (consume) {
                subjPredMap.remove(subject);
            }
            return obj;
        }
        Map<IRI, Collection<OWLLiteral>> predObjMap = litTriplesBySubject
                .get(subject);
        if (predObjMap != null) {
            Collection<OWLLiteral> objects = predObjMap.get(predicate);
            if (objects != null && !objects.isEmpty()) {
                OWLLiteral object = objects.iterator().next();
                if (consume) {
                    objects.remove(object);
                }
                if (objects.isEmpty()) {
                    predObjMap.remove(predicate);
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.