Data model for Pantoto-lite

1 view
Skip to first unread message

Venkatesh Choppella

unread,
Sep 21, 2008, 4:22:02 AM9/21/08
to pantoto-lite, gmar...@gmail.com
A data model for Pantoto-lite
-----------------------------

Based on the discussion on 2008-09-20 at IIITM-K with
Dinesh, Venkatesh, Vincy.

Pantoto Entity types
--------------------

* Categories
* Templates
* Access
* Users
* Groups
* Pagelets


Todo:
-----

* Skins
* Domains




Type:
-----

A value type.

Type = Number + String + Picture + ...

Types follow nominal rather than structural equivalence.

Access
------

Access = I + R + W + RW

I: Invisible, (least permissive)
R: Readable
W: Writable
RW: Readable and Writeble (most restrictive)

The access ordering is defined by the following lattice
structure of access values.

RW
/ \
R W
\ /
I


The least upper bound of two elements x, y is denoted
lub(x,y). Similarly, greatest lower bound glb.

The computation of lubs and glbs is clear from the lattice
diagram.

The lub and glb operators are commutative and associative,
therefore they can be extended to a set of access values.

Template
--------

Template = Label -> Type

A template is a record type (finite function) that maps a
label (field names) to a Type. Template equality is based
on nominal equivalence.

Example:

Template StudentInfo = [name: String, id: Number]

Pagelet
-------

A pagelet a compound data which conforms to (is an instance
of) a template. Each field name maps to a slot (a box whose
values may be read or mutated.)

ajay = (name: box("Ajay"), id: box(24987))

We will usually omit the boxes when printing a pagelet in
text form in this document.

ajay = (name: "Ajay", id: 24987)

ajay : StudentInfo

TemplateView
------------

TemplateView = Label -> Access

templateView : t :: Template -> TemplateView such that
Labels(t) = Labels(templateView(t)).

We say templateView(t) is _a_ view _of_ the template t.

StudentInfoView = [name : R, id: R]

Category:
---------

Category = Label

A category is identified with a label. Categories follow
nominal equivalence.

Categories map templates to their views
---------------------------------------

Each category is a function that maps a Template t to a
TemplateView of t.


Evolution of a pagelet
----------------------

The "state" of the pagelet consists of two parts:

* its template: this can change if slots are added or
removed from the pagelet.

* the set of categories it is tagged with. Category tags
may be added or removed from a pagelet.


PageletView
-----------

PageletView : TemplateView

A pagelet's view is defined by the view of its template.

Thus, a pagelet's view determines the access associated with
the fields of a pagelet.

ajay = (name: "Ajay" (R), id: 24987 (R))

A pagelet's view is determined the templateview computed by
applying a (composite) category to the pagelet's template.

The result of applying the composition of categories c1 and
c2 on a template t's field f is defined as

(c1,c2)(t)(f) = lub{c1(t)(f), c2(t)(f)}

In other words, when two categories c1 and c2 operate on a template
t, they take the field f of t, and assign it an access value
defined by the lub of c1 and c2.

For example, if c1 maps t's field "name" to I, and c2 maps
"name" to R, then the resultant composite category (c1,c2)
maps "name" to R because

lub({I, R}) = R

User:
-----

A user is an entity that creates, views and modifies
pagelets. Each pagelet is tagged with pagelet owner who is
a user.

Each user is tagged with a set of groups.

Group
-----

A group is a set of users. A group is tagged with
one or more category. Computing the categories a user is
tagged with may be done by taking the categories a user is
tagged with and unioning it with all the categories of each
group that the user belongs to.

For example, instead of tagging dinesh with the category
faculty-category, we may define a group called faculty, and
then have a category called faculty-category that tags the
group faculty.

It seems that the notion of group is subsumed by that of a
category. Given a category c, we can compute all the users
who are tagged with c. Thus every category c identifies a
"group", which is the set of users who belong to that
category.

Computing a Pagelet's view
--------------------------

A pagelet's view is determined by the composing the
categories of the pagelet (taking the most restricted view glb),
with the categories of the groups of the user viewing the
pagelet (taking the most permissive view).

Let C_u be the composite of the categories of the user
(and the user's group). Let C_p be the composite of the
categories of the pagelet.

Then the composite category is C_p ; C_u. The access values
determined by category C_u override those determined by C_p.

Example,

1. User Dinesh belongs to group faculty.
2. User Poornima belongs to group office.
3. Faculty is tagged with category FacultyCategory.
4. There is a called webtech-grades.
5. Webtech-grades conforms to template Course-Grade given below.
6. Course-Grade is tagged with category Approved.

Course-Grade =
[course-name: String,
course-id: String,
year: Year,
term: Term
grades: set[(student-id: num, grade: Grade)]]

Approved(Course-Grade)(grades) = R
FacultyCategory(Course-Grade)(grades) = W

The resultant access on grades is W.

Category faculty maps fields grades to be RW. Category
office maps the field "grades" to R. The Approved category
maps the grades field to be R. As a result, when the
webtech-grades is tagged as Approved and viewed by Poornima,
its grades field has access value R, but when viewed by
Dinesh, has access value W.











tb dinesh

unread,
Sep 21, 2008, 10:39:11 PM9/21/08
to Venkatesh Choppella, s uskudarli, Lambert Meertens, pantot...@googlegroups.com
To update all, Venkatesh started writing down the model based on a discussion of how Pantoto works.

Venkatesh thanks. I will try to provide an example that captures various issues now. We
can reflect this into the model after you look at it.

Re: A data model for Pantoto-lite
-----------------------------

Example
--------------

Category c1, c2, c3

c1.name = Student Id
c1.access = { s/group:R, a/group:R,W, pra/user: R,W }
c1.templates = {t1}

c2.name = Student Info
c2.access = { s/group:R,W }
c2.templates = {t1,t2}

c3.name = Student Lock
c3.access = { s/group:R }
c3.templates = {t2}

Template t1, t2, t3

t1 = {id:Number}

t2 = {name:String, address:String}

Users venk, din, vin, pra, sub

Group s, a

a = {din}

s = {vin, sub, pra}

Pagelets p1, p2, p3, p4

p1.categories = c1
p1.data = {id:"subhan"}

p2.categories = c1,c2
p2.data = {id:"subhan",name:"Subhan M", address:"3354 KR Rd, Bangalore"}

p3.categories = c2
p3.data = {id:"subhan",name:"Subhan M", address:"3354 KR Rd, Bangalore"}

p4.categories = c1,c2,c3
p4.data = {id:"subhan",name:"Subhan M", address:"3354 KR Rd, Bangalore"}

(Note that I am not including the Pagelet authorship info here)

Now what is the PageletView of these pagelets for the different users when they signin.

venk

din

vin

pra

sub

(ok, will send "answers" in the next mail later today, while you get a chance to mull)


Data model for Pantoto-lite

Venkatesh Choppella <chopp...@gmail.com>

tb dinesh

unread,
Sep 22, 2008, 2:30:17 PM9/22/08
to Venkatesh Choppella, s uskudarli, Lambert Meertens, pantot...@googlegroups.com
Re: A data model for Pantoto-lite
-----------------------------

Example - continued.
--------------

(Note that I am not including the Pagelet authorship info here). Also note that
p2, p3 and p4 have coincidentally same date. They might have been different.

For a signed in user, what is the "view" of these pagelets?

venk: none (as venk is not named in any of the categories' access)

din: can edit and read t1 portion of p1, p2 and p4. Note: Cannot read t2 info

vin, sub:
   p1 - can read t1 (i.e., the field id),
   p2 - can only read t1, but can edit t2,
   p3 - can read and edit both t1 and t2,
   p4 - can read t1 and t2 but cannot edit t2

pra:
   p1 - can read and edit t1 (i.e., the field id),
   p2 - can read and edit t1 and t2,
   p3 - can read and edit both t1 and t2,
   p4 - can read t1 and t2 but cannot edit t2


Venkatesh called and indicated how venk and choose to annotate the pagelets for his own eyes by adding:

Category c4

c4.name = Venk Annotations
c4.access = {venk/user: R, W}
c4.templates = {tv}

Template tv

tv = {vannote:String}

and then add pagelets to c4 that are to be annotated

p4.categories = c1,c2,c3,c4
p4.data = {id:"subhan",name:"Subhan M", address:"3354 KR Rd, Bangalore",vannote:"wonder why this is locked. need to verify"}

An "author" role can enhance the access control further:
p4.author = t1/group-a, t2/user-sub, tv/user-venk

Also c2.access can be defined as:

c2.name = Student Info
c2.access = { s/group:R,W author}
c2.templates = {t1,t2}

which would mean only the author can edit their fields.

so if p3 is authored by sub, pra or vin cannot edit it.


d

Reply all
Reply to author
Forward
0 new messages