Index: SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/www/SPServlet.java
===================================================================
--- SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/www/SPServlet.java (revision 153)
+++ SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/www/SPServlet.java (revision 165)
@@ -9,4 +9,5 @@
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
@@ -123,29 +124,48 @@
   
        JSONObject object = new JSONObject(jpath);
-       String startClass = object.getJSONObject("startClassURI").toString();
-       int width = Integer.parseInt(object.getJSONObject("width").toString());
+   
+    //   int width = Integer.parseInt(object.getJSONObject("width").toString());
        JSONArray classLinks = object.getJSONArray("classLinks");
         JSONObject jsonObject;
-        List <ClassLink> list = null;
+        List <ClassLink> list = new ArrayList<ClassLink>();
        
        for (int i=0;i<classLinks.length();i++) 
        {
             jsonObject = classLinks.getJSONObject(i);  
-            String propertyURI = jsonObject.getJSONObject("propertyURI").toString();
-            String linkedClassURI = jsonObject.getJSONObject("linkedClassURI").toString(); 
-             String linkedLiteralDatatypeURI = jsonObject.getJSONObject("linkedLiteralDatatypeURI").toString(); 
-            int numOfLinks = Integer.parseInt(jsonObject.getJSONObject("numOfLinks").toString());
-            int numOfLinkedInstances = Integer.parseInt(jsonObject.getJSONObject("numOfLinkedInstances").toString()); 
-            int numOfOriginInstances = Integer.parseInt(jsonObject.getJSONObject("numOfOriginInstances").toString());
-            int numOfOriginClassInstances = Integer.parseInt(jsonObject.getJSONObject("numOfOriginInstances").toString());            
-            int numOfLinkedClassInstances = Integer.parseInt(jsonObject.getJSONObject("numOfLinkedClassInstances").toString()); 
+               
+             String direction=jsonObject.getString("direction"); 
+             Direction myDirection = null;
+             if (direction.equals(Direction.forward.toString()))
+                     myDirection=Direction.forward;
+             else if (direction.equals(Direction.reverse.toString()))
+                 myDirection=Direction.reverse;
+                 else if (direction.equals(Direction.both.toString()))                  
+                  myDirection=Direction.both;
+           
+                 
+            String linkedLiteralDatatypeURI=null;
+               linkedLiteralDatatypeURI = jsonObject.getString("linkedLiteralDatatypeURI");
+               String linkedClassURI = jsonObject.getString("linkedClassURI"); 
+                  String propertyURI = jsonObject.getString("propertyURI");
               
-            ClassLink classLink =new ClassLink(propertyURI, linkedClassURI, linkedLiteralDatatypeURI, null, 
-				 numOfLinks,  numOfOriginInstances,  numOfLinkedInstances,
-				 numOfOriginClassInstances,  numOfLinkedClassInstances,
+        //    int numOfLinks = Integer.parseInt(jsonObject.getJSONObject("numOfLinks").toString());
+        //    int numOfLinkedInstances = Integer.parseInt(jsonObject.getJSONObject("numOfLinkedInstances").toString()); 
+        //    int numOfOriginInstances = Integer.parseInt(jsonObject.getJSONObject("numOfOriginInstances").toString());
+        //    int numOfOriginClassInstances = Integer.parseInt(jsonObject.getJSONObject("numOfOriginInstances").toString());            
+        //    int numOfLinkedClassInstances = Integer.parseInt(jsonObject.getJSONObject("numOfLinkedClassInstances").toString()); 
+              
+        //    ClassLink classLink =new ClassLink(propertyURI, linkedClassURI, linkedLiteralDatatypeURI, null, 
+	//			 numOfLinks,  numOfOriginInstances,  numOfLinkedInstances,
+	//			 numOfOriginClassInstances,  numOfLinkedClassInstances,
+	//			false, false);
+             ClassLink classLink =new ClassLink(propertyURI, linkedClassURI, linkedLiteralDatatypeURI, myDirection, 
+				 0,  0,  0,
+				 0,  0,
 				false, false);
+             
            list.add(classLink);
     }
-          Path path = new Path(startClass,  list,  width);
+           String startClass = object.getString("startClassURI");
+          Path path = new Path(startClass,  list,  0);
           return path;
     }
