Scratch that question. The problem was that I wasn't using UpdateRequest.add(String string) method. Didn't realize I could add queries to the UpdateRequest.
On Mon, Jan 12, 2015 at 8:37 AM, Trevor Donaldson <[email protected]> wrote: > I figured out how to delete reified statements but I feel as though there > has to be a more efficient way of doing this. The way I am going about it > now is as follows : > > DELETE {?s ?p ?o} > WHERE { > ?s rdf:subject <https://myapp/servicea/id/11111111> > ?s rdf:predicate <urn:myapp:id> . > ?s ?p ?o > } > > DELETE {?s ?p ?o} > WHERE { > ?s rdf:subject <https://myapp/servicea/id/21111111> > ?s rdf:predicate <urn:myapp:id> . > ?s ?p ?o > } > > DELETE {?s ?p ?o} > WHERE { > ?s rdf:subject <https://myapp/servicea/id/31111111> > ?s rdf:predicate <urn:myapp:id> . > ?s ?p ?o > } > > Is there a way to combine all of these into one DELETE statement? I > couldn't figure out a way to do that. > > On Sat, Jan 10, 2015 at 10:24 AM, Claude Warren <[email protected]> wrote: > >> We could extend the QueryBuilder in "extras" to handle creating the >> strings >> for INSERT DATA and DELETE DATA. >> >> On Fri, Jan 9, 2015 at 8:50 PM, Andy Seaborne <[email protected]> wrote: >> >> > On 09/01/15 19:47, Trevor Donaldson wrote: >> > >> >> Could I possible do this ? >> >> >> > >> > For the adds, yes. >> > >> > >> >> DatasetAccessor dataAccessor = >> >> DatasetAccessorFactory.createHTTP("http//localhost:3030/ds"); >> >> Model model = dataAcessor.getModel(); >> >> >> >> OntModel ontmodel = ModelFactory.createOntologyModel( >> >> OntModelSpec.OWL_DL_MEM); >> >> ontmodel.add(model); >> >> >> >> //add, remove etc... do >> >> >> >> dataAcessor.add(ontmodel); >> >> >> > >> > >> > // Default graph >> > dataAccessor.add(, Model data) ; >> > >> > // Named graph >> > dataAccessor.add(String graphUri, Model data) ; >> > >> > The DatasetAccessor reflects the structure of the dataset in the server. >> > >> > >> >> Would this do what I want? This seems like overkill for what I need to >> >> do. All I want to do is update a particular graph with new statements >> >> or remove old statements. >> >> >> > >> > Remove is the hard part if that includes blank nodes. >> > >> > You need to find the blank node with a DELETE {} WHERE {} or it's short >> > form DELETE WHERE {}. >> > >> > Andy >> > >> > >> > >> >> >> >> >> >> >> >> On Fri, Jan 9, 2015 at 1:32 PM, Martynas Jusevičius < >> >> [email protected]> >> >> wrote: >> >> >> >> Andy - builder code like this? >> >>> >> >>> https://github.com/Graphity/graphity-client/blob/master/ >> >>> src/main/java/org/graphity/processor/update/InsertDataBuilder.java >> >>> >> >>> It is based on SPIN though, not on Jena directly. >> >>> >> >>> On Fri, Jan 9, 2015 at 6:49 PM, Andy Seaborne <[email protected]> >> wrote: >> >>> >> >>>> On 09/01/15 15:13, Trevor Donaldson wrote: >> >>>> >> >>>>> >> >>>>> Hi all, >> >>>>> >> >>>>> Is there a way to take a temp model and send the result to fuseki? >> >>>>> >> >>>>> What I would like to accomplish : >> >>>>> 1. Insert / delete triples in temp model >> >>>>> 2. Send results (inserts and deletes) to fuseki to have it update >> the >> >>>>> named >> >>>>> graph >> >>>>> >> >>>>> Is this possible or do I need to do build the sparql queries >> manually? >> >>>>> Thanks >> >>>>> >> >>>>> >> >>>> DatasetAccessor (the SPARQL Graph Store Protocol) might be worth a >> look >> >>>> - >> >>>> but it works on whole graphs so delete some triples out of a large >> graph >> >>>> >> >>> is >> >>> >> >>>> not something it can do. >> >>>> >> >>>> Otherwise, building SPARQL is probably the way to go. INSERT DATA, >> >>>> >> >>> DELETE >> >>> >> >>>> DATA if no >> >>>> >> >>>> (Is there any builder code to help with this? Seems like a good >> thing >> >>>> to >> >>>> have to build INSERT DATA, DELETE DATA operations) >> >>>> >> >>>> Trevor - does the data have bNodes in it? >> >>>> >> >>>> Andy >> >>>> >> >>>> Looking further out ... >> >>>> >> >>>> At a lower level, there is RDF Patch >> >>>> >> >>>> http://afs.github.io/rdf-patch/ >> >>>> >> >>>> and some code in: >> >>>> https://github.com/afs/jena-rdfpatch >> >>>> >> >>>> through I have got sidetracked by a binary version of this based on >> >>>> >> >>>> http://afs.github.io/rdf-thrift/ >> >>>> >> >>>> >> >>> >> >> >> > >> >> >> -- >> I like: Like Like - The likeliest place on the web >> <http://like-like.xenei.com> >> LinkedIn: http://www.linkedin.com/in/claudewarren >> > >
