Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Node_Literal


        assertEquals("<n1>", stringForRDFNode(new LiteralImpl(aNode(), null))) ;
    }

    @Test
    public void stringLiteral() throws Exception {
        Node_Literal nl = (Node_Literal)NodeFactory.createUncachedLiteral("abc", "no", new XSDDatatype("string")) ;
        assertEquals("\"abc\"@no^^<http://www.w3.org/2001/XMLSchema#string>", FmtUtils.stringForLiteral(nl, getContext())) ;
    }
View Full Code Here


        assertEquals("\"abc\"@no^^<http://www.w3.org/2001/XMLSchema#string>", FmtUtils.stringForLiteral(nl, getContext())) ;
    }

    @Test
    public void integerLiteral() throws Exception {
        Node_Literal nl = (Node_Literal)NodeFactory.createUncachedLiteral("2", new XSDDatatype("int")) ;
        assertEquals("\"2\"^^<http://www.w3.org/2001/XMLSchema#int>", FmtUtils.stringForLiteral(nl, getContext())) ;
    }
View Full Code Here

        assertEquals("\"2\"^^<http://www.w3.org/2001/XMLSchema#int>", FmtUtils.stringForLiteral(nl, getContext())) ;
    }

    @Test
    public void doubleLiteral() throws Exception {
        Node_Literal nl = (Node_Literal)NodeFactory.createUncachedLiteral("2.1e2", new XSDDatatype("double")) ;
        assertEquals("2.1e2", FmtUtils.stringForLiteral(nl, getContext())) ;
    }
View Full Code Here

        assertEquals("2.1e2", FmtUtils.stringForLiteral(nl, getContext())) ;
    }

    @Test
    public void decimalLiteral() throws Exception {
        Node_Literal nl = (Node_Literal)NodeFactory.createUncachedLiteral("2.4", new XSDDatatype("decimal")) ;
        assertEquals("2.4", FmtUtils.stringForLiteral(nl, getContext())) ;
    }
View Full Code Here

        assertEquals("2.4", FmtUtils.stringForLiteral(nl, getContext())) ;
    }

    @Test
    public void booleanLiteral() throws Exception {
        Node_Literal nl = (Node_Literal)NodeFactory.createUncachedLiteral("false", new XSDDatatype("boolean")) ;
        assertEquals("false", FmtUtils.stringForLiteral(nl, getContext())) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Node_Literal

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.