View Source

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

{toc}

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 | a ?t {?t=rso:DataAnnotation or ?t=rso:ImageAnnotation}{footnote}Assumes that the Annotation API is enriched to record the domain-specific subtype of oac:Annotation (as in [Data Basket Model#Item Types]){footnote}|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 |
{display-footnotes}
Otherwise we'd need to guess the type by exploring two alternative paths:
- oac:hasTarget/a rdf:Statement or oac:hasTarget/a rso:FC70_Thing -> rso:DataAnnotation
- oac:hasTarget/oac:constrains/a crm:E38_Image -> rso:ImageAnnotation

The needed query assuming parameter $DATE is:
{noformat}
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))
}
{noformat}

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:
{code:sql}
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
{code}

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. All the fields that we need are:
{noformat}
<http://www.researchspace.org/announcement/3> a rso:Announcement;
dcterms:creator "username2";
dcterms:created "2012-10-08T12:34:56"^^xsd:dateTime;
rso:P3_has_title "Important project announcement".
{noformat}

Note: I considered storing them like a Bookmark of type "Text Snippet" (rdfs:Literal) (see [Data Basket Model#Item Types]).

h1. Dashboard API