Examples of storeNode()


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

    public void testStoreBNode() throws SQLException {
        KiWiConnection connection = persistence.getConnection();
        try {
            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiAnonResource bnode = new KiWiAnonResource(RandomStringUtils.randomAlphanumeric(8));
            connection.storeNode(bnode);

            // check if it then has a database ID
            Assert.assertTrue(bnode.getId() >= 0);

            KiWiNode testBNode1 = connection.loadNodeById(bnode.getId());
View Full Code Here

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

    @Test
    public void testStoreStringLiteralNoType() throws SQLException {
        KiWiConnection connection = persistence.getConnection();
        try {
            KiWiUriResource   stype   = new KiWiUriResource(Namespaces.NS_XSD+"string");
            connection.storeNode(stype);

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8),null,stype);
            connection.storeNode(literal);
View Full Code Here

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

            KiWiUriResource   stype   = new KiWiUriResource(Namespaces.NS_XSD+"string");
            connection.storeNode(stype);

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8),null,stype);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertTrue(literal.getId() >= 0);

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

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

    @Test
    public void testStoreStringLiteralLanguage() throws SQLException {
        KiWiConnection connection = persistence.getConnection();
        try {
            KiWiUriResource   stype   = new KiWiUriResource(getRDFLangStringType());
            connection.storeNode(stype);

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8), Locale.ENGLISH, stype);
            connection.storeNode(literal);
View Full Code Here

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

            KiWiUriResource   stype   = new KiWiUriResource(getRDFLangStringType());
            connection.storeNode(stype);

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8), Locale.ENGLISH, stype);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertTrue(literal.getId() >= 0);

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

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

        try {
            KiWiUriResource uri = new KiWiUriResource("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(8), null, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertTrue(literal.getId() >= 0);

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

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

        try {
            KiWiUriResource uri = new KiWiUriResource("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiStringLiteral literal = new KiWiStringLiteral(RandomStringUtils.randomAlphanumeric(16384), null, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertTrue(literal.getId() >= 0);

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

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

            Random rnd = new Random();
            long value = rnd.nextLong();

                    // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiIntLiteral literal = new KiWiIntLiteral(value, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertTrue(literal.getId() >= 0);

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

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

            Random rnd = new Random();
            double value = rnd.nextDouble();

            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiDoubleLiteral literal = new KiWiDoubleLiteral(value, uri);
            connection.storeNode(literal);

            // check if it then has a database ID
            Assert.assertTrue(literal.getId() >= 0);

            KiWiNode testLiteral1 = connection.loadNodeById(literal.getId());
View Full Code Here

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

    public void testStoreUriNode() throws SQLException {
        KiWiConnection connection = persistence.getConnection();
        try {
            // add a new URI to the triple store and check if it exists afterwards, before and after commit
            KiWiUriResource uri = new KiWiUriResource("http://localhost/"+ RandomStringUtils.randomAlphanumeric(8));
            connection.storeNode(uri, false);

            // check if it then has a database ID
            Assert.assertNotNull(uri.getId());

            KiWiNode testUri1 = connection.loadNodeById(uri.getId());
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.