Package org.openrdf.model

Examples of org.openrdf.model.URI.stringValue()


                        response.getMetadata().add("Links", s);
                    }
                    return response;
                } else {
                    ImmutableMap<String, String> headers = ImmutableMap.of("Content-Type", ResourceWebServiceHelper.appendContentTypes(contentService.getContentType(resource)));
                    throw new HttpErrorException(Status.NOT_ACCEPTABLE, resource.stringValue(), "no content for mimetype " + mimetype, headers);
                }
            } finally {
                conn.close();
            }
        } catch (IOException e) {
View Full Code Here


                log.warn("User {} exists. This should not happen as it was checked 3 lines before!", login);
                webid = userService.getUser(login);
            }
        }

        UserAccount account = new UserAccount(login, webid.stringValue());

        save(account);

        return account;
    }
View Full Code Here

    private void testPostPutDeleteBase(RDFFormat format) throws Exception {
        URI resource1 = randomResource();

        // create resource 1 with empty body and expect that we can afterwards retrieve it (even if empty triples)
        expect().statusCode(201).when().post(resource1.stringValue());
        // TODO: at the moment we will return 404 because we have no way to check for existance of a resource without triples
        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(404).when().get(resource1.stringValue());


        // create resource 2 with some triples that we generate randomly in a temporary repository
View Full Code Here

        URI resource1 = randomResource();

        // create resource 1 with empty body and expect that we can afterwards retrieve it (even if empty triples)
        expect().statusCode(201).when().post(resource1.stringValue());
        // TODO: at the moment we will return 404 because we have no way to check for existance of a resource without triples
        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(404).when().get(resource1.stringValue());


        // create resource 2 with some triples that we generate randomly in a temporary repository
        Repository mem = new SailRepository(new MemoryStore());
        mem.initialize();
View Full Code Here

                    .header("Content-Type", format.getDefaultMIMEType())
                    .body(body)
            .expect()
                    .statusCode(200)
            .when()
                    .put(resource1.stringValue());




            // now check in the Marmotta triple store if all triples are there
View Full Code Here

        } finally {
            con.close();
            mcon.close();
        }

        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(200).when().get(resource1.stringValue());


        // test if we can delete the resource and then it is no longer there
        expect().statusCode(200).when().delete(resource1.stringValue());
        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(404).when().get(resource1.stringValue());
View Full Code Here

        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(200).when().get(resource1.stringValue());


        // test if we can delete the resource and then it is no longer there
        expect().statusCode(200).when().delete(resource1.stringValue());
        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(404).when().get(resource1.stringValue());

        RepositoryConnection mcon2 = sesameService.getConnection();
        try {
            Assert.assertFalse("resource was not properly deleted", mcon2.hasStatement(resource1,null,null,true));
View Full Code Here

        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(200).when().get(resource1.stringValue());


        // test if we can delete the resource and then it is no longer there
        expect().statusCode(200).when().delete(resource1.stringValue());
        given().header("Accept",format.getDefaultMIMEType()).expect().statusCode(404).when().get(resource1.stringValue());

        RepositoryConnection mcon2 = sesameService.getConnection();
        try {
            Assert.assertFalse("resource was not properly deleted", mcon2.hasStatement(resource1,null,null,true));
        } finally {
View Full Code Here

        try {
            URI user = userService.createUser(login);
            Assert.assertNotNull(user);
            Assert.assertFalse(userService.isAnonymous(user));
            Assert.assertTrue(user.stringValue().endsWith(login));
            Assert.assertTrue(userService.userExists(login));
            Assert.assertNotNull(userService.getUser(login));
        } catch (UserExistsException ex) {
            Assert.fail(ex.getMessage());
        }
View Full Code Here

        try {
            URI user = userService.createUser(login);
            Assert.assertNotNull(user);
            Assert.assertFalse(userService.isAnonymous(user));
            Assert.assertTrue(user.stringValue().endsWith(login));
            Assert.assertTrue(userService.userExists(login));
            Assert.assertNotNull(userService.getUser(login));
        } catch (UserExistsException ex) {
            Assert.fail(ex.getMessage());
        }
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.