Data model for personal collections - ENGAGE-162

Svetoslav Nedkov snedkov at asteasolutions.com
Tue Nov 24 13:44:59 UTC 2009


Hello Colin and Justin,

I'm taking a step further in developing My Collections view by isolating 
the information about user collections in a new database on my machine. 
My idea is that the user information needs to be centralized in some 
way, but as we spoke Justin there might be a better solution.

Here is an example of the simple "schema" I've come with so far:

{
   "type": "User Collection",
   "collection": {
       "artefacts": [
           {
               "museum": "mmi",
               "_id": "04878166b320666ecd5186a6492fcadd"
           },
           {
               "museum": "mmi",
               "_id": "0664dd085f0f72d4f71bde8594ac2aa5"
           },
           {
               "museum": "mccord",
               "_id": "4a318108713f7918c5cc45f9a1ba4d61"
           },
           {
               "museum": "mmi",
               "_id": "07a23f144336549c3278d8c8bf4b9c81"
           },
           {
               "museum": "mccord",
               "_id": "7287e417c2521ae758e2779b25393ee8"
           },
           {
               "museum": "mccord",
               "_id": "725c85cb7297abbc4955148d15c908ef"
           }
       ]
   },
   "userid": 0
}

{
   "type": "User Collection",
   "userid": 1,
   "collection": {
       "artefacts": [
           {
               "museum": "mccord",
               "_id": "7b465156683c369d32bc1f270654f0f6"
           },
           {
               "museum": "mmi",
               "_id": "0435739b589f35f07f2fa28a304f826e"
           },
           {
               "museum": "mccord",
               "_id": "34a4a33a08136f6a5b9c2f30a9c6b414"
           },
           {
               "museum": "mccord",
               "_id": "a6bc1bc2aee6cc620b3ab09756033762"
           },
           {
               "museum": "mmi",
               "_id": "04878166b320666ecd5186a6492fcadd"
           }
       ]
   }
}



What I plan to do with this data is query it with something like - 
http://localhost:5984/users/_fti/lucene/by_user_collection?include_docs=true&q=type:"User 
Collection" userid:0.
Then the resulting rows need to be grouped by database they refer to and 
another query should be issued to obtain the artifact data. Last the 
artifact data needs to be merged and returned. Some limit as to how many 
artifacts are returned by the first query can be imposed too.

Those are my thoughts so far. Please tell me what you think. Any 
suggestions are welcome.


Regards,

Svetoslav



More information about the fluid-work mailing list