Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLLiteral


    @Test
    public void testSetContainsInt() {
        OWLDatatypeImpl datatype = new OWLDatatypeImpl(
                OWL2Datatype.XSD_INTEGER.getIRI());
        OWLLiteral litNoComp = new OWLLiteralImplNoCompression("3", null,
                datatype);
        OWLLiteral litNoComp2 = new OWLLiteralImplNoCompression("3", null,
                datatype);
        OWLLiteral litIntImpl = new OWLLiteralImplInteger(3, datatype);
        assertEquals(litNoComp.getLiteral(), litIntImpl.getLiteral());
        Set<OWLLiteral> lncset = new HashSet<>();
        lncset.add(litNoComp);
        assertTrue(lncset.contains(litNoComp2));
        assertTrue(lncset.contains(litIntImpl));
    }
View Full Code Here


    @Test
    public void testSetContainsDouble() {
        OWLDatatypeImpl datatype = new OWLDatatypeImpl(
                OWL2Datatype.XSD_DOUBLE.getIRI());
        OWLLiteral litNoComp = new OWLLiteralImplNoCompression("3.0", null,
                datatype);
        OWLLiteral litNoComp2 = new OWLLiteralImplNoCompression("3.0", null,
                datatype);
        OWLLiteral litIntImpl = new OWLLiteralImplDouble(3.0D, datatype);
        assertEquals(litNoComp.getLiteral(), litIntImpl.getLiteral());
        Set<OWLLiteral> lncset = new HashSet<>();
        lncset.add(litNoComp);
        assertTrue(lncset.contains(litNoComp2));
        assertTrue(lncset.contains(litIntImpl));
    }
View Full Code Here

    @Test
    public void testSetContainsFloat() {
        OWLDatatypeImpl datatype = new OWLDatatypeImpl(
                OWL2Datatype.XSD_FLOAT.getIRI());
        OWLLiteral litNoComp = new OWLLiteralImplNoCompression("3.0", null,
                datatype);
        OWLLiteral litNoComp2 = new OWLLiteralImplNoCompression("3.0", null,
                datatype);
        OWLLiteral litIntImpl = new OWLLiteralImplFloat(3.0F, datatype);
        assertEquals(litNoComp.getLiteral(), litIntImpl.getLiteral());
        Set<OWLLiteral> lncset = new HashSet<>();
        lncset.add(litNoComp);
        assertTrue(lncset.contains(litNoComp2));
        assertTrue(lncset.contains(litIntImpl));
    }
View Full Code Here

    @Test
    public void testSetContainsBoolean() {
        OWLDatatypeImpl datatype = new OWLDatatypeImpl(
                OWL2Datatype.XSD_BOOLEAN.getIRI());
        OWLLiteral litNoComp = new OWLLiteralImplNoCompression("true", null,
                datatype);
        OWLLiteral litNoComp2 = new OWLLiteralImplNoCompression("true", null,
                datatype);
        OWLLiteral litIntImpl = new OWLLiteralImplBoolean(true, datatype);
        assertEquals(litNoComp.getLiteral(), litIntImpl.getLiteral());
        Set<OWLLiteral> lncset = new HashSet<>();
        lncset.add(litNoComp);
        assertTrue(lncset.contains(litNoComp2));
        assertTrue(lncset.contains(litIntImpl));
    }
View Full Code Here

    }

    @Test
    public void shouldBuildLiteral() {
        // given
        OWLLiteral expected = df.getOWLLiteral(true);
        BuilderLiteral builder = new BuilderLiteral(expected, df);
        // when
        OWLObject built = builder.buildObject();
        // then
        assertEquals(expected, built);
View Full Code Here

        }

        @Override
        public OWLFacetRestriction translate(IRI firstObject) {
            for (OWLFacet facet : OWLFacet.values()) {
                OWLLiteral lit = consumer.getLiteralObject(firstObject,
                        facet.getIRI(), true);
                if (lit != null) {
                    return consumer.getDataFactory().getOWLFacetRestriction(
                            facet, lit);
                }
View Full Code Here

            sb.append("200 \u00B5Liters + character above U+0FFFF = ");
            sb.appendCodePoint(0x10192)// happens to be "ROMAN SEMUNCIA SIGN"
            sb.append('\n');
        }
        testString = sb.toString();
        OWLLiteral literal = Literal(testString);
        assertEquals("Out = in ? false", literal.getLiteral(), testString);
    }
View Full Code Here

    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLNamedIndividual ind = NamedIndividual(iri("i"));
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLLiteral literal = Literal("Test \"literal\"\nStuff");
        axioms.add(DataPropertyAssertion(prop, ind, literal));
        return axioms;
    }
View Full Code Here

            super(consumer, accessor);
        }

        @Override
        public boolean matchesStrict(IRI mainNode) {
            OWLLiteral literal = getConsumer().getLiteralObject(mainNode,
                    OWL_HAS_SELF.getIRI(), false);
            return literal != null && isStrictBooleanTrueLiteral(literal)
                    && isObjectPropertyStrict(mainNode, OWL_ON_PROPERTY);
        }
View Full Code Here

                                .getProperty());
                        if (langList != null) {
                            // There is no need to check if lang is null. It may
                            // well be that no
                            // lang is preferred over any other lang.
                            OWLLiteral lit = (OWLLiteral) obj;
                            int langIndex = langList.indexOf(lit.getLang());
                            if (langIndex != -1
                                    && langIndex < lastLangMatchIndex) {
                                lastLangMatchIndex = langIndex;
                                candidateValue = ax.getObject();
                            }
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.