View Source

{excerpt}Produced by analysis of the [Dashboard Spec (RS3.6)]{excerpt}


h1. Dashboard Data Model
There is no single data model, but 3 different models and queries to obtain information for the different sections of the dashboard.

h2. History
This section shows Data Annotations and Image Annotations created in a given recent period of time. The corresponding data models are:
- Data Annotation: [Annotation with OAC and Reification|Open Annotation Collaboration (OAC)#Annotation with OAC and Reification]
- Image Annotation: [Image Annotation Design#Example]

The needed fields are:
| *UI Field* | *Property (path)* | *Notes* |
| Type | (1) a ?t {?t=rso:DataAnnotation or ?t=rso:ImageAnnotation}
(2) oac:hasTarget/a rdf:Statement or oac:hasTarget/a rso:FC70_Thing -> rso:DataAnnotation
oac:hasTarget/oac:constrains/a crm:E38_Image -> rso:ImageAnnotation|There are two variants:
(1) Is better: (!) enrich the Annotation API to record domain-specific subtype of oac:Annotation, same as in [Data Basket Model#Item Types]
(2) Is worse: guess the type by exploring two alternative paths
In either case, the Dashboard API should return one of the 2 domain-specific types.
Maybe it's better to show icon instead of text?|
| -Item- | | -What was annotated-. Typically this is in the Title, so no need to duplicate |
| Title | oac:hasBody/rso:P3_has_title | Annotation title |
| Link | the annotation itself | link to annotation. What exactly do the tools need to start (?) |
| User | oac:hasBody/dc:creator | Who created the annotation |
| Date | oac:hasBody/dc:created | Shown in section's title, used for filtering |

The needed query assuming variant (1) and parameter $DATE is:
select ?ann ?type ?title ?user ?date {
?ann a ?type; oac:hasBody ?body.
?body rso:P3_has_title ?title; dc:creator ?user; dc:created ?date.
filter ((?type=rso:DataAnnotation or ?t=rso:ImageAnnotation)
and (?date > $DATE))

h2. Latest forum posts
This section shows a list of 10 latest jForum posts (latest on top).
The data is obtained with SQL from MySQL. See [Forum Spec (RS3.6)#jForum Data Model] for the jForum tables:
select p.post_time as Date, t.post_subject as Title, t.post_text as Description, f.forum_name as Forum, u.username as User, p.status as Status
from jforum_posts p, jforum_posts_text t, jforum_users u, jforum_forums f
where p.post_id=t.post_id and p.user_id=u.user_id and p.forum_id=f.forum_id
order by Date desc
limit 10

The result fields are as follows. "Type" comes from the Visio data model, not certain it's the same in MySQL
| *Field* | *Type* | *Description* |
| Date | DATETIME | Date and time of the post |
| Title | TEXT(100) | Subject of the post |
| Description | LONGTEXT | Body of the post. Shows first 100 characters, if longer then a link "more" is shown. (?) How to interpret the BB markup that can be here? |
| Forum | TEXT(150) | Name of forum the post was posted in |
| User | TEXT(50) | Author of the post. Unfortunately I can't find a "real name" field |
| Status | SHORT | Post status. (?) Not sure how to interpret this integer, maybe in table jforum_config. Need to see a populated jForum instance |

h2. Project Announcements
These are simple messages in plain text

User: author
Text of announcement

h1. Dashboard API