clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/4] clerezza git commit: Adapted to updated RDF Commons draft
Date Mon, 12 Jan 2015 19:27:10 GMT
Repository: clerezza
Updated Branches:
  refs/heads/rdf-commons 29f822c7e -> 9ae0a1bc9


http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/site/xsite/content/scb-triaxrs-tutorial.xhtml
----------------------------------------------------------------------
diff --git a/rdf.core/src/site/xsite/content/scb-triaxrs-tutorial.xhtml b/rdf.core/src/site/xsite/content/scb-triaxrs-tutorial.xhtml
index 1d0ad72..9389bad 100644
--- a/rdf.core/src/site/xsite/content/scb-triaxrs-tutorial.xhtml
+++ b/rdf.core/src/site/xsite/content/scb-triaxrs-tutorial.xhtml
@@ -174,11 +174,11 @@ import org.clerezza.platform.typerendering.seedsnipe.SeedsnipeRenderlet;
 import org.clerezza.platform.typerendering.RenderletManager;
 import org.clerezza.rdf.ontologies.FOAF;
 import org.clerezza.rdf.utils.GraphNode;
+import org.clerezza.rdf.core.ImmutableGraph;
 import org.clerezza.rdf.core.Graph;
-import org.clerezza.rdf.core.MGraph;
 import org.clerezza.rdf.core.NonLiteral;
 import org.clerezza.rdf.core.Triple;
-import org.clerezza.rdf.core.TripleCollection;
+import org.clerezza.rdf.core.Graph;
 import org.clerezza.rdf.core.UriRef;
 import org.clerezza.rdf.core.access.NoSuchEntityException;
 import org.clerezza.rdf.core.access.TcManager;
@@ -210,23 +210,23 @@ public class TutorialApp {
 	@GET
 	@Path("find")
 	@Produces("application/rdf+xml")
-	public Graph getPersonRdf(@QueryParam("mbox") String mboxString) {
-		MGraph mGraph = tcManager.getMGraph(graphName);
-		NonLiteral person = getPersonByMbox(mboxString, mGraph);
-		return new GraphNode(person, mGraph).getNodeContext();
+	public ImmutableGraph getPersonRdf(@QueryParam("mbox") String mboxString) {
+		Graph graph = tcManager.getMGraph(graphName);
+		NonLiteral person = getPersonByMbox(mboxString, graph);
+		return new GraphNode(person, graph).getNodeContext();
 	}
 
 	@GET
 	@Path("find")
 	@Produces("application/xhtml+xml")
 	public GraphNode getPersonHtml(@QueryParam("mbox") String mboxString) {
-		MGraph mGraph = tcManager.getMGraph(graphName);
-		NonLiteral person = getPersonByMbox(mboxString, mGraph);
-		return new GraphNode(person, mGraph);
+		Graph graph = tcManager.getMGraph(graphName);
+		NonLiteral person = getPersonByMbox(mboxString, graph);
+		return new GraphNode(person, graph);
 	}
 
-	private NonLiteral getPersonByMbox(String mboxString, MGraph mGraph) {
-		Iterator<Triple> iter = mGraph.filter(null, FOAF.mbox, new UriRef(mboxString));
+	private NonLiteral getPersonByMbox(String mboxString, Graph graph) {
+		Iterator<Triple> iter = graph.filter(null, FOAF.mbox, new UriRef(mboxString));
 		NonLiteral person = null;
 		while(iter.hasNext()) {
 			person = iter.next().getSubject();
@@ -236,7 +236,7 @@ public class TutorialApp {
 
 	/**
 	 * The activate method is called when SCR activates the component configuration.
-	 * This method gets the system graph or create a new one if it doesn't exist.
+	 * This method gets the system ImmutableGraph or create a new one if it doesn't exist.
 	 *
 	 * @param componentContext
 	 */
@@ -251,7 +251,7 @@ public class TutorialApp {
 		} catch (URISyntaxException ex) {
 			throw new WebApplicationException(ex);
 		}
-		TripleCollection tc;
+		Graph tc;
 		try {
 			tcManager.getMGraph(graphName);
 		} catch (NoSuchEntityException nsee) {
@@ -288,16 +288,16 @@ public class TutorialApp {
 			like to get from the server. Using JAX-RS we can define a
 			<code>MessageBodyWriter</code> which maps a Java type to a
 			representation. In this tutorial <code>getPersonRdf</code> returns
-			a Graph, whereas <code>getPersonHtml</code> returns a GraphNode,
-			which represents a node in the context of a graph. The clerezza
-			platform provides for either resources Graph and GraphNode a
+			a ImmutableGraph, whereas <code>getPersonHtml</code> returns a GraphNode,
+			which represents a node in the context of a ImmutableGraph. The clerezza
+			platform provides for either resources ImmutableGraph and GraphNode a
 			corresponding <code>MessageBodyWriter</code>.
 		</p>
 		<p>
 			The clerezza platform's <code>TemplatingMessageBodyWriter</code>
 			produces a representation of the format "application/xhtml+xml"
 			from a <code>GraphNode</code>, whereas the <code>GraphWriter</code>
-			produces "application/rdf+xml" from a <code>Graph</code>.
+			produces "application/rdf+xml" from a <code>ImmutableGraph</code>.
 			<code>GraphWriter</code> is implemented in the maven project
 			org.clerezza.jaxrs.rdf.providers.
 			The <code>TemplatingMessageBodyWriter</code> uses a templating engine
@@ -316,11 +316,11 @@ public class TutorialApp {
 		</p>
 		<p>
 			In the <code>activate</code> method we also use the <code>TcManager</code> to get
-			the <code>MGraph</code> called "http://localhost.mygraph". If this
-			graph doesn't exist, a <code>NoSuchEntityException</code> is thrown.
+			the <code>Graph</code> called "http://localhost.mygraph". If this
+			ImmutableGraph doesn't exist, a <code>NoSuchEntityException</code> is thrown.
 			In this latter case, we catch this exception and create an
-			<code>MGraph</code>. Afterwards we add the triples from the file
-			mentioned above into the graph.
+			<code>Graph</code>. Afterwards we add the triples from the file
+			mentioned above into the ImmutableGraph.
 		</p>
 
 		<p>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/site/xsite/content/tutorial_1.xhtml
----------------------------------------------------------------------
diff --git a/rdf.core/src/site/xsite/content/tutorial_1.xhtml b/rdf.core/src/site/xsite/content/tutorial_1.xhtml
index 1df2513..d653d0c 100644
--- a/rdf.core/src/site/xsite/content/tutorial_1.xhtml
+++ b/rdf.core/src/site/xsite/content/tutorial_1.xhtml
@@ -39,7 +39,7 @@
 			<a href="#maven">2. Initializing a Maven Project</a>
 		</p>
 		<p>
-			<a href="#functionality">3. Creating a Graph and loading Data</a>
+			<a href="#functionality">3. Creating a ImmutableGraph and loading Data</a>
 		</p>
 		<p>
 			<a href="#accessing">4. Accessing the Triples</a>
@@ -59,12 +59,12 @@
 		<h2 id="objective">1. Objective</h2>
 		<p>
 			In this tutorial you will learn how to use SCB to manage data modeled
-			as a graph based on the RDF [<a href="#ref1">1</a>] standard
+			as a ImmutableGraph based on the RDF [<a href="#ref1">1</a>] standard
 			maintained by W3C.
 		</p>
 		<p>
-			You'll learn how to get Graph objects from serialized RDF data on
-			the web and how to access such a graph using the core SCB package
+			You'll learn how to get ImmutableGraph objects from serialized RDF data on
+			the web and how to access such a ImmutableGraph using the core SCB package
 			and the SCB utilities package.
 		</p>
 		<p>
@@ -73,11 +73,11 @@
 			other triple store APIs through technology specific fa├žades (adapters).
 			However, you will learn to know these key advantages in next tutorials. This
 			tutorial provides for a good foundation to work with and understand
-			the basic concept of SCB graph data model.
+			the basic concept of SCB ImmutableGraph data model.
 		</p>
 		<p>
 			Our example will download data about BBC television sitcoms from
-			dbpedia into a local graph, display the context of a given resource
+			dbpedia into a local ImmutableGraph, display the context of a given resource
 			and download additional data from the web when the user requests it.
 			The	time it takes to go through this tutorial is approximately an hour. This
 			tutorial is intended for java developers, some familiarity with the
@@ -263,21 +263,21 @@ $ mvn archetype:generate --batch-mode \
 		  Enough configuration, lets get our hands dirty and write some code.
 		</p>
 
-		<h2 id="functionality">3. Creating a Graph and loading Data</h2>
+		<h2 id="functionality">3. Creating a ImmutableGraph and loading Data</h2>
 		<p>
 			In RDF, Graphs are collections of triples. Strictly speaking graphs
-			are immutable : if you add or remove a triple its a new graph. For
+			are immutable : if you add or remove a triple its a new ImmutableGraph. For
 			that SCB distinguishes between two types of
-			<code>TripleCollection</code>s: <code>Graph</code> and
-			<code>MGraph</code> where 'M' stands for "mutable". The MGraph
-			and Graph interfaces both extend <code>TripleCollection</code> which
+			<code>Graph</code>s: <code>ImmutableGraph</code> and
+			<code>Graph</code> where 'M' stands for "mutable". The Graph
+			and ImmutableGraph interfaces both extend <code>Graph</code> which
 			apart from extending <code>java.util.Collection&lt;Triple&gt;</code>
 			provide a method <code>filter</code>
 			to query RDF triples according to filter parameters
 			specified: subject, predicate, and object.
 		</p>
 		<p>
-			The factory we need for getting <code>TripleCollection</code>s
+			The factory we need for getting <code>Graph</code>s
 			is <code>
 				<a href="http://clerezza.org/projects/org.clerezza.rdf.core/apidocs/org/clerezza/rdf/core/access/TcManager.html">
 					TcManager
@@ -288,7 +288,7 @@ $ mvn archetype:generate --batch-mode \
 		</p>
 		<p>
 			To store our accumulated knowledge around BBC television sitcoms
-			we create an <code>MGraph</code> with the following code:
+			we create an <code>Graph</code> with the following code:
 		</p>
 		<blockcode>
 import org.apache.clerezza.rdf.core.*;
@@ -298,10 +298,10 @@ import org.apache.clerezza.rdf.core.access.TcManager;
 
 //get the singleton instance of TcManager
 final TcManager tcManager = TcManager.getInstance();
-//the arbitrary name we use for our mutable graph
+//the arbitrary name we use for our mutable ImmutableGraph
 final UriRef mGraphName = new UriRef("http://tutorial.example.org/");
-//the m-graph into which we'll put the triples we collect
-final MGraph mGraph = tcManager.createMGraph(mGraphName);
+//the m-ImmutableGraph into which we'll put the triples we collect
+final Graph graph = tcManager.createMGraph(mGraphName);
 		</blockcode>
 		<div class="note">
 			We don't repeat the skeleton code generated by the maven archetype
@@ -309,12 +309,12 @@ final MGraph mGraph = tcManager.createMGraph(mGraphName);
 			place in App.java.
 		</div>
 		<p>
-			The code creates an empty MGraph with the name
+			The code creates an empty Graph with the name
 			&lt;http://tutorial.example.org/>. To verify that all went well
-			we can output the size of <code>mGraph</code> with the following:
+			we can output the size of <code>graph</code> with the following:
 		</p>
 		<blockcode>
-System.out.println("Size of mGraph: "+mGraph.size());
+System.out.println("Size of graph: "+graph.size());
 		</blockcode>
 		<p>
 			To compile and run the application using maven issue the following
@@ -329,7 +329,7 @@ $ mvn compile exec:java -Dexec.mainClass=org.example.clerezza.scb.tutorial1.App
 			program:
 		</p>
 		<blockcode>
-Size of mGraph: 0
+Size of graph: 0
 		</blockcode>
 		<p>
 			Boring emptiness, lets add the triples dbpedia has about
@@ -363,50 +363,50 @@ final InputStream inputStream = con.getInputStream();
 		<p>
 			Now that we have an InputStream from which rdf/xml can be read we
 			use <code>org.apache.clerezza.rdf.core.serializedform.Parser</code> to
-			convert it to a graph:
+			convert it to a ImmutableGraph:
 		</p>
 		<blockcode>
 //get the singleton instance of Parser
 final Parser parser = Parser.getInstance();
-Graph deserializedGraph = parser.parse(inputStream, "application/rdf+xml");
+ImmutableGraph deserializedGraph = parser.parse(inputStream, "application/rdf+xml");
 		</blockcode>
 		<p>
-			Using the <code>addAll</code> which MGraph inherits from
+			Using the <code>addAll</code> which Graph inherits from
 			<code>Collection&lt;triple></code> we can add the triples of the
-			retrieved Graph to mGraph:
+			retrieved ImmutableGraph to graph:
 		</p>
 		<blockcode>
-mGraph.addAll(deserializedGraph);
+graph.addAll(deserializedGraph);
 		</blockcode>
 		<p>
-			Outputting the size of the graph now returns something else (the
+			Outputting the size of the ImmutableGraph now returns something else (the
 			number of triples will vary as dbpedia evolves):
 		</p>
 		<blockcode>
-Size of mGraph: 251
+Size of graph: 251
 		</blockcode>
 		<h2 id="accessing">4. Accessing the Triples</h2>
 		<p>
-			It's good to know that by loading data into our <code>MGraph</code>
+			It's good to know that by loading data into our <code>Graph</code>
 			its size has increased, but actually we would like to get data
-			out of <code>mGraph</code>.  The easiest would be to just use
-			the Serializer to write the Graph to standard output:
+			out of <code>graph</code>.  The easiest would be to just use
+			the Serializer to write the ImmutableGraph to standard output:
 		</p>
 		<blockcode>
 final Serializer serializer = Serializer.getInstance();
-serializer.serialize(System.out, mGraph, "text/turtle");
+serializer.serialize(System.out, graph, "text/turtle");
 		</blockcode>
-		<p>The above code serialized <code>mGraph</code> in the turtle format
+		<p>The above code serialized <code>graph</code> in the turtle format
 		to the standard output.  You may want to try "application/n-triples" and
 		"application/rdf+xml" to see the triples serialized in different ways.
 		</p>
 		<p>The typical way to get specific triples is to use the <code>filter</code>
-		method which <code>Graph</code> and <code>MGraph</code> inherit from
-		<code>TripleCollection</code>. The following outputs the
+		method which <code>ImmutableGraph</code> and <code>Graph</code> inherit from
+		<code>Graph</code>. The following outputs the
 		<code>RDF:type</code> of the resource
 		&lt;http://dbpedia.org/resource/Category:BBC_television_sitcoms>:</p>
 		<blockcode>
-Iterator&lt;Triple> typeTriples = mGraph.filter(new UriRef("http://dbpedia.org/resource/Category:BBC_television_sitcoms"), RDF.type, null);
+Iterator&lt;Triple> typeTriples = graph.filter(new UriRef("http://dbpedia.org/resource/Category:BBC_television_sitcoms"), RDF.type, null);
 while (typeTriples.hasNext()) {
 	System.out.println(typeTriples.next());
 }
@@ -423,8 +423,8 @@ while (typeTriples.hasNext()) {
 		<p>The context can easily be accessed by using the <code>GraphNode</code>
 		class in the org.apache.clerezza.rdf.utils package.</p>
 		<blockcode>
-public Graph getCurrentContext() {
-	return new GraphNode(new UriRef(selectedUri), mGraph).getNodeContext();
+public ImmutableGraph getCurrentContext() {
+	return new GraphNode(new UriRef(selectedUri), graph).getNodeContext();
 }
 		</blockcode>
 		<p>The method above returns the context of the resource of which
@@ -443,7 +443,7 @@ public Graph getCurrentContext() {
 		<p>A trivially achievable improvement of the example application would
 		be to add persistent storage.</p>
 		<p>By adding the sesame persitent storage provider to the runtime classpath
-		of the application our <code>MGraph</code> is stored in a sesame store
+		of the application our <code>Graph</code> is stored in a sesame store
 		[<a href="#ref8">8</a>] (this obsolotes the dependency on
 		<code>org.apache.clerezza.rdf.sesame.storage</code>).
 		</p>
@@ -456,15 +456,15 @@ public Graph getCurrentContext() {
 &lt;/dependency>
 		</blockcode>
 		<p>After adding this dependency on the second launch of the application
-		we should get an exception complaining that the graph already exists, the
+		we should get an exception complaining that the ImmutableGraph already exists, the
 		reason for this is that <code>TcManager</code> contains separate methods
-		to access an existing <code>MGraph</code> and for creating a new one. The
+		to access an existing <code>Graph</code> and for creating a new one. The
 		following would solve the issue:</p>
 		<blockcode>
 try {
-	mGraph = tcManager.getMGraph(mGraphName);
+	graph = tcManager.getMGraph(mGraphName);
 } catch (NoSuchEntityException e) {
-	mGraph = tcManager.createMGraph(mGraphName);
+	graph = tcManager.createMGraph(mGraphName);
 }
 		</blockcode>
 		<p>If anything is unclear or you'd like to take it even further, ask
@@ -480,11 +480,11 @@ try {
 		<p id="ref5">[5] The introduced concept of "context" is close to the
 		one of "RDF Molecules" [6] and Minimum Self contained Graphs [7]</p>
 		<p id="ref6">[6] Ding L.; Finin, T; Peng, Y; Pinheiro da
-		Silva, P; , McGuinness, D , "Tracking RDF Graph Provenance using RDF
+		Silva, P; , McGuinness, D , "Tracking RDF ImmutableGraph Provenance using RDF
 		Molecules" , 2005, Proceedings of the Fourth International Semantic Web
 		Conference, November 2005</p>
 		<p id="ref7">[7] Tummarello G.,;Morbidoni C.; Puliti P; Piazza F.
-		"Signing individual fragments of an RDF graph" , 2005, World Wide Web
+		"Signing individual fragments of an RDF ImmutableGraph" , 2005, World Wide Web
 		Conference 2005 Poster Track</p>
 		<p id="ref8">[8] Sesame, <a href="http://openrdf.com/">http://openrdf.com/</a></p>
 	</body>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/SecurityTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/SecurityTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/SecurityTest.java
index 9d11ea8..42c297c 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/SecurityTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/SecurityTest.java
@@ -33,9 +33,9 @@ import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.apache.commons.rdf.MGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.TripleCollection;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.access.providers.WeightedA;
 import org.apache.clerezza.rdf.core.access.providers.WeightedDummy;
@@ -57,8 +57,8 @@ public class SecurityTest {
         ////needed to unbind because this is injected with META-INF/services - file
         TcManager.getInstance().unbindWeightedTcProvider(new WeightedA());
         TcManager.getInstance().bindWeightedTcProvider(new WeightedDummy());
-        TcManager.getInstance().createMGraph(new Iri("http://example.org/graph/alreadyexists"));
-        TcManager.getInstance().createMGraph(new Iri("http://example.org/read/graph"));
+        TcManager.getInstance().createMGraph(new Iri("http://example.org/ImmutableGraph/alreadyexists"));
+        TcManager.getInstance().createMGraph(new Iri("http://example.org/read/ImmutableGraph"));
     }
 
     @AfterClass
@@ -74,10 +74,10 @@ public class SecurityTest {
             public PermissionCollection getPermissions(CodeSource codeSource) {
                 PermissionCollection result = new Permissions();
                 result.add(new TcPermission("http://example.org/permitted", "read"));
-                result.add(new TcPermission("http://example.org/graph/alreadyexists", "readwrite"));
-                result.add(new TcPermission("http://example.org/read/graph", "read"));
+                result.add(new TcPermission("http://example.org/ImmutableGraph/alreadyexists", "readwrite"));
+                result.add(new TcPermission("http://example.org/read/ImmutableGraph", "read"));
                 result.add(new TcPermission("http://example.org/area/allowed/*", "readwrite"));
-                result.add(new TcPermission("urn:x-localinstance:/graph-access.graph", "readwrite"));
+                result.add(new TcPermission("urn:x-localinstance:/ImmutableGraph-access.ImmutableGraph", "readwrite"));
                 //result.add(new AllPermission());
                 result.add(new RuntimePermission("*"));
                 result.add(new ReflectPermission("suppressAccessChecks"));
@@ -136,7 +136,7 @@ public class SecurityTest {
         TcManager.getInstance().getTcAccessController().setRequiredReadPermissionStrings(graphUri,
                 Collections.singletonList("(java.io.FilePermission \"/etc\" \"write\")"));
         //new FilePermission("/etc", "write").toString()));
-        TripleCollection ag = TcManager.getInstance().getTriples(new Iri("urn:x-localinstance:/graph-access.graph"));
+        Graph ag = TcManager.getInstance().getTriples(new Iri("urn:x-localinstance:/ImmutableGraph-access.ImmutableGraph"));
         System.out.print(ag.toString());
         TcManager.getInstance().getMGraph(graphUri);
     }
@@ -147,7 +147,7 @@ public class SecurityTest {
         TcManager.getInstance().getTcAccessController().setRequiredReadPermissionStrings(graphUri,
                 Collections.singletonList("(java.io.FilePermission \"/etc\" \"write\")"));
         //new FilePermission("/etc", "write").toString()));
-        TripleCollection ag = TcManager.getInstance().getTriples(new Iri("urn:x-localinstance:/graph-access.graph"));
+        Graph ag = TcManager.getInstance().getTriples(new Iri("urn:x-localinstance:/ImmutableGraph-access.ImmutableGraph"));
         System.out.print(ag.toString());
         TcManager.getInstance().createMGraph(graphUri);
     }
@@ -158,23 +158,23 @@ public class SecurityTest {
         TcManager.getInstance().getTcAccessController().setRequiredReadWritePermissionStrings(graphUri,
                 Collections.singletonList("(java.io.FilePermission \"/etc\" \"write\")"));
         //new FilePermission("/etc", "write").toString()));
-        TripleCollection ag = TcManager.getInstance().getTriples(new Iri("urn:x-localinstance:/graph-access.graph"));
+        Graph ag = TcManager.getInstance().getTriples(new Iri("urn:x-localinstance:/ImmutableGraph-access.ImmutableGraph"));
         System.out.print(ag.toString());
         TcManager.getInstance().createMGraph(graphUri);
     }
     
     @Test(expected=EntityAlreadyExistsException.class)
     public void testCreateMGraph() {
-        TcManager.getInstance().createMGraph(new Iri("http://example.org/graph/alreadyexists"));
+        TcManager.getInstance().createMGraph(new Iri("http://example.org/ImmutableGraph/alreadyexists"));
     }
     @Test(expected=AccessControlException.class)
     public void testCreateMGraphWithoutWritePermission() {
-        TcManager.getInstance().createMGraph(new Iri("http://example.org/read/graph"));
+        TcManager.getInstance().createMGraph(new Iri("http://example.org/read/ImmutableGraph"));
     }
     @Test(expected=ReadOnlyException.class)
     public void testAddTripleToMGraph() {
-        MGraph mGraph = TcManager.getInstance().getMGraph(new Iri("http://example.org/read/graph"));
+        Graph graph = TcManager.getInstance().getMGraph(new Iri("http://example.org/read/ImmutableGraph"));
         Triple triple = new TripleImpl(new Iri("http://example.org/definition/isNonLiteral"), new Iri("http://example.org/definition/isTest"), new PlainLiteralImpl("test"));
-        mGraph.add(triple);
+        graph.add(triple);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/TcManagerTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/TcManagerTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/TcManagerTest.java
index dad3eb7..a4ae80a 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/TcManagerTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/TcManagerTest.java
@@ -24,9 +24,9 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
-import org.apache.commons.rdf.Graph;
+import org.apache.commons.rdf.ImmutableGraph;
 import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.TripleCollection;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.access.providers.WeightedA;
 import org.apache.clerezza.rdf.core.access.providers.WeightedA1;
@@ -82,11 +82,11 @@ public class TcManagerTest {
 
 	@Test
 	public void getGraphFromA() {
-		Graph graphA = graphAccess.getGraph(uriRefA);
+		ImmutableGraph graphA = graphAccess.getGraph(uriRefA);
 		Iterator<Triple> iterator = graphA.iterator();
 		assertEquals(new TripleImpl(uriRefA, uriRefA, uriRefA), iterator.next());
 		assertFalse(iterator.hasNext());
-		TripleCollection triplesA = graphAccess.getTriples(uriRefA);
+		Graph triplesA = graphAccess.getTriples(uriRefA);
 		iterator = triplesA.iterator();
 		assertEquals(new TripleImpl(uriRefA, uriRefA, uriRefA), iterator.next());
 		assertFalse(iterator.hasNext());
@@ -94,11 +94,11 @@ public class TcManagerTest {
 
 	@Test
 	public void getGraphFromB() {
-		Graph graphA = graphAccess.getGraph(uriRefB);
+		ImmutableGraph graphA = graphAccess.getGraph(uriRefB);
 		Iterator<Triple> iterator = graphA.iterator();
 		assertEquals(new TripleImpl(uriRefB, uriRefB, uriRefB), iterator.next());
 		assertFalse(iterator.hasNext());
-		TripleCollection triplesA = graphAccess.getTriples(uriRefB);
+		Graph triplesA = graphAccess.getTriples(uriRefB);
 		iterator = triplesA.iterator();
 		assertEquals(new TripleImpl(uriRefB, uriRefB, uriRefB), iterator.next());
 		assertFalse(iterator.hasNext());
@@ -107,12 +107,12 @@ public class TcManagerTest {
 	@Test
 	public void getGraphFromAAfterUnbinding() {
 		graphAccess.unbindWeightedTcProvider(weightedA);
-		Graph graphA = graphAccess.getGraph(uriRefA);
+		ImmutableGraph graphA = graphAccess.getGraph(uriRefA);
 		Iterator<Triple> iterator = graphA.iterator();
 		assertEquals(new TripleImpl(uriRefA1, uriRefA1, uriRefA1),
 				iterator.next());
 		assertFalse(iterator.hasNext());
-		TripleCollection triplesA = graphAccess.getTriples(uriRefA);
+		Graph triplesA = graphAccess.getTriples(uriRefA);
 		iterator = triplesA.iterator();
 		assertEquals(new TripleImpl(uriRefA1, uriRefA1, uriRefA1),
 				iterator.next());
@@ -123,12 +123,12 @@ public class TcManagerTest {
 	public void getGraphFromAWithHeavy() {
 		final WeightedAHeavy weightedAHeavy = new WeightedAHeavy();
 		graphAccess.bindWeightedTcProvider(weightedAHeavy);
-		Graph graphA = graphAccess.getGraph(uriRefA);
+		ImmutableGraph graphA = graphAccess.getGraph(uriRefA);
 		Iterator<Triple> iterator = graphA.iterator();
 		assertEquals(new TripleImpl(uriRefAHeavy, uriRefAHeavy, uriRefAHeavy),
 				iterator.next());
 		assertFalse(iterator.hasNext());
-		TripleCollection triplesA = graphAccess.getTriples(uriRefA);
+		Graph triplesA = graphAccess.getTriples(uriRefA);
 		iterator = triplesA.iterator();
 		assertEquals(new TripleImpl(uriRefAHeavy, uriRefAHeavy, uriRefAHeavy),
 				iterator.next());
@@ -196,16 +196,16 @@ public class TcManagerTest {
 	public void executeSparqlQueryWithEngineWithString() throws Exception {
 		// Prepare
 		injectQueryEngine(queryEngine);
-		TripleCollection tripleCollection = new SimpleMGraph();
+		Graph Graph = new SimpleMGraph();
 
 		// Execute
-		graphAccess.executeSparqlQuery("", tripleCollection);
+		graphAccess.executeSparqlQuery("", Graph);
 
 		// Verify
-		Mockito.verify(queryEngine).execute(graphAccess, tripleCollection, "");
+		Mockito.verify(queryEngine).execute(graphAccess, Graph, "");
 		Mockito.verify(queryEngine, Mockito.never()).execute(
 				(TcManager) Mockito.anyObject(),
-				(TripleCollection) Mockito.anyObject(),
+				(Graph) Mockito.anyObject(),
 				(Query) Mockito.anyObject());
 	}
 
@@ -213,41 +213,41 @@ public class TcManagerTest {
 	public void executeSparqlQueryWithEngineWithSelectQuery() throws Exception {
 		// Prepare
 		injectQueryEngine(queryEngine);
-		TripleCollection tripleCollection = new SimpleMGraph();
+		Graph Graph = new SimpleMGraph();
 		SelectQuery query = Mockito.mock(SelectQuery.class);
 
 		// Execute
-		graphAccess.executeSparqlQuery(query, tripleCollection);
+		graphAccess.executeSparqlQuery(query, Graph);
 
 		// Verify
-		Mockito.verify(queryEngine).execute(graphAccess, tripleCollection,
+		Mockito.verify(queryEngine).execute(graphAccess, Graph,
 				(Query) query);
 		Mockito.verify(queryEngine, Mockito.never()).execute(
 				(TcManager) Mockito.anyObject(),
-				(TripleCollection) Mockito.anyObject(), Mockito.anyString());
+				(Graph) Mockito.anyObject(), Mockito.anyString());
 	}
 
 	@Test
 	public void executeSparqlQueryWithEngineWithAskQuery() throws Exception {
 		// Prepare
 		injectQueryEngine(queryEngine);
-		TripleCollection tripleCollection = new SimpleMGraph();
+		Graph Graph = new SimpleMGraph();
 		AskQuery query = Mockito.mock(AskQuery.class);
 
 		Mockito.when(
 				queryEngine.execute((TcManager) Mockito.anyObject(),
-						(TripleCollection) Mockito.anyObject(),
+						(Graph) Mockito.anyObject(),
 						(Query) Mockito.anyObject())).thenReturn(Boolean.TRUE);
 
 		// Execute
-		graphAccess.executeSparqlQuery(query, tripleCollection);
+		graphAccess.executeSparqlQuery(query, Graph);
 
 		// Verify
-		Mockito.verify(queryEngine).execute(graphAccess, tripleCollection,
+		Mockito.verify(queryEngine).execute(graphAccess, Graph,
 				(Query) query);
 		Mockito.verify(queryEngine, Mockito.never()).execute(
 				(TcManager) Mockito.anyObject(),
-				(TripleCollection) Mockito.anyObject(), Mockito.anyString());
+				(Graph) Mockito.anyObject(), Mockito.anyString());
 	}
 
 	@Test
@@ -255,18 +255,18 @@ public class TcManagerTest {
 			throws Exception {
 		// Prepare
 		injectQueryEngine(queryEngine);
-		TripleCollection tripleCollection = new SimpleMGraph();
+		Graph Graph = new SimpleMGraph();
 		DescribeQuery query = Mockito.mock(DescribeQuery.class);
 
 		// Execute
-		graphAccess.executeSparqlQuery(query, tripleCollection);
+		graphAccess.executeSparqlQuery(query, Graph);
 
 		// Verify
-		Mockito.verify(queryEngine).execute(graphAccess, tripleCollection,
+		Mockito.verify(queryEngine).execute(graphAccess, Graph,
 				(Query) query);
 		Mockito.verify(queryEngine, Mockito.never()).execute(
 				(TcManager) Mockito.anyObject(),
-				(TripleCollection) Mockito.anyObject(), Mockito.anyString());
+				(Graph) Mockito.anyObject(), Mockito.anyString());
 	}
 
 	@Test
@@ -274,18 +274,18 @@ public class TcManagerTest {
 			throws Exception {
 		// Prepare
 		injectQueryEngine(queryEngine);
-		TripleCollection tripleCollection = new SimpleMGraph();
+		Graph Graph = new SimpleMGraph();
 		ConstructQuery query = Mockito.mock(ConstructQuery.class);
 
 		// Execute
-		graphAccess.executeSparqlQuery(query, tripleCollection);
+		graphAccess.executeSparqlQuery(query, Graph);
 
 		// Verify
-		Mockito.verify(queryEngine).execute(graphAccess, tripleCollection,
+		Mockito.verify(queryEngine).execute(graphAccess, Graph,
 				(Query) query);
 		Mockito.verify(queryEngine, Mockito.never()).execute(
 				(TcManager) Mockito.anyObject(),
-				(TripleCollection) Mockito.anyObject(), Mockito.anyString());
+				(Graph) Mockito.anyObject(), Mockito.anyString());
 	}
 
 	// ------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA.java
index 5ae2668..2e804fb 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA.java
@@ -22,9 +22,8 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.commons.rdf.ImmutableGraph;
 import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.MGraph;
-import org.apache.commons.rdf.TripleCollection;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
 import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
@@ -45,45 +44,45 @@ public class WeightedA implements WeightedTcProvider {
     }
 
     @Override
-    public Graph getGraph(Iri name) throws NoSuchEntityException {
+    public ImmutableGraph getGraph(Iri name) throws NoSuchEntityException {
         if (name.equals(TcManagerTest.uriRefA)) {
-            MGraph mResult = new SimpleMGraph();
+            Graph mResult = new SimpleMGraph();
             mResult.add(new TripleImpl(TcManagerTest.uriRefA, 
                     TcManagerTest.uriRefA, TcManagerTest.uriRefA));
             mGraphList.add(name);
-            return mResult.getGraph();
+            return mResult.getImmutableGraph();
         }
         throw new NoSuchEntityException(name);
     }
 
     @Override
-    public MGraph getMGraph(Iri name) throws NoSuchEntityException {
+    public Graph getMGraph(Iri name) throws NoSuchEntityException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public TripleCollection getTriples(Iri name) throws NoSuchEntityException {
+    public Graph getTriples(Iri name) throws NoSuchEntityException {
         return getGraph(name);
     }
 
     @Override
-    public MGraph createMGraph(Iri name) {
+    public Graph createMGraph(Iri name) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Graph createGraph(Iri name, TripleCollection triples) {
+    public ImmutableGraph createGraph(Iri name, Graph triples) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public void deleteTripleCollection(Iri name) throws NoSuchEntityException, 
+    public void deleteGraph(Iri name) throws NoSuchEntityException, 
             EntityUndeletableException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Set<Iri> getNames(Graph graph) {
+    public Set<Iri> getNames(ImmutableGraph ImmutableGraph) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
@@ -98,7 +97,7 @@ public class WeightedA implements WeightedTcProvider {
     }
 
     @Override
-    public Set<Iri> listTripleCollections() {
+    public Set<Iri> listImmutableGraphs() {
         return listGraphs();
     }
 }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA1.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA1.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA1.java
index 467c645..f280178 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA1.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedA1.java
@@ -21,9 +21,9 @@ package org.apache.clerezza.rdf.core.access.providers;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.commons.rdf.ImmutableGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.MGraph;
-import org.apache.commons.rdf.TripleCollection;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
 import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
@@ -45,50 +45,50 @@ public class WeightedA1 implements WeightedTcProvider {
     }
 
     @Override
-    public Graph getGraph(Iri name) throws NoSuchEntityException {
+    public ImmutableGraph getGraph(Iri name) throws NoSuchEntityException {
         if (name.equals(TcManagerTest.uriRefA)) {
-            MGraph mResult = new SimpleMGraph();
+            Graph mResult = new SimpleMGraph();
             mResult.add(new TripleImpl(TcManagerTest.uriRefA1, 
                     TcManagerTest.uriRefA1, TcManagerTest.uriRefA1));
             mGraphList.add(name);
-            return mResult.getGraph();
+            return mResult.getImmutableGraph();
         }
         throw new NoSuchEntityException(name);
     }
 
     @Override
-    public MGraph getMGraph(Iri name) throws NoSuchEntityException {
+    public Graph getMGraph(Iri name) throws NoSuchEntityException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public TripleCollection getTriples(Iri name) throws NoSuchEntityException {
+    public Graph getTriples(Iri name) throws NoSuchEntityException {
         return getGraph(name);
     }
 
     @Override
-    public MGraph createMGraph(Iri name) {
+    public Graph createMGraph(Iri name) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Graph createGraph(Iri name, TripleCollection triples) {
+    public ImmutableGraph createGraph(Iri name, Graph triples) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public void deleteTripleCollection(Iri name) throws NoSuchEntityException, 
+    public void deleteGraph(Iri name) throws NoSuchEntityException, 
             EntityUndeletableException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Set<Iri> getNames(Graph graph) {
+    public Set<Iri> getNames(ImmutableGraph ImmutableGraph) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Set<Iri> listGraphs() {
+    public Set<Iri> listImmutableGraphs() {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
@@ -98,7 +98,7 @@ public class WeightedA1 implements WeightedTcProvider {
     }
 
     @Override
-    public Set<Iri> listTripleCollections() {
+    public Set<Iri> listGraphs() {
         return listMGraphs();
     }
 }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedAHeavy.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedAHeavy.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedAHeavy.java
index c4e6856..d5f0ae5 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedAHeavy.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedAHeavy.java
@@ -22,9 +22,9 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.commons.rdf.ImmutableGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.MGraph;
-import org.apache.commons.rdf.TripleCollection;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
 import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
@@ -45,44 +45,44 @@ public class WeightedAHeavy implements WeightedTcProvider {
     }
 
     @Override
-    public Graph getGraph(Iri name) throws NoSuchEntityException {
+    public ImmutableGraph getGraph(Iri name) throws NoSuchEntityException {
         if (name.equals(TcManagerTest.uriRefA)) {
-            MGraph mResult = new SimpleMGraph();
+            Graph mResult = new SimpleMGraph();
             mResult.add(new TripleImpl(TcManagerTest.uriRefAHeavy, 
                     TcManagerTest.uriRefAHeavy, TcManagerTest.uriRefAHeavy));
-            return mResult.getGraph();
+            return mResult.getImmutableGraph();
         }
         throw new NoSuchEntityException(name);
     }
 
     @Override
-    public MGraph getMGraph(Iri name) throws NoSuchEntityException {
+    public Graph getMGraph(Iri name) throws NoSuchEntityException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public TripleCollection getTriples(Iri name) throws NoSuchEntityException {
+    public Graph getTriples(Iri name) throws NoSuchEntityException {
         return getGraph(name);
     }
 
     @Override
-    public MGraph createMGraph(Iri name) {
+    public Graph createMGraph(Iri name) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Graph createGraph(Iri name, TripleCollection triples) {
+    public ImmutableGraph createGraph(Iri name, Graph triples) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public void deleteTripleCollection(Iri name) throws NoSuchEntityException, 
+    public void deleteGraph(Iri name) throws NoSuchEntityException, 
             EntityUndeletableException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Set<Iri> getNames(Graph graph) {
+    public Set<Iri> getNames(ImmutableGraph ImmutableGraph) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
     @Override
@@ -96,7 +96,7 @@ public class WeightedAHeavy implements WeightedTcProvider {
     }
 
     @Override
-    public Set<Iri> listTripleCollections() {
+    public Set<Iri> listImmutableGraphs() {
         return listGraphs();
     }
 }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedBlight.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedBlight.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedBlight.java
index 36a4aa7..b0e3192 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedBlight.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedBlight.java
@@ -21,9 +21,9 @@ package org.apache.clerezza.rdf.core.access.providers;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.commons.rdf.ImmutableGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.MGraph;
-import org.apache.commons.rdf.TripleCollection;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
 import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
@@ -44,53 +44,53 @@ public class WeightedBlight implements WeightedTcProvider {
     }
 
     @Override
-    public Graph getGraph(Iri name) throws NoSuchEntityException {
+    public ImmutableGraph getGraph(Iri name) throws NoSuchEntityException {
         if (name.equals(TcManagerTest.uriRefB)) {
-            MGraph mResult = new SimpleMGraph();
+            Graph mResult = new SimpleMGraph();
             mResult.add(new TripleImpl(TcManagerTest.uriRefB, TcManagerTest.uriRefB, TcManagerTest.uriRefB));
-            return mResult.getGraph();
+            return mResult.getImmutableGraph();
         }
         if (name.equals(TcManagerTest.uriRefA)) {
-            MGraph mResult = new SimpleMGraph();
-            //empty graph
-            return mResult.getGraph();
+            Graph mResult = new SimpleMGraph();
+            //empty ImmutableGraph
+            return mResult.getImmutableGraph();
         }
         throw new NoSuchEntityException(name);
     }
 
     @Override
-    public MGraph getMGraph(Iri name) throws NoSuchEntityException {
+    public Graph getMGraph(Iri name) throws NoSuchEntityException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public TripleCollection getTriples(Iri name) throws NoSuchEntityException {
+    public Graph getTriples(Iri name) throws NoSuchEntityException {
         return getGraph(name);
     }
 
     @Override
-    public MGraph createMGraph(Iri name) {
+    public Graph createMGraph(Iri name) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Graph createGraph(Iri name, TripleCollection triples) {
+    public ImmutableGraph createGraph(Iri name, Graph triples) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public void deleteTripleCollection(Iri name) throws NoSuchEntityException, 
+    public void deleteGraph(Iri name) throws NoSuchEntityException, 
             EntityUndeletableException {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Set<Iri> getNames(Graph graph) {
+    public Set<Iri> getNames(ImmutableGraph ImmutableGraph) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
     @Override
-    public Set<Iri> listGraphs() {
+    public Set<Iri> listImmutableGraphs() {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
@@ -100,7 +100,7 @@ public class WeightedBlight implements WeightedTcProvider {
     }
 
     @Override
-    public Set<Iri> listTripleCollections() {
+    public Set<Iri> listGraphs() {
         return listMGraphs();
     }
 

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedDummy.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedDummy.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedDummy.java
index 085f7d4..cc9bd88 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedDummy.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/access/providers/WeightedDummy.java
@@ -23,15 +23,15 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.rdf.ImmutableGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.MGraph;
-import org.apache.commons.rdf.TripleCollection;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
 import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
 import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
 import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
-import org.apache.clerezza.rdf.core.impl.SimpleGraph;
+import org.apache.clerezza.rdf.core.impl.SimpleImmutableGraph;
 import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
 
 /**
@@ -40,10 +40,10 @@ import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
  */
 public class WeightedDummy implements WeightedTcProvider {
 
-    private Map<Iri, TripleCollection> tripleMap = new HashMap<Iri, TripleCollection>();
+    private Map<Iri, Graph> tripleMap = new HashMap<Iri, Graph>();
 
     @Override
-    public Graph createGraph(Iri name, TripleCollection triples)
+    public ImmutableGraph createGraph(Iri name, Graph triples)
             throws EntityAlreadyExistsException {
         if ((name == null) || (name.getUnicodeString() == null)
                 || (name.getUnicodeString().trim().length() == 0)) {
@@ -51,15 +51,15 @@ public class WeightedDummy implements WeightedTcProvider {
         }
 
         try {
-            // throws NoSuchEntityException if a TripleCollection with that name
+            // throws NoSuchEntityException if a Graph with that name
             // already exists
             this.getTriples(name);
         } catch (NoSuchEntityException e) {
-            Graph result;
-            if (Graph.class.isAssignableFrom(triples.getClass())) {
-                result = (Graph) triples;
+            ImmutableGraph result;
+            if (ImmutableGraph.class.isAssignableFrom(triples.getClass())) {
+                result = (ImmutableGraph) triples;
             } else {
-                result = new SimpleGraph(triples);
+                result = new SimpleImmutableGraph(triples);
             }
             tripleMap.put(name, result);
 
@@ -69,18 +69,18 @@ public class WeightedDummy implements WeightedTcProvider {
     }
 
     @Override
-    public MGraph createMGraph(Iri name) throws EntityAlreadyExistsException {
+    public Graph createMGraph(Iri name) throws EntityAlreadyExistsException {
         if ((name == null) || (name.getUnicodeString() == null)
                 || (name.getUnicodeString().trim().length() == 0)) {
             throw new IllegalArgumentException("Name must not be null");
         }
 
         try {
-            // throws NoSuchEntityException if a TripleCollection with that name
+            // throws NoSuchEntityException if a Graph with that name
             // already exists
             this.getTriples(name);
         } catch (NoSuchEntityException e) {
-            MGraph result = new SimpleMGraph();
+            Graph result = new SimpleMGraph();
             tripleMap.put(name, result);
             return result;
         }
@@ -88,7 +88,7 @@ public class WeightedDummy implements WeightedTcProvider {
     }
 
     @Override
-    public void deleteTripleCollection(Iri name)
+    public void deleteGraph(Iri name)
             throws NoSuchEntityException, EntityUndeletableException {
         if (tripleMap.remove(name) == null) {
             throw new NoSuchEntityException(name);
@@ -96,41 +96,41 @@ public class WeightedDummy implements WeightedTcProvider {
     }
 
     @Override
-    public Graph getGraph(Iri name) throws NoSuchEntityException {
-        TripleCollection tripleCollection = tripleMap.get(name);
-        if (tripleCollection == null) {
+    public ImmutableGraph getGraph(Iri name) throws NoSuchEntityException {
+        Graph Graph = tripleMap.get(name);
+        if (Graph == null) {
             throw new NoSuchEntityException(name);
-        } else if (Graph.class.isAssignableFrom(tripleCollection.getClass())) {
-            return (Graph) tripleCollection;
+        } else if (ImmutableGraph.class.isAssignableFrom(Graph.getClass())) {
+            return (ImmutableGraph) Graph;
         }
         throw new NoSuchEntityException(name);
     }
 
     @Override
-    public MGraph getMGraph(Iri name) throws NoSuchEntityException {
-        TripleCollection tripleCollection = tripleMap.get(name);
-        if (tripleCollection == null) {
+    public Graph getMGraph(Iri name) throws NoSuchEntityException {
+        Graph Graph = tripleMap.get(name);
+        if (Graph == null) {
             throw new NoSuchEntityException(name);
-        } else if (MGraph.class.isAssignableFrom(tripleCollection.getClass())) {
-            return (MGraph) tripleCollection;
+        } else if (Graph.class.isAssignableFrom(Graph.getClass())) {
+            return (Graph) Graph;
         }
         throw new NoSuchEntityException(name);
     }
 
     @Override
-    public Set<Iri> getNames(Graph graph) {
+    public Set<Iri> getNames(ImmutableGraph ImmutableGraph) {
         throw new UnsupportedOperationException(
                 "Not supported yet. equals() has to be implemented first");
     }
 
     @Override
-    public TripleCollection getTriples(Iri name)
+    public Graph getTriples(Iri name)
             throws NoSuchEntityException {
-        TripleCollection tripleCollection = tripleMap.get(name);
-        if (tripleCollection == null) {
+        Graph Graph = tripleMap.get(name);
+        if (Graph == null) {
             throw new NoSuchEntityException(name);
         } else {
-            return tripleCollection;
+            return Graph;
         }
     }
 
@@ -140,7 +140,7 @@ public class WeightedDummy implements WeightedTcProvider {
     }
 
     @Override
-    public Set<Iri> listGraphs() {
+    public Set<Iri> listImmutableGraphs() {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
@@ -150,7 +150,7 @@ public class WeightedDummy implements WeightedTcProvider {
     }
 
     @Override
-    public Set<Iri> listTripleCollections() {
+    public Set<Iri> listGraphs() {
         return listMGraphs();
     }
 }

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/events/NotificationTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/events/NotificationTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/events/NotificationTest.java
index 147a6b2..09a25e8 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/events/NotificationTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/events/NotificationTest.java
@@ -25,7 +25,7 @@ import java.util.Set;
 import org.junit.Assert;
 import org.junit.Test;
 import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.TripleCollection;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Iri;
 import org.apache.commons.rdf.event.FilterTriple;
 import org.apache.commons.rdf.event.GraphEvent;
@@ -39,7 +39,7 @@ import org.apache.clerezza.rdf.core.impl.TripleImpl;
  */
 public class NotificationTest {
     @Test public void getEventsTogether() throws Exception {
-        final TripleCollection tc = new SimpleMGraph();
+        final Graph tc = new SimpleMGraph();
         final List<List<GraphEvent>> eventChunks = new ArrayList<List<GraphEvent>>();
         GraphListener myGraphListener = new GraphListener() {
             @Override
@@ -68,7 +68,7 @@ public class NotificationTest {
 
 
     @Test public void synchroneousEvents() throws Exception {
-        final TripleCollection tc = new SimpleMGraph();
+        final Graph tc = new SimpleMGraph();
         final List<List<GraphEvent>> eventChunks = new ArrayList<List<GraphEvent>>();
         GraphListener myGraphListener = new GraphListener() {
             @Override

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleGraphTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleGraphTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleGraphTest.java
new file mode 100644
index 0000000..b4f5aa4
--- /dev/null
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleGraphTest.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.clerezza.rdf.core.impl;
+
+import java.util.ConcurrentModificationException;
+import java.util.Iterator;
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.commons.rdf.Triple;
+import org.apache.commons.rdf.Iri;
+
+/**
+ *
+ * @author mir
+ */
+public class SimpleGraphTest {
+
+    private Iri uriRef1 = new Iri("http://example.org/foo");
+    private Iri uriRef2 = new Iri("http://example.org/bar");
+    private Iri uriRef3 = new Iri("http://example.org/test");
+    private Triple triple1 = new TripleImpl(uriRef1, uriRef2, uriRef3);
+    private Triple triple2 = new TripleImpl(uriRef2, uriRef2, uriRef1);
+    private Triple triple3 = new TripleImpl(uriRef3, uriRef1, uriRef3);
+    private Triple triple4 = new TripleImpl(uriRef1, uriRef3, uriRef2);
+    private Triple triple5 = new TripleImpl(uriRef2, uriRef3, uriRef2);
+        
+    @Test
+    public void iteratorRemove() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);
+        Iterator<Triple> iter = stc.iterator();
+        while (iter.hasNext()) {
+            Triple triple = iter.next();
+            iter.remove();
+        }
+        Assert.assertEquals(0, stc.size());
+    }
+
+    @Test
+    public void removeAll() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);
+        SimpleGraph stc2 = new SimpleGraph();
+        stc2.add(triple1);
+        stc2.add(triple3);
+        stc2.add(triple5);
+        stc.removeAll(stc2);
+        Assert.assertEquals(2, stc.size());
+    }
+    
+    @Test
+    public void filterIteratorRemove() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);        
+        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
+        while (iter.hasNext()) {
+            Triple triple = iter.next();
+            iter.remove();
+        }
+        Assert.assertEquals(3, stc.size());
+    }
+
+    @Test(expected=ConcurrentModificationException.class)
+    public void remove() {
+        SimpleGraph stc = new SimpleGraph();
+        stc.setCheckConcurrency(true);
+        stc.add(triple1);
+        stc.add(triple2);
+        stc.add(triple3);
+        stc.add(triple4);
+        stc.add(triple5);
+        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
+        while (iter.hasNext()) {
+            Triple triple = iter.next();
+            stc.remove(triple);
+        }
+        Assert.assertEquals(3, stc.size());
+    }
+}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleTripleCollectionTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleTripleCollectionTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleTripleCollectionTest.java
deleted file mode 100644
index 084a79f..0000000
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/SimpleTripleCollectionTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.clerezza.rdf.core.impl;
-
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import org.junit.Assert;
-import org.junit.Test;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-
-/**
- *
- * @author mir
- */
-public class SimpleTripleCollectionTest {
-
-    private Iri uriRef1 = new Iri("http://example.org/foo");
-    private Iri uriRef2 = new Iri("http://example.org/bar");
-    private Iri uriRef3 = new Iri("http://example.org/test");
-    private Triple triple1 = new TripleImpl(uriRef1, uriRef2, uriRef3);
-    private Triple triple2 = new TripleImpl(uriRef2, uriRef2, uriRef1);
-    private Triple triple3 = new TripleImpl(uriRef3, uriRef1, uriRef3);
-    private Triple triple4 = new TripleImpl(uriRef1, uriRef3, uriRef2);
-    private Triple triple5 = new TripleImpl(uriRef2, uriRef3, uriRef2);
-        
-    @Test
-    public void iteratorRemove() {
-        SimpleTripleCollection stc = new SimpleTripleCollection();
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);
-        Iterator<Triple> iter = stc.iterator();
-        while (iter.hasNext()) {
-            Triple triple = iter.next();
-            iter.remove();
-        }
-        Assert.assertEquals(0, stc.size());
-    }
-
-    @Test
-    public void removeAll() {
-        SimpleTripleCollection stc = new SimpleTripleCollection();
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);
-        SimpleTripleCollection stc2 = new SimpleTripleCollection();
-        stc2.add(triple1);
-        stc2.add(triple3);
-        stc2.add(triple5);
-        stc.removeAll(stc2);
-        Assert.assertEquals(2, stc.size());
-    }
-    
-    @Test
-    public void filterIteratorRemove() {
-        SimpleTripleCollection stc = new SimpleTripleCollection();
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);        
-        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
-        while (iter.hasNext()) {
-            Triple triple = iter.next();
-            iter.remove();
-        }
-        Assert.assertEquals(3, stc.size());
-    }
-
-    @Test(expected=ConcurrentModificationException.class)
-    public void remove() {
-        SimpleTripleCollection stc = new SimpleTripleCollection();
-        stc.setCheckConcurrency(true);
-        stc.add(triple1);
-        stc.add(triple2);
-        stc.add(triple3);
-        stc.add(triple4);
-        stc.add(triple5);
-        Iterator<Triple> iter = stc.filter(uriRef1, null, null);
-        while (iter.hasNext()) {
-            Triple triple = iter.next();
-            stc.remove(triple);
-        }
-        Assert.assertEquals(3, stc.size());
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/GraphMatcherTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/GraphMatcherTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/GraphMatcherTest.java
index 135a255..5c7248d 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/GraphMatcherTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/GraphMatcherTest.java
@@ -20,11 +20,11 @@ package org.apache.clerezza.rdf.core.impl.graphmatching;
 
 import java.util.Map;
 import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.MGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.BlankNodeOrIri;
 import org.apache.commons.rdf.RdfTerm;
 import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.TripleCollection;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
 import org.apache.clerezza.rdf.core.impl.TripleImpl;
@@ -41,8 +41,8 @@ public class GraphMatcherTest {
 
     @Test
     public void testEmpty() {
-        TripleCollection tc1 = new SimpleMGraph();
-        TripleCollection tc2 = new SimpleMGraph();
+        Graph tc1 = new SimpleMGraph();
+        Graph tc2 = new SimpleMGraph();
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNotNull(mapping);
         Assert.assertEquals(0, mapping.size());
@@ -50,18 +50,18 @@ public class GraphMatcherTest {
 
     @Test
     public void test2() {
-        TripleCollection tc1 = new SimpleMGraph();
+        Graph tc1 = new SimpleMGraph();
         tc1.add(new TripleImpl(u1, u1, u1));
-        TripleCollection tc2 = new SimpleMGraph();
+        Graph tc2 = new SimpleMGraph();
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNull(mapping);
     }
 
     @Test
     public void test3() {
-        TripleCollection tc1 = new SimpleMGraph();
+        Graph tc1 = new SimpleMGraph();
         tc1.add(new TripleImpl(u1, u1, u1));
-        TripleCollection tc2 = new SimpleMGraph();
+        Graph tc2 = new SimpleMGraph();
         tc2.add(new TripleImpl(u1, u1, u1));
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNotNull(mapping);
@@ -70,9 +70,9 @@ public class GraphMatcherTest {
 
     @Test
     public void test4() {
-        TripleCollection tc1 = new SimpleMGraph();
+        Graph tc1 = new SimpleMGraph();
         tc1.add(new TripleImpl(u1, u1, new BlankNode()));
-        TripleCollection tc2 = new SimpleMGraph();
+        Graph tc2 = new SimpleMGraph();
         tc2.add(new TripleImpl(u1, u1, new BlankNode()));
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNotNull(mapping);
@@ -81,9 +81,9 @@ public class GraphMatcherTest {
 
     @Test
     public void test5() {
-        TripleCollection tc1 = new SimpleMGraph();
+        Graph tc1 = new SimpleMGraph();
         tc1.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
-        TripleCollection tc2 = new SimpleMGraph();
+        Graph tc2 = new SimpleMGraph();
         tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNotNull(mapping);
@@ -92,25 +92,25 @@ public class GraphMatcherTest {
 
     @Test
     public void test6() {
-        TripleCollection tc1 = new SimpleMGraph();
+        Graph tc1 = new SimpleMGraph();
         final BlankNode b11 = new BlankNode();
         tc1.add(new TripleImpl(new BlankNode(), u1,b11));
         tc1.add(new TripleImpl(new BlankNode(), u1,b11));
-        TripleCollection tc2 = new SimpleMGraph();
+        Graph tc2 = new SimpleMGraph();
         tc2.add(new TripleImpl(new BlankNode(), u1, new BlankNode()));
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNull(mapping);
     }
 
-    private MGraph generateCircle(int size) {
+    private Graph generateCircle(int size) {
         return generateCircle(size, new BlankNode());
     }
 
-    private MGraph generateCircle(int size, final BlankNodeOrIri firstNode) {
+    private Graph generateCircle(int size, final BlankNodeOrIri firstNode) {
         if (size < 1) {
             throw new IllegalArgumentException();
         }
-        MGraph result = new SimpleMGraph();
+        Graph result = new SimpleMGraph();
         BlankNodeOrIri lastNode = firstNode;
         for (int i = 0; i < (size-1); i++) {
             final BlankNode newNode = new BlankNode();
@@ -123,8 +123,8 @@ public class GraphMatcherTest {
 
     @Test
     public void test7() {
-        TripleCollection tc1 = generateCircle(2);
-        TripleCollection tc2 = generateCircle(2);
+        Graph tc1 = generateCircle(2);
+        Graph tc2 = generateCircle(2);
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNotNull(mapping);
         Assert.assertEquals(2, mapping.size());
@@ -132,8 +132,8 @@ public class GraphMatcherTest {
 
     @Test
     public void test8() {
-        TripleCollection tc1 = generateCircle(5);
-        TripleCollection tc2 = generateCircle(5);
+        Graph tc1 = generateCircle(5);
+        Graph tc2 = generateCircle(5);
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
         Assert.assertNotNull(mapping);
         Assert.assertEquals(5, mapping.size());
@@ -142,9 +142,9 @@ public class GraphMatcherTest {
     @Test
     public void test9() {
         BlankNodeOrIri crossing = new Iri("http://example.org/");
-        TripleCollection tc1 = generateCircle(2,crossing);
+        Graph tc1 = generateCircle(2,crossing);
         tc1.addAll(generateCircle(3,crossing));
-        TripleCollection tc2 = generateCircle(2,crossing);
+        Graph tc2 = generateCircle(2,crossing);
         tc2.addAll(generateCircle(3,crossing));
         Assert.assertEquals(5, tc1.size());
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
@@ -156,10 +156,10 @@ public class GraphMatcherTest {
     @Test
     public void test10() {
         BlankNodeOrIri crossing1 = new BlankNode();
-        TripleCollection tc1 = generateCircle(2,crossing1);
+        Graph tc1 = generateCircle(2,crossing1);
         tc1.addAll(generateCircle(3,crossing1));
         BlankNodeOrIri crossing2 = new BlankNode();
-        TripleCollection tc2 = generateCircle(2,crossing2);
+        Graph tc2 = generateCircle(2,crossing2);
         tc2.addAll(generateCircle(3,crossing2));
         Assert.assertEquals(5, tc1.size());
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
@@ -171,10 +171,10 @@ public class GraphMatcherTest {
     @Test
     public void test11() {
         BlankNodeOrIri crossing1 = new BlankNode();
-        TripleCollection tc1 = generateCircle(2,crossing1);
+        Graph tc1 = generateCircle(2,crossing1);
         tc1.addAll(generateCircle(4,crossing1));
         BlankNodeOrIri crossing2 = new BlankNode();
-        TripleCollection tc2 = generateCircle(3,crossing2);
+        Graph tc2 = generateCircle(3,crossing2);
         tc2.addAll(generateCircle(3,crossing2));
         Assert.assertEquals(6, tc1.size());
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
@@ -184,10 +184,10 @@ public class GraphMatcherTest {
     @Test
     public void test12() {
         BlankNodeOrIri start1 = new BlankNode();
-        TripleCollection tc1 = Utils4Testing.generateLine(4,start1);
+        Graph tc1 = Utils4Testing.generateLine(4,start1);
         tc1.addAll(Utils4Testing.generateLine(5,start1));
         BlankNodeOrIri start2 = new BlankNode();
-        TripleCollection tc2 = Utils4Testing.generateLine(5,start2);
+        Graph tc2 = Utils4Testing.generateLine(5,start2);
         tc2.addAll(Utils4Testing.generateLine(4,start2));
         Assert.assertEquals(9, tc1.size());
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
@@ -198,10 +198,10 @@ public class GraphMatcherTest {
     @Test
     public void test13() {
         BlankNodeOrIri start1 = new BlankNode();
-        TripleCollection tc1 = Utils4Testing.generateLine(4,start1);
+        Graph tc1 = Utils4Testing.generateLine(4,start1);
         tc1.addAll(Utils4Testing.generateLine(5,start1));
         BlankNodeOrIri start2 = new BlankNode();
-        TripleCollection tc2 = Utils4Testing.generateLine(3,start2);
+        Graph tc2 = Utils4Testing.generateLine(3,start2);
         tc2.addAll(Utils4Testing.generateLine(3,start2));
         Assert.assertEquals(9, tc1.size());
         final Map<BlankNode, BlankNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/HashMatchingTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/HashMatchingTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/HashMatchingTest.java
index a700ca2..075d38b 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/HashMatchingTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/HashMatchingTest.java
@@ -22,7 +22,7 @@ package org.apache.clerezza.rdf.core.impl.graphmatching;
 import java.util.Map;
 
 import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.MGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.BlankNodeOrIri;
 import org.junit.Assert;
 import org.junit.Test;
@@ -36,10 +36,10 @@ public class HashMatchingTest {
     @Test
     public void twoLine() throws GraphNotIsomorphicException {
         BlankNodeOrIri start1 = new BlankNode();
-        MGraph tc1 = Utils4Testing.generateLine(4,start1);
+        Graph tc1 = Utils4Testing.generateLine(4,start1);
         tc1.addAll(Utils4Testing.generateLine(5,start1));
         BlankNodeOrIri start2 = new BlankNode();
-        MGraph tc2 = Utils4Testing.generateLine(5,start2);
+        Graph tc2 = Utils4Testing.generateLine(5,start2);
         tc2.addAll(Utils4Testing.generateLine(4,start2));
         Assert.assertEquals(9, tc1.size());
         final Map<BlankNode, BlankNode> mapping = new HashMatching(tc1, tc2).getMatchings();

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/Utils4Testing.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/Utils4Testing.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/Utils4Testing.java
index 1e09590..d5ef512 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/Utils4Testing.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/impl/graphmatching/Utils4Testing.java
@@ -20,7 +20,7 @@
 package org.apache.clerezza.rdf.core.impl.graphmatching;
 
 import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.MGraph;
+import org.apache.commons.rdf.Graph;
 import org.apache.commons.rdf.BlankNodeOrIri;
 import org.apache.commons.rdf.Iri;
 import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
@@ -32,11 +32,11 @@ import org.apache.clerezza.rdf.core.impl.TripleImpl;
  */
 public class Utils4Testing {
 
-    static MGraph generateLine(int size, final BlankNodeOrIri firstNode) {
+    static Graph generateLine(int size, final BlankNodeOrIri firstNode) {
         if (size < 1) {
             throw new IllegalArgumentException();
         }
-        MGraph result = new SimpleMGraph();
+        Graph result = new SimpleMGraph();
         BlankNodeOrIri lastNode = firstNode;
         for (int i = 0; i < size; i++) {
             final BlankNode newNode = new BlankNode();

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/ParserTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/ParserTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/ParserTest.java
index 2fc6aa2..27a56d9 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/ParserTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/ParserTest.java
@@ -19,7 +19,7 @@
 package org.apache.clerezza.rdf.core.serializedform;
 
 import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.MGraph;
+import org.apache.commons.rdf.Graph;
 import java.io.InputStream;
 import junit.framework.Assert;
 
@@ -74,7 +74,7 @@ public class ParserTest {
     static class ParsingProviderA implements ParsingProvider {
 
         @Override
-        public void parse(MGraph target, InputStream serializedGraph, String formatIdentifier, Iri baseUri) {
+        public void parse(Graph target, InputStream serializedGraph, String formatIdentifier, Iri baseUri) {
             providerAInvoked = true;
         }
     };
@@ -82,7 +82,7 @@ public class ParserTest {
     static class ParsingProviderB implements ParsingProvider {
 
         @Override
-        public void parse(MGraph target, InputStream serializedGraph, String formatIdentifier, Iri baseUri) {
+        public void parse(Graph target, InputStream serializedGraph, String formatIdentifier, Iri baseUri) {
             providerBInvoked = true;
         }
     };

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/SerializerTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/SerializerTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/SerializerTest.java
index 14076c1..f947a04 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/SerializerTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/SerializerTest.java
@@ -18,7 +18,7 @@
  */
 package org.apache.clerezza.rdf.core.serializedform;
 
-import org.apache.commons.rdf.TripleCollection;
+import org.apache.commons.rdf.Graph;
 import java.io.OutputStream;
 
 import junit.framework.Assert;
@@ -74,7 +74,7 @@ public class SerializerTest {
     static class SerializingProviderA implements SerializingProvider {
 
         @Override
-        public void serialize(OutputStream serializedGraph, TripleCollection tc, String formatIdentifier) {
+        public void serialize(OutputStream serializedGraph, Graph tc, String formatIdentifier) {
             providerAInvoked = true;
         }
     };
@@ -82,7 +82,7 @@ public class SerializerTest {
     static class SerializingProviderB implements SerializingProvider {
 
         @Override
-        public void serialize(OutputStream serializedGraph, TripleCollection tc, String formatIdentifier) {
+        public void serialize(OutputStream serializedGraph, Graph tc, String formatIdentifier) {
             providerBInvoked = true;
         }
     };

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/TestServiceManagedProvider.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/TestServiceManagedProvider.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/TestServiceManagedProvider.java
index b05ef25..f344939 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/TestServiceManagedProvider.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/serializedform/TestServiceManagedProvider.java
@@ -19,7 +19,7 @@
 package org.apache.clerezza.rdf.core.serializedform;
 
 import java.io.InputStream;
-import org.apache.commons.rdf.MGraph;
+import org.apache.commons.rdf.Graph;
 import org.junit.Assert;
 import org.junit.Test;
 import org.apache.commons.rdf.Iri;
@@ -36,7 +36,7 @@ public class TestServiceManagedProvider implements ParsingProvider {
     private static boolean parseInvoked;
 
     @Override
-    public void parse(MGraph target, InputStream serializedGraph, String formatIdentifier, Iri baseUri) {
+    public void parse(Graph target, InputStream serializedGraph, String formatIdentifier, Iri baseUri) {
         parseInvoked = true;
     }
     

http://git-wip-us.apache.org/repos/asf/clerezza/blob/9ae0a1bc/rdf.core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
----------------------------------------------------------------------
diff --git a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
index e524dc5..c03c2d0 100644
--- a/rdf.core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
+++ b/rdf.core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
@@ -31,13 +31,13 @@ import org.junit.Test;
  */
 public class SparqlPreParserTest {
 
-    private final static Iri DEFAULT_GRAPH = new Iri("http://example.org/default.graph"); 
-    private final static Iri NAMED_GRAPH = new Iri("http://example.org/dummy.graph"); 
-    private final static Iri TEST_GRAPH = new Iri("http://example.org/test.graph"); 
+    private final static Iri DEFAULT_GRAPH = new Iri("http://example.org/default.ImmutableGraph"); 
+    private final static Iri NAMED_GRAPH = new Iri("http://example.org/dummy.ImmutableGraph"); 
+    private final static Iri TEST_GRAPH = new Iri("http://example.org/test.ImmutableGraph"); 
 
     class MyTcManager extends TcManager {
         @Override
-        public Set<Iri> listTripleCollections() {
+        public Set<Iri> listGraphs() {
             Set<Iri> result = new HashSet<Iri>();
             result.add(NAMED_GRAPH);
             return result;
@@ -65,7 +65,7 @@ public class SparqlPreParserTest {
     public void testAllGraphReferenceInSelectQuery() throws ParseException {
 
         StringBuilder queryStrBuilder = new StringBuilder();
-        queryStrBuilder.append("SELECT DISTINCT ?g { GRAPH ?g { ?s ?p ?o } }\n");
+        queryStrBuilder.append("SELECT DISTINCT ?g { ImmutableGraph ?g { ?s ?p ?o } }\n");
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -116,7 +116,7 @@ public class SparqlPreParserTest {
     @Test
     public void testLoadingToGraph() throws ParseException {
 
-        String queryStr = "LOAD SILENT <http://example.org/mydata> INTO GRAPH " + TEST_GRAPH.toString();
+        String queryStr = "LOAD SILENT <http://example.org/mydata> INTO ImmutableGraph " + TEST_GRAPH.toString();
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -149,7 +149,7 @@ public class SparqlPreParserTest {
     @Test
     public void testClearingGraph() throws ParseException {
 
-        String queryStr = "CLEAR SILENT GRAPH " + TEST_GRAPH.toString();
+        String queryStr = "CLEAR SILENT ImmutableGraph " + TEST_GRAPH.toString();
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -182,7 +182,7 @@ public class SparqlPreParserTest {
     @Test
     public void testDroppingGraph() throws ParseException {
 
-        String queryStr = "DROP SILENT GRAPH " + TEST_GRAPH.toString();
+        String queryStr = "DROP SILENT ImmutableGraph " + TEST_GRAPH.toString();
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -193,7 +193,7 @@ public class SparqlPreParserTest {
     @Test
     public void testCreatingGraph() throws ParseException {
 
-        String queryStr = "CREATE SILENT GRAPH " + TEST_GRAPH.toString();
+        String queryStr = "CREATE SILENT ImmutableGraph " + TEST_GRAPH.toString();
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -204,7 +204,7 @@ public class SparqlPreParserTest {
     @Test
     public void testAddingTriplesFromDefaultGraphToNamedGraph() throws ParseException {
 
-        String queryStr = "ADD SILENT DEFAULT TO GRAPH " + TEST_GRAPH.toString();
+        String queryStr = "ADD SILENT DEFAULT TO ImmutableGraph " + TEST_GRAPH.toString();
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -218,7 +218,7 @@ public class SparqlPreParserTest {
     @Test
     public void testAddingTriplesFromNamedGraphToDefaultGraph() throws ParseException {
 
-        String queryStr = "ADD SILENT GRAPH " + TEST_GRAPH.toString() + " TO DEFAULT";
+        String queryStr = "ADD SILENT ImmutableGraph " + TEST_GRAPH.toString() + " TO DEFAULT";
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -232,7 +232,7 @@ public class SparqlPreParserTest {
     @Test
     public void testMovingTriplesFromDefaultGraphToNamedGraph() throws ParseException {
 
-        String queryStr = "MOVE SILENT DEFAULT TO GRAPH " + TEST_GRAPH.toString();
+        String queryStr = "MOVE SILENT DEFAULT TO ImmutableGraph " + TEST_GRAPH.toString();
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -246,7 +246,7 @@ public class SparqlPreParserTest {
     @Test
     public void testMovingTriplesFromNamedGraphToDefaultGraph() throws ParseException {
 
-        String queryStr = "MOVE SILENT GRAPH " + TEST_GRAPH.toString() + " TO DEFAULT";
+        String queryStr = "MOVE SILENT ImmutableGraph " + TEST_GRAPH.toString() + " TO DEFAULT";
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -260,7 +260,7 @@ public class SparqlPreParserTest {
     @Test
     public void testCopyingTriplesFromDefaultGraphToNamedGraph() throws ParseException {
 
-        String queryStr = "COPY SILENT DEFAULT TO GRAPH " + TEST_GRAPH.toString();
+        String queryStr = "COPY SILENT DEFAULT TO ImmutableGraph " + TEST_GRAPH.toString();
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -274,7 +274,7 @@ public class SparqlPreParserTest {
     @Test
     public void testCopyingTriplesFromNamedGraphToDefaultGraph() throws ParseException {
 
-        String queryStr = "COPY SILENT GRAPH " + TEST_GRAPH.toString() + " TO DEFAULT";
+        String queryStr = "COPY SILENT ImmutableGraph " + TEST_GRAPH.toString() + " TO DEFAULT";
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -301,7 +301,7 @@ public class SparqlPreParserTest {
     public void testInsertDataToNamedGraph() throws ParseException {
 
         String queryStr = "PREFIX ns: <http://example.org/ns#>\n" +
-                "INSERT DATA { GRAPH " + TEST_GRAPH.toString() + " { <http://example/book1>  ns:price  42 } }";
+                "INSERT DATA { ImmutableGraph " + TEST_GRAPH.toString() + " { <http://example/book1>  ns:price  42 } }";
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
         Set<Iri> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
@@ -324,7 +324,7 @@ public class SparqlPreParserTest {
     public void testDeleteDataInNamedGraph() throws ParseException {
 
         String queryStr = "PREFIX ns: <http://example.org/ns#>\n" +
-                "DELETE DATA { GRAPH " + TEST_GRAPH.toString() + " { <http://example/book1>  ns:price  42 } }";
+                "DELETE DATA { ImmutableGraph " + TEST_GRAPH.toString() + " { <http://example/book1>  ns:price  42 } }";
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
         Set<Iri> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
@@ -336,7 +336,7 @@ public class SparqlPreParserTest {
 
         String queryStr = "PREFIX ns: <http://example.org/ns#> " +
                 "INSERT DATA { <http://example/book1>  ns:price  42 }; " +
-                "DELETE DATA { GRAPH " + TEST_GRAPH.toString() + " { <http://example/book1>  ns:price  42 } }";
+                "DELETE DATA { ImmutableGraph " + TEST_GRAPH.toString() + " { <http://example/book1>  ns:price  42 } }";
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
         Set<Iri> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
@@ -364,8 +364,8 @@ public class SparqlPreParserTest {
     public void testDeleteWhereInNamedGraphs() throws ParseException {
 
         String queryStr = "PREFIX foaf: <http://xmlns.com/foaf/0.1/> DELETE WHERE " +
-                "{ GRAPH <http://example.com/names> { ?person foaf:givenName 'Fred' ; ?property1 ?value1 } " +
-                "  GRAPH <http://example.com/addresses> { ?person ?property2 ?value2 } }";
+                "{ ImmutableGraph <http://example.com/names> { ?person foaf:givenName 'Fred' ; ?property1 ?value1 } " +
+                "  ImmutableGraph <http://example.com/addresses> { ?person ?property2 ?value2 } }";
 
         SparqlPreParser parser;
         parser = new SparqlPreParser(TcManager.getInstance());
@@ -404,8 +404,8 @@ public class SparqlPreParserTest {
     @Test
     public void testInsertOperationToNamedGraph() throws ParseException {
         String queryStr = "PREFIX dc:  <http://purl.org/dc/elements/1.1/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> " +
-                "INSERT { GRAPH <http://example/bookStore2> { ?book ?p ?v } } " +
-                "WHERE { GRAPH <http://example/bookStore> { ?book dc:date ?date . " +
+                "INSERT { ImmutableGraph <http://example/bookStore2> { ?book ?p ?v } } " +
+                "WHERE { ImmutableGraph <http://example/bookStore> { ?book dc:date ?date . " +
                 "FILTER ( ?date > \"1970-01-01T00:00:00-02:00\"^^xsd:dateTime ) ?book ?p ?v } }";
 
         SparqlPreParser parser;
@@ -424,9 +424,9 @@ public class SparqlPreParserTest {
                 "PREFIX dcmitype: <http://purl.org/dc/dcmitype/>\n" +
                 "PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\n\n" +
                 "INSERT\n" +
-                "  { GRAPH <http://example/bookStore2> { ?book ?p ?v } }\n" +
+                "  { ImmutableGraph <http://example/bookStore2> { ?book ?p ?v } }\n" +
                 "WHERE\n" +
-                "  { GRAPH <http://example/bookStore>\n" +
+                "  { ImmutableGraph <http://example/bookStore>\n" +
                 "    { ?book dc:date ?date . \n" +
                 "      FILTER ( ?date < \"2000-01-01T00:00:00-02:00\"^^xsd:dateTime )\n" +
                 "      ?book ?p ?v\n" +


Mime
View raw message