fluiddb

how to use fluiddb

Search for: how to use fluiddb

fluiddb sample

Search for: fluiddb sample

what is cql

Search for: what is cql

good introduction in wiki


information retrieval
CQL
couchdb
mongodb
riak
terrastore

tim/rating > 5
sally/opnion matches good
has sally/opinion

tim/seen read closed tim, meg 
mike/opinion update open  
mike/ create closed mike 
meg/rating see open  
meg/rating read closed meg

writable to the public
(similar to wiki)
data model is flexible
attribute value stores
similar to cql queries
supposedly simpler than sql
returns objects
permissions similar to queries

here are client side libraries

fluidinfo sandbox link

Is there an online Fluiddb browser

Search for: Is there an online Fluiddb browser

Neo4J: graph database

Search for: Neo4J: graph database

Cassandra

Search for: Cassandra


Amazon SimpleDB, 
CouchDB, 
Google App Engine, 
and Persevere of NoSQL

This seems like a good enough example

jar file gson download

Search for: jar file gson download

gson download

You will need this because jfluiddb uses json

json java jar file download

Search for: json java jar file download

jfluid db sample


book1
  name
  isbn
  author: satya
  read: sonya

satya
  fname
  lname
  child: kavitha

sonya
  fname
  lname

org.json.*
apache http client
commons lang 2.x

//Use a url to start off
FluidDB fdb = new FluidDB(FluidConnector.SandboxURL);

// Login to FluidDB with your credentials
String username = "test";
String password = "test";
fdb.Login(username, password);

// Get the User object representing me
User u = fdb.getLoggedInUser();

// My root namespace
Namespace root = u.RootNamespace();

// Create a new namespace underneath my root namespace
Namespace books = fdb.getNamespace("com.ai.books");
if (books == null)
{
    books = 
    root.createNamespace("com.ai.books", 
         "For storing tags about books I might be reading.");
}

Tag title = books.createTag("Title", "The title of a book I've read", true);
Tag authors = books.createTag("Authors", "The author list", true);
Tag hasRead = books.createTag("HasRead", "Indicates I've read this book", true);
Tag rating = books.createTag("Rating", "Marks out of ten", true);
Tag comment = books.createTag("Comment", "Some notes and commentary", false);

// Create a new object
Object seven_pillars = fdb.createObject("ISBN:0954641809");
Object book2 = fdb.createObject("ISBN2");

seven_pillars.tag(hasRead);
// We're associating values with the tags
seven_pillars.tag(title, "Seven Pillars of Wisdom");
seven_pillars.tag(authors, new String[]{"T.E.Lawrence"});
seven_pillars.tag(rating, 8);
seven_pillars.tag(comment, "dddddd");

// A search of all objects that I have read 
String[] result = fdb.searchObjects("has "+username+"/com.ai.books/HasRead");

// result will contain only one result... 
// the id for the seven_pillars Object
// Lets instantiate it and get a list of 
// the available tags I have permission to see

Object newObj = fdb.getObject(result[0]);
String[] tagPaths = newObj.getTagPaths();

// tagPaths will include my tags I created above...
// Lets get the first tag and find out what is in it...

Tag newTag = fdb.getTag(tagPaths[0]);
FluidResponse r = newObj.getTagValue(newTag);

// Assuming all is well the result is 
// returned by calling r.getResponseContent();

// This will only give the current user 
// and the fluiddb "superuser" account the ability
// to create namespaces underneath the namespace "book"

Permission p = new Permission(
      Policy.CLOSED, new String[]{"fluidDB", username});
books.setPermission(Namespace.Actions.CREATE, p);

// Lets get the default permission policy 
// for the user for updating the "books/rating" tag
Permission updateTag = rating.getTagPermission(Tag.TagActions.UPDATE);

// Calling GetPolicy() and GetExceptions() 
// on an instance of the Permission class will
// tell you what the permissions 
// are (as described in the FluidDB docs)

newObj.deleteTag(title);
newObj.deleteTag(authors);
newObj.deleteTag(hasRead);
newObj.deleteTag(rating);
newObj.deleteTag(comment);

// Now delete the tags
title.delete();
authors.delete();
hasRead.delete();
rating.delete();
comment.delete();

// and finally the namespace
books.delete();