Return-Path: X-Original-To: apmail-jena-users-archive@www.apache.org Delivered-To: apmail-jena-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3926ECB96 for ; Wed, 8 Aug 2012 09:01:51 +0000 (UTC) Received: (qmail 99937 invoked by uid 500); 8 Aug 2012 09:01:50 -0000 Delivered-To: apmail-jena-users-archive@jena.apache.org Received: (qmail 99573 invoked by uid 500); 8 Aug 2012 09:01:42 -0000 Mailing-List: contact users-help@jena.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jena.apache.org Delivered-To: mailing list users@jena.apache.org Delivered-To: moderator for users@jena.apache.org Received: (qmail 90997 invoked by uid 99); 8 Aug 2012 06:52:18 -0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of enesbulut1905@gmail.com designates 209.85.215.47 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=UrkbxEbhi+6UNhMY3IzuqKjjQX+oxz85pCGu81XehY4=; b=voEVdzGUE0L/qBdl5ZkNSmUSgOBv42Hbvuwrypd3X41qDY82LbjHvpAn1ALl47gve/ IQLb2439kmP3FILKgLoc3Lkhya8IIV5MCouZz5p0m5/+2gqOXRzbjTCqbOnQJLie/7zh eKdD7HcSHKKkVJLf9JbXnfJvcmjP6bsej/BtBQJLidIj0Hq9E1gzmmxGwZGP2hGrkXVc IdQ1qnxA+djzqPLar84GcHbaSqXwEGNcUMh0FQWunntsSmkLejOpW3V9bfh4KwCsZwZH eT4X8e4mCCijVbM9MtggTgC+dRfiXVYot0mRMSW+0wQ5OH/gblMEqK9T6k7PwKCS2Pkl 0k8A== MIME-Version: 1.0 Date: Wed, 8 Aug 2012 09:51:51 +0300 Message-ID: Subject: SPARQL Update on default RDF model From: Enes Bulut To: users@jena.apache.org Content-Type: multipart/alternative; boundary=f46d042c636ba9099c04c6bb8b3f --f46d042c636ba9099c04c6bb8b3f Content-Type: text/plain; charset=ISO-8859-1 Hi all, I tried to update my RDF model using SPARQL, my model in memory, then i had an exception that you can see below. First I create a default model. Model model= new ModelFactory.createDefaultModel(); ... Query string is something like that: String queryStr = "PREFIX foaf: " + "WITH <" + "http://example/addresses" + "> " + "DELETE { ?person foaf:givenName \"Bill\" } " + "INSERT { ?person foaf:givenName \"William\" } " + "WHERE { ?person foaf:givenName \"Bill\" } "; UpdateRequest upReq = UpdateFactory.create(); upReq.add(queryStr); UpdateAction.execute(upReq, model.getGraph); When I run the project NullPointerException has occurred: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.hp.hpl.jena.sparql.engine.iterator.QueryIterTriplePattern$TripleMapper.( QueryIterTriplePattern.java:80) at com.hp.hpl.jena.sparql.engine.iterator.QueryIterTriplePattern.nextStage(QueryIterTriplePattern.java:53) at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage(QueryIterRepeatApply.java:113) at com.hp.hpl.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:65) ... Is there any way to update the model-in-memory using SPARQL? Regards Enes --f46d042c636ba9099c04c6bb8b3f--