Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLLiteral


        String propId = getIdentifier(prop);
        addQualifiers(clause, qualifiers);
        if (!propId.equals("shorthand")) {
            clause.addValue(propId);
            if (annVal instanceof OWLLiteral) {
                OWLLiteral owlLiteral = (OWLLiteral) annVal;
                clause.addValue(owlLiteral.getLiteral());
                OWLDatatype datatype = owlLiteral.getDatatype();
                IRI dataTypeIri = datatype.getIRI();
                if (!OWL2Datatype.isBuiltIn(dataTypeIri)) {
                    error("Untranslatable axiom due to unknown data type: "
                            + annVal, true);
                    return false;
View Full Code Here


            negative = true;
        }
        String prop = peekToken();
        if (isDataPropertyName(prop)) {
            OWLDataProperty p = parseDataProperty();
            OWLLiteral con = parseLiteral(null);
            if (!negative) {
                return dataFactory
                        .getOWLDataPropertyAssertionAxiom(p, ind, con);
            } else {
                return dataFactory.getOWLNegativeDataPropertyAssertionAxiom(p,
View Full Code Here

        return dataFactory.getSWRLVariable(var);
    }

    @Nonnull
    private SWRLLiteralArgument parseLiteralObject() {
        OWLLiteral lit = parseLiteral(null);
        return dataFactory.getSWRLLiteralArgument(lit);
    }
View Full Code Here

            for (OWLAnnotation ann : ax.getAnnotations()) {
                OWLAnnotationProperty p = ann.getProperty();
                if (p.getIRI()
                        .equals(IRI
                                .create("http://www.geneontology.org/formats/oboInOwl#hasDbXref"))) {
                    OWLLiteral v = (OWLLiteral) ann.getValue();
                    // expect this twice, as we have annotations on synonyms
                    if (v.getLiteral().equals("BTO:0001750")) {
                        n++;
                    }
                    if (v.getLiteral().equals("Wikipedia:Mandibular_condyle")) {
                        n++;
                    }
                }
            }
        }
View Full Code Here

                        OWLAnnotationProperty property = owlAnnotation
                                .getProperty();
                        if (property.getIRI().equals(isInferredIRI)) {
                            OWLAnnotationValue value = owlAnnotation.getValue();
                            if (value instanceof OWLLiteral) {
                                OWLLiteral literal = (OWLLiteral) value;
                                assertEquals("true", literal.getLiteral());
                            } else {
                                fail("The value is not the expected type, expected OWLiteral but was: "
                                        + value.getClass().getName());
                            }
                            hasAnnotation = true;
View Full Code Here

            return dataFactory.getOWLDataSomeValuesFrom(prop, rng);
        } else if (ONLY.matches(kw)) {
            OWLDataRange rng = parseDataRange();
            return dataFactory.getOWLDataAllValuesFrom(prop, rng);
        } else if (VALUE.matches(kw)) {
            OWLLiteral con = parseLiteral(null);
            return dataFactory.getOWLDataHasValue(prop, con);
        } else if (MIN.matches(kw)) {
            int card = parseInteger();
            OWLDataRange rng = parseDataRange();
            return dataFactory.getOWLDataMinCardinality(card, prop, rng);
View Full Code Here

                    OWLFacet fv = parseFacet();
                    if (fv == null) {
                        throw new ExceptionBuilder().withKeyword(
                                OWLFacet.getFacets()).build();
                    }
                    OWLLiteral con = parseLiteral(datatype);
                    facetRestrictions.add(dataFactory.getOWLFacetRestriction(
                            fv, con));
                    sep = consumeToken();
                }
                if (!CLOSEBRACKET.matches(sep)) {
View Full Code Here

    private OWLDataRange parseDataOneOf() {
        consumeToken();
        Set<OWLLiteral> cons = new HashSet<>();
        String sep = COMMA.keyword();
        while (COMMA.matches(sep)) {
            OWLLiteral con = parseLiteral(null);
            cons.add(con);
            sep = consumeToken();
        }
        if (!CLOSEBRACE.matches(sep)) {
            throw new ExceptionBuilder().withKeyword(COMMA, CLOSEBRACE).build();
View Full Code Here

            anno = dataFactory.getOWLAnnotation(annoProp, value);
        } else if (obj.startsWith("<")) {
            IRI value = parseIRI();
            anno = dataFactory.getOWLAnnotation(annoProp, value);
        } else {
            OWLLiteral con = parseLiteral(null);
            anno = dataFactory.getOWLAnnotation(annoProp, con);
        }
        return anno;
    }
View Full Code Here

        body.add(df.getSWRLClassAtom(Class(iri("D")), indIArg));
        body.add(df.getSWRLClassAtom(Class(iri("B")), varX));
        SWRLVariable varQ = df.getSWRLVariable(IRI("urn:swrl#q"));
        SWRLVariable varR = df.getSWRLVariable(IRI("urn:swrl#r"));
        body.add(df.getSWRLDataPropertyAtom(DataProperty(iri("d")), varX, varQ));
        OWLLiteral lit = Literal(33);
        SWRLLiteralArgument litArg = df.getSWRLLiteralArgument(lit);
        body.add(df.getSWRLDataPropertyAtom(DataProperty(iri("d")), varY,
                litArg));
        Set<SWRLAtom> head = new HashSet<>();
        head.add(df.getSWRLClassAtom(Class(iri("C")), varX));
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.