summaryrefslogtreecommitdiff
path: root/_posts/2012-07-17-client-server-synchronisation.md
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-07-18 13:28:54 +0200
committerChristoph Helma <helma@in-silico.ch>2012-07-18 13:28:54 +0200
commit79cf2404754f2aebb15a55aa755be1b9b1a88350 (patch)
tree5e7c304064cfcb045ad5ccd63f59a2adced55aca /_posts/2012-07-17-client-server-synchronisation.md
parent8627e868809c5c81d3750e4cd705791feb91866a (diff)
client-server-synchronisation and 4store-setup added
Diffstat (limited to '_posts/2012-07-17-client-server-synchronisation.md')
-rw-r--r--_posts/2012-07-17-client-server-synchronisation.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/_posts/2012-07-17-client-server-synchronisation.md b/_posts/2012-07-17-client-server-synchronisation.md
new file mode 100644
index 0000000..bfe2d0c
--- /dev/null
+++ b/_posts/2012-07-17-client-server-synchronisation.md
@@ -0,0 +1,43 @@
+---
+layout: post
+title: "Client - server synchronisation"
+description: ""
+category: opentox-client
+tags: []
+---
+{% include JB/setup %}
+OpenTox objects and their representation at webservices live independent of each other. You can create and manipulate objects at the client side without affecting their representation at the webservice. On the other hand the server side representation might change while you are working locally on an object with the same address.
+
+For synchronisation between client and server representations you can use the standard REST methods `get`, `post` (rarely useful), `put` and `delete`.
+
+Examples:
+---------
+
+`get` To obtain a resource representation from the webservice
+
+ feature = OpenTox::Feature.new my_uri, @@subjectid
+ # feature is more or less empty, apart from some default entries
+ feature.get # download metadata
+ # work with the representation from the webservice
+ puts feature.metadata.inspect
+ ...
+
+`put` Save a local object at the webservice
+
+ feature = OpenTox::Feature.new nil, @@subjectid # create a new feature
+ feature.title = "My test feature" # set the title
+ feature[RDF.type] = RDF::OT.NominalFeature # add a feature type
+ feature.put # save the feature at the webservice
+
+`delete` Delete object at webservice
+
+ feature = OpenTox::Feature.new my_uri, @@subjectid
+ feature.delete
+ feature.get # fails
+
+Special cases:
+--------------
+
+*datasets*: Use `Dataset#get_metadata` to download only metadata. `Dataset#get` will retrieve all data entries.
+
+