Previous Topic

Next Topic

Removing Triples from the Graph

You can remove triples from a graph using it's remove(Triple triple) method. The following code removes a triple:

//delete the city (address, hasCity, city) 
graph.remove(cityStatement);

The graph now contains:

http://example.org/staffid#85740  http://example.org/terms#address     _blankNode123 
_blankNode123                     http://example.org/terms#street      "1501 Grant Avenue" 
_blankNode123                     http://example.org/terms#state       "Massachusetts" 
_blankNode123                     http://example.org/terms#postalCode  "01730"  

http://example.org/managerid#65       http://example.org/terms#hasConfirmed
  http://example.org/statement#address 
http://example.org/statement#address  http://www.w3.org/1999/02/22-rdf-syntax-ns#subject
  http://example.org/staffid#85740 
http://example.org/statement#address  http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate
  http://example.org/terms#address 
http://example.org/statement#address  http://www.w3.org/1999/02/22-rdf-syntax-ns#object
_blankNode123
http://example.org/statement#address  http://www.w3.org/1999/02/22-rdf-syntax-ns#type
  http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement

See Also

JRDF Tutorial

Prerequisites

Obtaining a Session from a Mulgara Server

Comparison of JRDF Graph Implementations

Creating the Graph

Creating Nodes and Triples

Adding Triples to the Graph

Searching the Graph

Reify Triples

Open Source logo

© 2001-2004 Tucana Technologies, Inc. Some rights reserved.

© 2006 The Mulgara Project. Some rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".