Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLLiteral


        for (OWLOntology ont : ontology2EntityMap.keySet()) {
            assert ont != null;
            for (OWLEntity ent : ontology2EntityMap.get(ont)) {
                assert ent != null;
                String shortForm = shortFormProvider.getShortForm(ent);
                OWLLiteral con;
                if (languageTag != null) {
                    con = ontologyManager.getOWLDataFactory().getOWLLiteral(
                            shortForm, languageTag);
                } else {
                    con = ontologyManager.getOWLDataFactory().getOWLLiteral(
View Full Code Here


                .getAnnotationAssertionAxioms(subj);
        boolean okDeprecated = false;
        for (OWLAnnotationAssertionAxiom aa : aas) {
            if (aa.getProperty().getIRI()
                    .equals(OWLRDFVocabulary.OWL_DEPRECATED.getIRI())) {
                OWLLiteral v = (OWLLiteral) aa.getValue();
                if (v.isBoolean()) {
                    if (v.parseBoolean()) {
                        okDeprecated = true;
                    }
                }
            }
        }
View Full Code Here

        for (OWLAnnotationAssertionAxiom a : aaas) {
            if (a.getProperty()
                    .getIRI()
                    .toString()
                    .equals("http://www.geneontology.org/formats/oboInOwl#shorthand")) {
                OWLLiteral v = (OWLLiteral) a.getValue();
                if (v.getLiteral().equals("has_part")) {
                    ok = true;
                }
            }
        }
        assertTrue(!aaas.isEmpty());
View Full Code Here

                            configuration);
                    owlOntologyManager
                            .applyChange(new AddImport(ontology, decl));
                } else {
                    // Ontology annotations
                    OWLLiteral con = getDataFactory().getOWLLiteral(
                            unescapeTagValue(value));
                    OWLAnnotationProperty property = getDataFactory()
                            .getOWLAnnotationProperty(getIRIFromTagName(tag));
                    OWLAnnotation anno = getDataFactory().getOWLAnnotation(
                            property, con);
                    owlOntologyManager.applyChange(new AddOntologyAnnotation(
                            ontology, anno));
                }
            } else if (currentId != null) {
                // Add as annotation
                if (configuration.isLoadAnnotationAxioms()) {
                    IRI subject = getIRI(currentId);
                    OWLLiteral con = getDataFactory().getOWLLiteral(
                            unescapeTagValue(value));
                    IRI annotationPropertyIRI = getIRIFromTagName(tag);
                    OWLAnnotationProperty property = getDataFactory()
                            .getOWLAnnotationProperty(annotationPropertyIRI);
                    OWLAnnotation anno = getDataFactory().getOWLAnnotation(
View Full Code Here

                    LOGGER.warn(
                            "Possible malformed list: cannot translate it {}",
                            firstResource);
                }
            } else {
                OWLLiteral literal = consumer.getFirstLiteral(current);
                if (literal != null) {
                    O translate = translator.translate(literal);
                    if (translate != null) {
                        list.add(translate);
                    }
View Full Code Here

    @Test
    public void testVersionInfo() throws OWLException {
        OWLOntologyManager m = create();
        OWLOntology o = loadPizzaOntology(m);
        // We want to add a comment to the pizza class.
        OWLLiteral lit = df.getOWLLiteral("Added a comment to the pizza class");
        // create an annotation to pair a URI with the constant
        OWLAnnotationProperty owlAnnotationProperty = df
                .getOWLAnnotationProperty(OWLRDFVocabulary.OWL_VERSION_INFO
                        .getIRI());
        OWLAnnotation anno = df.getOWLAnnotation(owlAnnotationProperty, lit);
View Full Code Here

            // Get the annotations on the class that use the label property
            for (OWLAnnotation annotation : annotations(
                    o.getAnnotationAssertionAxioms(cls.getIRI()),
                    df.getRDFSLabel())) {
                if (annotation.getValue() instanceof OWLLiteral) {
                    OWLLiteral val = (OWLLiteral) annotation.getValue();
                    // look for portuguese labels
                    if (val.hasLang("pt")) {
                        assertNotNull(val.getLiteral());
                        // System.out.println(cls + " labelled " +
                        // val.getLiteral());
                    }
                }
            }
View Full Code Here

            return consumer.isRestriction(node);
        }

        protected boolean isNonNegativeIntegerStrict(IRI mainNode,
                OWLRDFVocabulary predicate) {
            OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate,
                    false);
            if (literal == null) {
                return false;
            }
            OWLDatatype datatype = literal.getDatatype();
            OWL2Datatype nni = OWL2Datatype.XSD_NON_NEGATIVE_INTEGER;
            return datatype.getIRI().equals(nni.getIRI())
                    && nni.isInLexicalSpace(literal.getLiteral());
        }
View Full Code Here

        OWLDatatype booleanDatatype = df.getBooleanOWLDatatype();
        // The top datatype is rdfs:Literal
        OWLDatatype rdfsLiteral = df.getTopDatatype();
        // 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"));
View Full Code Here

                    && nni.isInLexicalSpace(literal.getLiteral());
        }

        protected boolean isNonNegativeIntegerLax(IRI mainNode,
                OWLRDFVocabulary predicate) {
            OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate,
                    false);
            if (literal == null) {
                return false;
            }
            return OWL2Datatype.XSD_INTEGER
                    .isInLexicalSpace(verifyNotNull(literal.getLiteral().trim()));
        }
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.