Package com.hp.hpl.jena.update

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


    protected void execUpdate(GraphStore graphStore)
    {
        if ( loadFiles.size() == 0 )
            throw new CmdException("Nothing to do") ;
       
        UpdateRequest req = new UpdateRequest() ;
        for ( String filename : loadFiles )
        {
            UpdateLoad loadReq = new UpdateLoad( filename, graphName );
            req.add( loadReq );
        }
       
        if ( true )
        {
            // Need a better way
View Full Code Here


        }
    }
   
    private void execOne(String updateString)
    {
        UpdateRequest req ;
        try {
            req = UpdateFactory.create(updateString, updateSyntax) ;
        } catch (QueryParseException ex)
        {
            System.err.print("Parse error: ") ;
            System.err.println(ex.getMessage()) ;
            return ;
        }
        //req.output(IndentedWriter.stderr) ;
        if ( printUpdate )
            System.out.print(req) ;
       
        if ( printNone )
            return ;
       
        // And some checking.
        IndentedLineBuffer w = new IndentedLineBuffer() ;
        UpdateWriter.output(req, w) ;
        String updateString2 = w.asString() ;
        UpdateRequest req2 = null ;
        try {
            req2 = UpdateFactory.create(updateString2, updateSyntax) ;
        } catch (QueryParseException ex)
        {
            System.err.println("Can not reparse update after serialization") ;
View Full Code Here

        Map<String, Context> serviceContextMap = (Map<String, Context>) ARQ.getContext().get(Service.serviceContext);
        if (serviceContextMap != null) {
            serviceContextMap.remove(SERVICE);
        }

        UpdateRequest updates = UpdateFactory.create("CREATE GRAPH <http://example>");
        UpdateProcessRemoteBase engine = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, SERVICE);
        Assert.assertNotNull(engine);

        // Check that no settings were changed
        Assert.assertFalse(engine.isUsingAuthentication());
View Full Code Here

        Context serviceContext = serviceContextMap.get(SERVICE);
        try {
            serviceContext.put(Service.queryAuthUser, "user");
            serviceContext.put(Service.queryAuthPwd, "password");

            UpdateRequest updates = UpdateFactory.create("CREATE GRAPH <http://example>");
            UpdateProcessRemoteBase engine = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, SERVICE);
            Assert.assertNotNull(engine);

            // Check that auth settings were changed
            Assert.assertTrue(engine.isUsingAuthentication());
View Full Code Here

        Echo echo = new Echo();
        conn.addPreProcessor(echo);
        Assert.assertTrue(conn.getPreProcessors().hasNext());

        // Apply the pre-processor
        UpdateRequest input = UpdateFactory.create("DELETE WHERE { ?s ?p ?o }");
        UpdateRequest output = conn.applyPreProcessors(input);
        Assert.assertEquals(input, output);

        conn.close();
    }
View Full Code Here

    @Test public void updateWrite21()   { test("PREFIX : <http://example/> DELETE {} INSERT {} USING :G WHERE {}") ; }
    @Test public void updateWrite22()   { test("PREFIX : <http://example/> DELETE {} INSERT {} USING NAMED :GN WHERE {}") ; }
    @Test public void updateWrite23()   { test("PREFIX : <http://example/> WITH :ABC DELETE {} INSERT {} WHERE {}") ; }

    private void test(String updateString) {
        UpdateRequest update1 = UpdateFactory.create(updateString);
        IndentedLineBuffer w = new IndentedLineBuffer() ;
        UpdateWriter.output(update1, w) ;
        String s = w.asString() ;
        UpdateRequest update2 = UpdateFactory.create(s);
        assertTrue(update1.equalTo(update2)) ;
    }
View Full Code Here

    private void test(String updateString1, String updateString2) {
        test(updateString1, updateString2, true) ;
    }

    private void test(String updateString1, String updateString2, boolean isomorphic) {
        UpdateRequest update1 = UpdateFactory.create(updateString1);
        UpdateRequest update2 = UpdateFactory.create(updateString2);
        test(update1, update2, isomorphic) ;
    }
View Full Code Here

    }


    private void execOneFile(String filename, GraphStore store)
    {
        UpdateRequest req = UpdateFactory.read(filename, updateSyntax) ;
        UpdateExecutionFactory.create(req, store).execute() ;
    }
View Full Code Here

        UpdateExecutionFactory.create(req, store).execute() ;
    }
   
    private void execOne(String requestString, GraphStore store)
    {
        UpdateRequest req = UpdateFactory.create(requestString, updateSyntax) ;
        UpdateExecutionFactory.create(req, store).execute() ;
    }
View Full Code Here

  @Before
  public void setup() {
    this.ds = DatasetFactory.createMem();
    this.gs = GraphStoreFactory.create(this.ds);
   
    UpdateRequest up = UpdateFactory.create(TestDatasets.data);
    UpdateProcessor processor = UpdateExecutionFactory.create(up, this.gs);
    processor.execute();
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.update.UpdateRequest

Copyright © 2018 www.massapicom. 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.