Package com.hp.hpl.jena.update

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


        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


     * @param context Execution Context
     */
    public UpdateEngineNonStreaming(GraphStore graphStore, Binding inputBinding, Context context)
    {
        super(graphStore, inputBinding, context) ;
        accRequests = new UpdateRequest();
        updateSink = new UpdateRequestSink(accRequests)
        {
            @Override
            public void close()
            {
View Full Code Here

    protected void execUpdate(GraphStore graphStore)
    {
        if ( loadFiles.size() == 0 )
            throw new CmdException("Nothing to do") ;
       
        UpdateRequest req = new UpdateRequest() ;
        for ( Iterator<String> iter = loadFiles.iterator() ; iter.hasNext() ; )
        {
            String filename = iter.next();
            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

        UsingList usingList = processProtocol(action.request) ;
       
        // If the dsg is transactional, then we can parse and execute the update in a streaming fashion.
        // If it isn't, we need to read the entire update request before performing any updates, because
        // we have to attempt to make the request atomic in the face of malformed queries
        UpdateRequest req = null ;
        if (!action.isTransactional())
        {
            try
            {
                // TODO implement a spill-to-disk version of this
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

        // This injection is prevented by forbidding the > character in URIs
        String str = "PREFIX : <http://example/>\nINSERT DATA { <s> <p> ?var2 . }";
        ParameterizedSparqlString pss = new ParameterizedSparqlString(str);
        pss.setIri("var2", "hello> } ; DROP ALL ; INSERT DATA { <s> <p> <goodbye>");

        UpdateRequest updates = pss.asUpdate();
        Assert.fail("Attempt to do SPARQL injection should result in an exception");
    }
View Full Code Here

        // This injection is prevented by forbidding the > character in URIs
        String str = "PREFIX : <http://example/>\nINSERT DATA { <s> <p> ?var2 . }";
        ParameterizedSparqlString pss = new ParameterizedSparqlString(str);
        pss.setIri("var2", "hello> } ; DROP ALL ; INSERT DATA { <s> <p> <goodbye");

        UpdateRequest updates = pss.asUpdate();
        Assert.fail("Attempt to do SPARQL injection should result in an exception");
    }
View Full Code Here

        // injection
        String str = "PREFIX : <http://example/>\nINSERT DATA { <s> <p> ?var2 . }";
        ParameterizedSparqlString pss = new ParameterizedSparqlString(str);
        pss.setLiteral("var2", "hello\" } ; DROP ALL ; INSERT DATA { <s> <p> <goodbye>");

        UpdateRequest updates = pss.asUpdate();
        Assert.assertEquals(1, updates.getOperations().size());
    }
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.