Examples of UpdateRequest


Examples of barrysoft.twinkle.UpdateRequest

      GUIEvent<UpdaterEventType> ue = (GUIEvent<UpdaterEventType>)event;
     
      switch(ue.getType()) {
      case NEW_VERSION_FOUND:       
        UpdateVersion version = ue.getDataItem(0, UpdateVersion.class);
        UpdateRequest source = ue.getDataItem(1, UpdateRequest.class);
       
        setUpdateVersion(version, source);
        break;
       
      case CHECKING_COMPLETED:
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

       
        // ---- Reset.
        UpdateAction.parseExecute("DROP ALL", graphStore) ;
       
        // ---- Read the update script, then execute, in separate two steps
        UpdateRequest request = UpdateFactory.read("update.ru") ;
        UpdateAction.execute(request, graphStore) ;

        // Write in debug format.
        System.out.println("# Debug format");
        SSE.write(graphStore) ;
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

{
    public static void main(String []args)
    {
        GraphStore graphStore = GraphStoreFactory.create() ;
       
        UpdateRequest request = UpdateFactory.create() ;
       
        request.add(new UpdateDrop(Target.ALL)) ;
        request.add(new UpdateCreate("http://example/g2")) ;
        request.add(new UpdateLoad("file:etc/update-data.ttl", "http://example/g2")) ;
        UpdateAction.execute(request, graphStore) ;
       
        System.out.println("# Debug format");
        SSE.write(graphStore) ;
       
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

   
    public static void ex3(GraphStore graphStore)
    {
        // Build up the request then execute it.
        // This is the preferred way for complex sequences of operations.
        UpdateRequest request = UpdateFactory.create() ;
        request.add("DROP ALL")
               .add("CREATE GRAPH <http://example/g2>") ;
        // Different style.
        // Equivalent to request.add("...")
        UpdateFactory.parse(request, "LOAD <file:etc/update-data.ttl> INTO <http://example/g2>") ;
       
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

    @Test public void testUpdateInitialBinding4()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, graph1) ;
        String update = "DELETE WHERE { ?x <http://example/p> 2007 } ; INSERT { ?x <http://example/p> 1999 } WHERE {}" ;
        UpdateRequest req = UpdateFactory.create(update) ;
       
        Binding b = BindingFactory.binding(Var.alloc("x"), s) ;
        UpdateAction.execute(req, gStore, b) ;
        assertEquals(1, gStore.getDefaultGraph().size()) ;
        assertTrue(gStore.getDefaultGraph().contains(s, p, NodeFactory.parseNode("1999"))) ;
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

    {
        InputStream input = null ;
        try { input = action.request.getInputStream() ; }
        catch (IOException ex) { errorOccurred(ex) ; }

        UpdateRequest req ;
        try {
           
            if ( super.verbose_debug || action.verbose )
            {
                // Verbose mode only .... capture request for logging (does not scale).
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

            requestStr = action.request.getParameter(paramRequest) ;
       
        if ( super.verbose_debug || action.verbose )
            requestLog.info(format("[%d] Form update = %s", action.id, formatForLog(requestStr))) ;
       
        UpdateRequest req ;
        try {
            req = UpdateFactory.create(requestStr, updateParseBase) ;
        }
        catch (UpdateException ex) { errorBadRequest(ex.getMessage()) ; req = null ; }
        catch (QueryParseException ex) { errorBadRequest(messageForQPE(ex)) ; req = null ; }
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

                } ;
                output(outStream, c, lineNumbers) ;
            }
           
            // Attempt to parse it.
            UpdateRequest request= null ;
            try {
                request = UpdateFactory.create(updateString, "http://example/base/", language) ;
            } catch (ARQException ex)
            {
                // Over generous exception (should be QueryException)
                // but this makes the code robust.
                outStream.println("<p>Syntax error:</p>") ;
                startFixed(outStream) ;
                outStream.println(ex.getMessage()) ;
                finishFixed(outStream) ;
            }
            catch (RuntimeException ex)
            {
                outStream.println("<p>Internal error:</p>") ;
                startFixed(outStream) ;
                outStream.println(ex.getMessage()) ;
                finishFixed(outStream) ;
            }
           
            // Because we pass into anon inner classes
            final UpdateRequest updateRequest = request ;
           
            // OK?  Pretty print
            if ( updateRequest != null && outputSPARQL )
            {
                outStream.println("<p>Formatted, parsed update request:</p>") ;
                Content c = new Content(){
                    @Override
                    public void print(IndentedWriter out)
                    {
                        updateRequest.output(out) ;
                    }
                       
                } ;
                output(outStream, c, lineNumbers) ;
            }
View Full Code Here

Examples of com.hp.hpl.jena.update.UpdateRequest

                + "WHERE {\n"
                + "{ ?subject skos:prefLabel ?text } UNION\n"
                + "{ ?subject skos:altLabel ?text } UNION\n"
                + "{ ?subject skos:hiddenLabel ?text }\n"
                + "}";
        UpdateRequest request = UpdateFactory.create(sparqlQuery);
        UpdateAction.execute(request, graphStore);
    }
View Full Code Here

Examples of com.rallydev.rest.request.UpdateRequest

        object.addProperty("_ref", "/defect/1234");
        updateResult.add("Object", object);

        JsonObject updatedDefect = new JsonObject();
        updatedDefect.addProperty("Name", "Foo");
        UpdateRequest request = new UpdateRequest("/defect/1234", updatedDefect);
        doReturn(new Gson().toJson(response)).when(api.client).doPost(request.toUrl(), request.getBody());
        UpdateResponse updateResponse = api.update(request);

        verify(api.client).doPost(request.toUrl(), request.getBody());
        Assert.assertTrue(updateResponse.wasSuccessful());
        JsonObject obj = updateResponse.getObject();
        assertEquals(obj.get("_ref").getAsString(), "/defect/1234");
    }
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.