extract meters from text data
[MojoFacets.git] / README
diff --git a/README b/README
index e43c0d7..60f9b7a 100644 (file)
--- a/README
+++ b/README
@@ -26,3 +26,46 @@ Data replication:
   # slave
   MASTER=http://localhost:4444 ./script/mojo_facets daemon --reload
 
+
+Turning actions into changes:
+
+There are two kinds of audit log in MojoFacets:
+
+1. actions stored in /tmp/actions are clicks on user interface with parameters
+
+2. changes are more structured, including old value and unique values from
+   edit of one value in dataset
+
+If you want to create changes which can be applied again on original dataset or
+any other dataset which has same unique values you can use helper script:
+
+  $ ./script/actions-to-changes /data/mojo_facets/*
+
+
+Modify your data using perl snippets
+
+Experimental REPL console supports perl snippets which get $row hash which is one
+element from your dataset. All values are repetable, so you always have to create
+array of values if you are creating new columns, even for single value.
+
+* generate new columns with number of elements in some other column
+
+  $row->{author_count} = [ $#{ $row->{autor} } + 1 ];
+
+* generate century column from year
+
+  foreach my $year ( @{ $row->{Year} } ) {
+    push @{ $row->{century} }, int($year/100)+1;
+  }
+
+* modify existing column
+
+  foreach ( @{ $rec->{'Cited Author'} } ) {
+    s/^\.+//;
+    $_ = uc $_; # assigment is needed to modify value!
+  }
+
+Code examples are stored in public/code
+
+They use Column name.description.pl notatition so only snippets which have applicable
+column will be shown.