Skip to main content
Jump to: navigation, search

Difference between revisions of "View-builder vocabulary"

(Example)
Line 9: Line 9:
 
==UML Overview ==
 
==UML Overview ==
  
[[Image:View-builder 2.0.105b.png|center]]
+
[[Image:View-builder 2.0.0106.png|center]]
  
 
==Classes==
 
==Classes==
Line 23: Line 23:
 
* subClassOf: ViewNode
 
* subClassOf: ViewNode
 
* 1..1 attribute
 
* 1..1 attribute
 +
* 0..N role
  
 
===ViewNode===
 
===ViewNode===
Line 51: Line 52:
 
* domain: ViewNode
 
* domain: ViewNode
 
* value: URI
 
* value: URI
 +
 +
===role===
 +
Optional, potentially multi-valued attribute. Used in conjunction with ''attribute''. For example if the Slot wishes to display a person's home zipcode, they would build a Slot with :attribute=fp:postalCode and :role=p:Home.
 +
* domain: ViewNode
 +
* value: p:Role
 +
  
 
== Displaying Groups ==
 
== Displaying Groups ==

Revision as of 18:57, 12 October 2011

{{#eclipseproject:technology.higgins|eclipse_custom_style.css}}
Higgins logo 76Wx100H.jpg

Vocabulary to describe a view of a context. A view is a tree structure of groups of attributes to be displayed/edited. Part of the Persona Data Model 2.0.

Files

UML Overview

View-builder 2.0.0106.png

Classes

Group

A logical group of Slots and/or sub-Groups

  • subClassOf: ViewNode
  • 0..N field
  • 0..N subgroup

Slot

Metadata about how an attribute from the Persona vocabulary (or one of its imports) or from the Flat Persona vocabulary or from the rdf (e.g. rdf:class) should be presented

  • subClassOf: ViewNode
  • 1..1 attribute
  • 0..N role

ViewNode

Metadata about how an attribute from the Persona vocabulary (or one of its imports) or from the Flat Persona vocabulary or from the rdf (e.g. rdf:class) should be presented

  • 1..1 displayOrder
  • 1..1 skos:prefLabel
  • 0..1 layout

Attributes

attribute

The attribute of the current p:Person that should be displayed in this Slot.

  • domain: Slot
  • value: rdf:Property

child

A frame child of a Group

  • domain: Group
  • value: ViewNode

displayOrder

A number that indicates the relative position with respect to the displayOrder of sibling objects with this same attribute. Lower numbers indicate precedence. The displayOrder values of all child nodes of a given node in the tree should be considered together irrespective of the class of the child (i.e. Slot, Group or Frame).

  • domain: Slot or Group
  • value: xsd:Integer

layout

An optional URL of an html/javascript template sub-page of a web app

  • domain: ViewNode
  • value: URI

role

Optional, potentially multi-valued attribute. Used in conjunction with attribute. For example if the Slot wishes to display a person's home zipcode, they would build a Slot with :attribute=fp:postalCode and :role=p:Home.

  • domain: ViewNode
  • value: p:Role


Displaying Groups

Each Group MUST have a skos:prefLabel that describes the internationalized string label for the group.

Displaying Attributes

Each Slot holds an attribute called attribute whose value, A, is an rdf:Property.

  • A may be defined in the template context of the current context. In this case its domain is :Person (i.e. the Person class in the template's default namespace).
    • If no mapping rule is found for A (i.e. no rule can be found in the :Person class such that the value of its map:predicate is A) then
      • The value of A is simply the value of the attribute A of the current p:Person instance in the current context being displayed using this view-builder metadata.
      • Metadata about A (label, tooltip text, example value, etc.) are defined in Higgins Data Model 2.0#Attribute_Definitions
    • If a mapping rule is found for A then follow the Mapping Procedure below.
  • A may be defined in the Flat Persona vocabulary. If so then follow the Mapping Procedure below.
  • A may be proxy:userid or proxy:password.
    • The value of A is the value of attribute A of the current Proxy object (see Proxy vocabulary)
    • Metadata attributes about A (e.g. a skos:prefLabel annotation) in general are found in the Proxy vocabulary. However metadata attributes (especially skos:prefLabal) MAY be found in the template context of the current context and if present their value overrides the value of the corresponding attribute (if any) in the Proxy vocabulary.

Mapping Procedure

  • If the mapping rule is roleSameAs(B) then
    • The value of A is the value of attribute B of the current p:Person instance in the current context
    • Metadata about A is the metadata about B as described in the vocabulary that defines B
  • If the mapping rule is roleDiscreteRange*() then the equivalent attribute in the persona data model, B and the range of values is R:
    • The value of A is the value of attribute B of the current p:Person instance in the current context such that the value is a member of R
    • Metadata about A is the metadata about B as described in the vocabulary that defines B

NOTE: the skos:prefLabel is not used for Slots. It should be "moved" to Group.

Example

Here is an example of a view-builder:

:AgeRange
     rdf:type view:Slot ;
     view:attribute fp:ageRange ;
     view:displayOrder 1 ;
     skos:prefLabel "Age range"^^xsd:string .

:DemographicsGroup
     rdf:type view:Group ;
     view:child :PostalCode , :AgeRange , :Gender ;
     view:displayOrder 1 ;
     skos:prefLabel "Demographics"^^xsd:string .

:Gender
     rdf:type view:Slot ;
     view:attribute fp:gender ;
     view:displayOrder 2 ;
     skos:prefLabel "Gender"^^xsd:string .

:Interest
     rdf:type view:Slot ;
     view:attribute p:like ;
     view:displayOrder 1 ;
     skos:prefLabel "Interest"^^xsd:string .

:InterestsGroup
     rdf:type view:Group ;
     view:child :Interest ;
     view:displayOrder 2 ;
     skos:prefLabel "Interests"^^xsd:string .

:PostalCode
     rdf:type view:Slot ;
     view:attribute fp:postalCode ;
     view:displayOrder 10 ;
     skos:prefLabel "Zip code"^^xsd:string .

:ViewRoot
     rdf:type view:Group ;
     view:child :InterestsGroup , :DemographicsGroup ;
     view:displayOrder 1 ;
     skos:prefLabel "Advertising Profile"^^xsd:string .


Here is a visual representation:

View-builder-example.png

The demographics group shown above has slots whose attributes, fp:gender, fp:ageRange, fp:postalCode, are all from the Flat Persona vocabulary.

The interests group shown above has a slot whose attribute is the complex valued attribute, online-behavior:interest. In this rather special case the presentation logic should render the name of the class of the instance (e.g. "Humor > Satire" or "World Destinations > Africa > East Africa > Nigeria") as opposed to rendering the value of an attribute of the instance as is done in the usual case.

A few additional notes on the above example

The FlatPersona namespace is only useful when either (a) there are not multiple entity values of the same attribute being requested, or, (b) there are just a few alternative entities and the "right" one can be figured out by matching using the role tags (e.g. "home" vCard entity vs. "work" vCard entity). Flattening, a simplification. It is an attempt to hide some complexity. But there are times when we can't hide the complexity. Multiple non-role-tagged entity values of an attribute is one of those times.

Displaying the "interests" of a user is a case where the flat persona approach won't work because a single p:Person node has a multi-valued (multi-entity-valued) "p:like" attribute. You'll notice in the view hierarchy under the interests Group there is a Slot whose view:attribute attribute whose value is p:like--a value that is from the persona vocabulary and NOT from the flat persona vocabulary. We have to get all of the values of this attribute. These values are (multiple) int:InterestTopic-class entities. The specific class of this InterestTopic might be "Satire", but of course we probably want to display something like "Humor > Satire" --in other words rendering not just the "leaf" class name but where it sits in relation to the (up to 6 levels) of super-classes ("Humor" being the super-class of "Satire" in this case).

Copyright © Eclipse Foundation, Inc. All Rights Reserved.