Package org.openrdf.model

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


            String language = lit.getLanguage();
            if (language == null) language = "";
            else language = "@"+language;
            URI datatype = lit.getDatatype();
            String datatypeString = "";
            if (datatype != null) datatypeString = "^^<"+datatype.stringValue()+">";
            result = "\""+result+"\""+language+datatypeString;
        }
        return result;
    }
   
View Full Code Here


                ValueFactory factory = conn.getValueFactory();
                URI uri = ResourceUtils.getUriResource(conn, container);
                conn.add(uri, RDF.TYPE, factory.createURI(prefixService.getNamespace("ldp"), "Container"), context);
                conn.add(uri, RDFS.LABEL, factory.createLiteral(title), context);
                conn.add(uri, factory.createURI(prefixService.getNamespace("dct"), "created"), factory.createLiteral(new Date()), context);
                log.info("Created new container <{}>", uri.stringValue());
                return true;
            } finally {
                conn.commit();
                conn.close();
            }
View Full Code Here

                while(result.hasNext()) {
                    Resource next = result.next();
                    if(next instanceof URI) {
                        URI uri = (URI)next;
                        if (filter) {
                            if (uri.stringValue().startsWith(configurationService.getBaseContext())) {
                                contexts.add(uri);
                            }
                        } else {
                            contexts.add(uri);
                        }
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

                    RepositoryConnection conn = sesameService.getConnection();
                    try {
                        conn.begin();
                        URI webId = conn.getValueFactory().createURI(webId_str);

                        log.info("creating user with webId: {} ", webId.stringValue());

                        if (!login.equals(ANONYMOUS_LOGIN) && !login.equals(ADMIN_LOGIN)) {
                            MarmottaUser u = FacadingFactory.createFacading(conn).createFacade(webId, MarmottaUser.class);
                            u.setFirstName(firstName);
                            u.setLastName(lastName);
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.