Index: src/main/java/de/mpiwg/itgroup/annotations/Annotation.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/Annotation.java	(revision 4)
+++ src/main/java/de/mpiwg/itgroup/annotations/Annotation.java	(revision 5)
@@ -51,4 +51,9 @@
      */
     protected String creatorUri;
+    
+    /**
+     * The full name of the creator of this annotation.
+     */
+    protected String creatorName;
     
     /**
@@ -156,4 +161,18 @@
 
     /**
+     * @return the creatorName
+     */
+    public String getCreatorName() {
+        return creatorName;
+    }
+
+    /**
+     * @param creatorName the creatorName to set
+     */
+    public void setCreatorName(String creatorName) {
+        this.creatorName = creatorName;
+    }
+
+    /**
      * @return the created
      */
Index: src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java	(revision 4)
+++ src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java	(revision 5)
@@ -9,4 +9,5 @@
 
 import org.apache.log4j.Logger;
+import org.neo4j.graphdb.Direction;
 import org.neo4j.graphdb.GraphDatabaseService;
 import org.neo4j.graphdb.Node;
@@ -59,7 +60,10 @@
         annot.setBodyText((String) annotNode.getProperty("bodyText", null));
         annot.setBodyUri((String) annotNode.getProperty("bodyUri", null));
-        Iterable<Relationship> targets = annotNode.getRelationships(RelationTypes.ANNOTATES);
-        for (Relationship target : targets) {
+        // get annotation target from relation
+        Iterable<Relationship> targetRels = annotNode.getRelationships(RelationTypes.ANNOTATES);
+        for (Relationship targetRel : targetRels) {
+            Node target = targetRel.getEndNode();
             annot.setTargetBaseUri((String) target.getProperty("uri", null));
+            // just the first one
             break;
         }
@@ -69,7 +73,11 @@
             annot.setFragmentType(FragmentTypes.valueOf(ft));
         }
-        Iterable<Relationship> creators = annotNode.getRelationships(RelationTypes.CREATED);
-        for (Relationship creator : creators) {
+        // get creator form relation
+        Iterable<Relationship> creatorRels = annotNode.getRelationships(RelationTypes.CREATED);
+        for (Relationship creatorRel : creatorRels) {
+            Node creator = creatorRel.getStartNode();
             annot.setCreatorUri((String) creator.getProperty("uri", null));
+            annot.setCreatorName((String) creator.getProperty("name", null));
+            // just the first one
             break;
         }
@@ -86,14 +94,16 @@
      */
     public Annotation storeAnnotation(Annotation annot) {
+        Node annotNode = null;
         Transaction tx = graphDb.beginTx();
-        Node annotNode = null;
-        String id = annot.getUri();
-        if (id == null) {
-            id = createRessourceURI("annot:");
-        }
-        annotNode = createAnnotationNode(id);
-
         try {
-            // Mutating operations go here
+            /*
+             * create or get the annotation
+             */
+            String id = annot.getUri();
+            if (id == null) {
+                id = createRessourceURI("annot:");
+            }
+            annotNode = getOrCreateAnnotationNode(id);
+
             /*
              * the annotation body
@@ -113,6 +123,6 @@
             String targetBaseUri = annot.getTargetBaseUri();
             if (targetBaseUri != null) {
-                Node target = createTargetNode(targetBaseUri);
-                annotNode.createRelationshipTo(target, RelationTypes.ANNOTATES);
+                Node target = getOrCreateTargetNode(targetBaseUri);
+                getOrCreateRelation(annotNode, RelationTypes.ANNOTATES, target);
             }
 
@@ -128,10 +138,15 @@
 
             /*
+             * The name of the creator of this annotation.
+             */
+            String creatorName = annot.getCreatorName();
+
+            /*
              * The URI of the creator of this annotation.
              */
             String creatorUri = annot.getCreatorUri();
             if (creatorUri != null) {
-                Node creator = createPersonNode(creatorUri, null);
-                creator.createRelationshipTo(annotNode, RelationTypes.CREATED);
+                Node creator = getOrCreatePersonNode(creatorUri, creatorName);
+                getOrCreateRelation(creator, RelationTypes.CREATED, annotNode);
             }
 
@@ -181,5 +196,5 @@
             if (target != null) {
                 Iterable<Relationship> relations = target.getRelationships(RelationTypes.ANNOTATES);
-                for (Relationship relation: relations) {
+                for (Relationship relation : relations) {
                     Node ann = relation.getStartNode();
                     if (ann.getProperty("TYPE", "").equals("ANNOTATION")) {
@@ -187,5 +202,5 @@
                         annotations.add(annot);
                     } else {
-                        logger.error("ANNOTATES relation does not start with ANNOTATION: "+ann);
+                        logger.error("ANNOTATES relation does not start with ANNOTATION: " + ann);
                     }
                 }
@@ -198,5 +213,5 @@
             if (person != null) {
                 Iterable<Relationship> relations = person.getRelationships(RelationTypes.CREATED);
-                for (Relationship relation: relations) {
+                for (Relationship relation : relations) {
                     Node ann = relation.getEndNode();
                     if (ann.getProperty("TYPE", "").equals("ANNOTATION")) {
@@ -204,5 +219,5 @@
                         annotations.add(annot);
                     } else {
-                        logger.error("CREATED relation does not end with ANNOTATION: "+ann);
+                        logger.error("CREATED relation does not end with ANNOTATION: " + ann);
                     }
                 }
@@ -212,5 +227,28 @@
     }
 
-    protected Node createAnnotationNode(String id) {
+    protected Relationship getOrCreateRelation(Node start, RelationshipType type, Node end) {
+        if (start.hasRelationship()) {
+            // there are relations
+            Iterable<Relationship> rels = start.getRelationships(type, Direction.OUTGOING);
+            for (Relationship rel : rels) {
+                if (rel.getEndNode().equals(end)) {
+                    // relation exists
+                    return rel;
+                }
+            }
+        }
+        // create new one
+        Relationship rel;
+        Transaction tx = graphDb.beginTx();
+        try {
+            rel = start.createRelationshipTo(end, type);
+            tx.success();
+        } finally {
+            tx.finish();
+        }
+        return rel;
+    }
+
+    protected Node getOrCreateAnnotationNode(String id) {
         Index<Node> idx = graphDb.index().forNodes("annotations");
         IndexHits<Node> annotations = idx.get("id", id);
@@ -232,5 +270,5 @@
     }
 
-    protected Node createTargetNode(String uri) {
+    protected Node getOrCreateTargetNode(String uri) {
         Index<Node> idx = graphDb.index().forNodes("targets");
         IndexHits<Node> targets = idx.get("uri", uri);
@@ -252,5 +290,5 @@
     }
 
-    protected Node createPersonNode(String uri, String name) {
+    protected Node getOrCreatePersonNode(String uri, String name) {
         Index<Node> idx = graphDb.index().forNodes("persons");
         // Person is identified by URI
@@ -291,4 +329,3 @@
     }
 
-
 }
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java	(revision 4)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java	(revision 5)
@@ -9,5 +9,7 @@
 import java.security.InvalidKeyException;
 import java.security.SignatureException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.List;
 import java.util.regex.Matcher;
@@ -178,4 +180,5 @@
      */
     public JSONObject createAnnotatorJson(Annotation annot) {
+        // return user as a JSON object (otherwise just as string)
         boolean makeUserObject = true;
         JSONObject jo = new JSONObject();
@@ -198,6 +201,9 @@
                 userObject.put("id", userId);
                 // get full name
-                RestServer restServer = (RestServer) getApplication();
-                String userName = restServer.getUserNameFromLdap(userId);
+                String userName = annot.getCreatorName();
+                if (userName == null) {
+                    RestServer restServer = (RestServer) getApplication();
+                    userName = restServer.getFullNameFromLdap(userId);
+                }
                 userObject.put("name", userName);
                 // save user object
@@ -241,5 +247,6 @@
         try {
             for (String xpointer : xpointers) {
-                String decoded = URLDecoder.decode(xpointer, "utf-8");
+                //String decoded = URLDecoder.decode(xpointer, "utf-8");
+                String decoded = xpointer;
                 Matcher m = rg.matcher(decoded);
 
@@ -266,9 +273,5 @@
             // TODO Auto-generated catch block
             e.printStackTrace();
-        } catch (UnsupportedEncodingException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-
+        }
         return ja;
     }
@@ -282,5 +285,6 @@
         try {
             for (String xpointer : xpointers) {
-                String decoded = URLDecoder.decode(xpointer, "utf-8");
+                //String decoded = URLDecoder.decode(xpointer, "utf-8");
+                String decoded = xpointer;
                 Matcher m = rg.matcher(decoded);
 
@@ -300,13 +304,9 @@
             // TODO Auto-generated catch block
             e.printStackTrace();
-        } catch (UnsupportedEncodingException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-
+        }
         return ja;
     }
 
-    protected String parseArea(JSONObject area) throws JSONException, UnsupportedEncodingException {
+    protected String parseArea(JSONObject area) throws JSONException {
         String x = area.getString("x");
         String y = area.getString("y");
@@ -317,9 +317,9 @@
             height = area.getString("height");
         }
-        String fragment = URLEncoder.encode(String.format("xywh=fraction:%s,%s,%s,%s", x, y, width, height), "utf-8");
+        String fragment = String.format("xywh=fraction:%s,%s,%s,%s", x, y, width, height);
         return fragment;
     }
 
-    protected String parseRange(JSONObject range) throws JSONException, UnsupportedEncodingException {
+    protected String parseRange(JSONObject range) throws JSONException {
         String start = range.getString("start");
         String end = range.getString("end");
@@ -327,12 +327,12 @@
         String endOffset = range.getString("endOffset");
 
-        String fragment = URLEncoder.encode(String.format(
+        String fragment = String.format(
                 "xpointer(start-point(string-range(\"%s\",%s,1))/range-to(end-point(string-range(\"%s\",%s,1))))", start,
-                startOffset, end, endOffset), "utf-8");
+                startOffset, end, endOffset);
         return fragment;
     }
 
     /**
-     * creates an Annotation object with data from JSON.
+     * Creates an Annotation object with data from JSON.
      * 
      * uses the specification from the annotator project: {@link https
@@ -352,7 +352,23 @@
     }
 
+    /**
+     * Updates an Annotation object with data from JSON.
+     * 
+     * uses the specification from the annotator project: {@link https
+     * ://github.com/okfn/annotator/wiki/Annotation-format}
+     * 
+     * The username will be transformed to an URI if not given already as URI,
+     * if not it will set to the MPIWG namespace defined in
+     * de.mpiwg.itgroup.annotationManager.Constants.NS
+     * 
+     * @param annot
+     * @param jo
+     * @return
+     * @throws JSONException
+     * @throws UnsupportedEncodingException
+     */
     public Annotation updateAnnotation(Annotation annot, JSONObject jo, Representation entity) throws JSONException,
             UnsupportedEncodingException {
-        // annotated uri
+        // target uri
         if (jo.has("uri")) {
             annot.setTargetBaseUri(jo.getString("uri"));
@@ -397,7 +413,11 @@
             username = authUser;
         }
-        // username should be a URI, if not it will set to the MPIWG namespace
-        // defined in
-        // de.mpiwg.itgroup.annotationManager.Constants.NS
+        // try to get full name
+        if (username != null) {
+            RestServer restServer = (RestServer) getApplication();
+            String fullName = restServer.getFullNameFromLdap(username);
+            annot.setCreatorName(fullName);
+        }
+        // userUri should be a URI, if not it will set to the MPIWG namespace
         if (userUri == null) {
             if (username.startsWith("http")) {
@@ -408,4 +428,14 @@
         }
         // TODO: should we overwrite the creator?
+        if (annot.getCreatorUri() == null) {
+            annot.setCreatorUri(userUri);
+        }
+        
+        if (annot.getCreated() == null) {
+            // set creation date
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+            String ct = format.format(Calendar.getInstance().getTime());
+            annot.setCreated(ct);
+        }
 
         // create xpointer from the first range/area
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/RestServer.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/RestServer.java	(revision 4)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/RestServer.java	(revision 5)
@@ -41,7 +41,11 @@
     public String CONSUMER_KEYS_PATH = "WEB-INF/consumerkeys.property";
 
+    private Properties serverConfig;
+    public String CONFIG_PROPS_PATH = "WEB-INF/serverconfig.property";
+
     private GraphDatabaseService graphDb;
     public static final String GRAPHDB_KEY = "annotationmanager.graphdb";
-    public String DB_PATH = "WEB-INF/neo4j-annotation-db";
+    public static final String GRAPHDB_PATH_KEY = "annotationmanager.graphdb.path";
+    public String graphdbPath = "WEB-INF/neo4j-annotation-db";
 
     private WrappingNeoServerBootstrapper srv;
@@ -64,4 +68,24 @@
                 .get("org.restlet.ext.servlet.ServletContext");
         if (sc != null) {
+            /*
+             * read config from webapp
+             */
+            serverConfig = new Properties();
+            InputStream ps1 = getResourceAsStream(sc, CONFIG_PROPS_PATH);
+            if (ps1 != null) {
+                logger.debug("loading config from " + CONFIG_PROPS_PATH);
+                try {
+                    serverConfig.load(ps1);
+                    /*
+                     * read serverconfig options
+                     */
+                    graphdbPath = serverConfig.getProperty(GRAPHDB_PATH_KEY, graphdbPath);
+                } catch (IOException e) {
+                    logger.warn("Error loading server config: ", e);
+                }
+                logger.debug("config: " + serverConfig);
+            } else {
+                logger.error("Unable to get resource " + CONFIG_PROPS_PATH);
+            }
             // look for database service in context
             graphDb = (GraphDatabaseService) sc.getAttribute(GRAPHDB_KEY);
@@ -70,5 +94,5 @@
                  * open database
                  */
-                String dbFn = getResourcePath(sc, DB_PATH);
+                String dbFn = getResourcePath(sc, graphdbPath);
                 if (dbFn != null) {
                     logger.debug("opening DB " + dbFn);
@@ -87,5 +111,5 @@
                     srv.start();
                 } else {
-                    logger.error("Unable to get resource " + DB_PATH);
+                    logger.error("Unable to get resource " + dbFn);
                 }
             }
@@ -94,9 +118,9 @@
              */
             consumerKeys = new Properties();
-            InputStream ps = getResourceAsStream(sc, CONSUMER_KEYS_PATH);
-            if (ps != null) {
+            InputStream ps2 = getResourceAsStream(sc, CONSUMER_KEYS_PATH);
+            if (ps2 != null) {
                 logger.debug("loading consumer keys from " + CONSUMER_KEYS_PATH);
                 try {
-                    consumerKeys.load(ps);
+                    consumerKeys.load(ps2);
                 } catch (IOException e) {
                     // TODO Auto-generated catch block
@@ -155,5 +179,5 @@
      * @return
      */
-    public String getUserNameFromLdap(String creator) {
+    public String getFullNameFromLdap(String creator) {
         String retString = creator; // falls nichts gefunden wird einfach den
                                     // creator zurueckgeben
@@ -163,5 +187,5 @@
 
         // TODO: should go into config file
-        String ldapUrl = "ldap://ldapreplik.mpiwg-berlin.mpg.de/dc=mpiwg-berlin,dc=mpg,dc=de"; 
+        String ldapUrl = "ldap://ldap.mpiwg-berlin.mpg.de/dc=mpiwg-berlin,dc=mpg,dc=de"; 
         env.put(javax.naming.Context.PROVIDER_URL, ldapUrl);
 
@@ -175,5 +199,5 @@
         }
 
-        String base = "ou=People";
+        String base = "ou=people";
 
         SearchControls sc = new SearchControls();
