Package org.apache.marmotta.kiwi.persistence

Examples of org.apache.marmotta.kiwi.persistence.KiWiConnection.loadLiteral()


                    if(result == null) {
                        result= new KiWiBooleanLiteral(bvalue, rtype);
                    }
                } else {
                    result = connection.loadLiteral(value.toString(), lang, rtype);

                    if(result == null) {
                        result = new KiWiStringLiteral(value.toString(), locale, rtype);
                    }
                }
View Full Code Here


            } catch(IllegalArgumentException ex) {
                // malformed number or date
                log.warn("malformed argument for typed literal of type {}: {}", rtype.stringValue(), value);
                KiWiUriResource mytype = (KiWiUriResource)createURI(Namespaces.NS_XSD+"string");

                result = connection.loadLiteral(value.toString(), lang, mytype);

                if(result == null) {
                    result = new KiWiStringLiteral(value.toString(), locale, mytype);
                }
View Full Code Here

                    dvalue = (Date)value;
                } else {
                    dvalue = DateUtils.parseDate(value.toString());
                }

                result = connection.loadLiteral(dvalue);

                if(result == null) {
                    result= new KiWiDateLiteral(dvalue, rtype);
                }
            } else if(Integer.class.equals(value.getClass()) || int.class.equals(value.getClass())  ||
View Full Code Here

                } else {
                    ivalue = Long.parseLong(value.toString());
                }


                result = connection.loadLiteral(ivalue);

                if(result == null) {
                    result= new KiWiIntLiteral(ivalue, rtype);
                }
            } else if(Double.class.equals(value.getClass())   || double.class.equals(value.getClass())  ||
View Full Code Here

                } else {
                    dvalue = Double.parseDouble(value.toString());
                }


                result = connection.loadLiteral(dvalue);

                if(result == null) {
                    result= new KiWiDoubleLiteral(dvalue, rtype);
                }
            } else if(Boolean.class.equals(value.getClass())   || boolean.class.equals(value.getClass())  ||
View Full Code Here

                } else {
                    bvalue = Boolean.parseBoolean(value.toString());
                }


                result = connection.loadLiteral(bvalue);

                if(result == null) {
                    result= new KiWiBooleanLiteral(bvalue, rtype);
                }
            } else {
View Full Code Here

                if(result == null) {
                    result= new KiWiBooleanLiteral(bvalue, rtype);
                }
            } else {
                result = connection.loadLiteral(value.toString(), lang, rtype);

                if(result == null) {
                    result = new KiWiStringLiteral(value.toString(), locale, rtype);
                }
            }
View Full Code Here

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(literal,testLiteral2);
            Assert.assertTrue(literal == testLiteral2);

            KiWiNode testLiteral3 = connection.loadLiteral(literal.stringValue(), null, stype);

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(literal,testLiteral3);
            Assert.assertTrue(literal == testLiteral3);
View Full Code Here

            // needs to be equal, but now it should not be the same object!
            Assert.assertEquals(literal,testLiteral4);
            Assert.assertTrue(literal != testLiteral4);

            KiWiNode testLiteral5 = connection.loadLiteral(literal.stringValue(),null,stype);

            // needs to be equal, but now it should not be the same object!
            Assert.assertEquals(literal,testLiteral5);
            Assert.assertTrue(literal != testLiteral5);
View Full Code Here

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(literal,testLiteral2);
            Assert.assertTrue(literal == testLiteral2);

            KiWiNode testLiteral3 = connection.loadLiteral(literal.stringValue(),Locale.ENGLISH.getLanguage(),null);

            // needs to be equal, and should also be the identical object!
            Assert.assertEquals(literal,testLiteral3);
            Assert.assertTrue(literal == testLiteral3);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.