View Source

{excerpt}Data model (ontology) for Data Basket{excerpt}
{jira:RS-893}
{toc}

h1. Basket Data Model

h2. Overview

We try to reuse established ontologies as much as possible. We considered using the latest version of [Open Annotation (OA)|Open Annotation (OA)] as a basis, but gave up on this idea.In order to have a simple and coherent model, Data Basket uses the same basis as Data+Image Annotation: [Open Annotation Collaboration (OAC)|Open Annotation Collaboration (OAC)]. Still, we use some approaches from OA, eg ore:Aggregation.

We map entities from the [Data Basket Spec 3.5] to the following:
| *Entity* | *Description* | *Mapped to* |
| Basket {color:#ff00ff}(Jana: why do we need a Basket?){color} | List of Bookmarks, owned by a particular user | ore:Aggregation |
| Bookmark | Pointer to an Item, made by particular user, with optional description | oac:Annotation {color:#ff00ff}Jana: Need to distinguish from other annotations, eg forum posts{color} |
| Target Item | RS URI or web URL or pure text, (in some cases) having Preview, short URL, creator | see [#Item Types] |

h2. Prefixes

We use the following prefixes:
| *Pref* | *URI* | *Get from URL* | *Local file* |
| crm | [http://erlangen-crm.org/current/] | [http://erlangen-crm.org/current/] | ecrm_current.owl |
| dcterms | [http://purl.org/dc/terms/] | no need | |
| foaf | [http://xmlns.com/foaf/0.1/] | | foaf.ttl |
| oac | [http://www.openannotation.org/ns/] | | oac.rdf |
| ore | [http://www.openarchives.org/ore/terms/] | no need | |
| rdf | [http://www.w3.org/1999/02/22-rdf-syntax-ns#] | no need | |
| rso | [http://www.researchspace.org/ontology/] | RS internal | rso.ttl |

h2. Basket

A Basket is a bag of Bookmarks (represented as ore:Aggregation), owned by a particular user. Fields:
| *Field* | *Property* |
| Owner | dcterms:creator |
| Bookmarks | ore:aggregates |

Processing:
- A basket is created when the first bookmark is being added (on demand)
- A basket is never deleted, even on action Clear All

h3. Basket Example
{noformat}
<http://www.researchspace.org/basket/1> a ore:Aggregation;
dcterms:creator <http://www.researchspace.org/user/2>;
ore:aggregates <http://www.researchspace.org/bookmark/3>, <http://www.researchspace.org/bookmark/4>.
{noformat}

TODO Jana:
- can the given URI patterns be implemented?
- how will users be represented, with an URI? {color:#ff00ff}Jana: No, so far we have always used just usernames{color}

h2. Bookmark

Each bookmark resides in a basket and points to a target item (URL). Fields:
| *UI Field* | *Property (path)* | *Applicability and Notes* |
| | rdf:type | oac:Annotation (fixed value). Distinguished from other Annotations by residing in a Basket |
| Type | oac:hasTarget/rdf:type | All except Text Snippet. See [#Item Types] |
| Preview | rso:hasTargetPreview | Image/Image Annotation: RS image URL. Web Link: URL from [Web Preview] service |
| Created by | oac:hasBody/dcterms:creator | |
| Created on | oac:hasBody/dcterms:created | |
| Title | oac:hasBody/rso:P3_has_title | Plain text. Copied from Item and shortened to 30 chars |
| Notes | oac:hasBody/rso:P3_has_description | Rich text. No default value |
| URL (Item) | oac:hasTarget | All except Text Snippet |
| Short URL | rso:hasTargetShortURL | From [URL Shortening] service |
| Item created by | oac:hasTarget/dcterms:creator | Only for Data/Image Annotation |
| Item created on | oac:hasTarget/dcterms:created | Only for Data/Image Annotation |

Notes:
- *Applicability* describes for which item types that field is applicable, and gives extra notes
- The following fields shown on [Data Basket UI design] don't really exist: Sent by, Tags, Last updated

Processing:
- oac:hasBody/dcterms:creator and created are set from the current user and datetime when the bookmark is created.
They are preserved if the bookmark is copied to another basket.
- oac:hasTarget/dcterms:creator and created are present only for 2 item types. They alraedy exist, they are not added when the bookmark is created.

h3. Bookmark Example
{noformat}
<http://www.researchspace.org/bookmark/3> a oac:Annotation;
oac:hasTarget <http://www.wikipedia.org>;
rso:hasTargetShortURL <http://goo.gl/KA4Ll>;
rso:hasTargetPreview <http://api.webthumbnail.org?width=512&height=384&format=png&browser=firefox&url=http://www.wikipedia.org>;
oac:hasBody <http://www.researchspace.org/bookmark/3/body>.

<http://www.wikipedia.org> a foaf:Document. ## Note1

<http://www.researchspace.org/bookmark/3/body> a oac:Body;
dcterms:creator <http://www.researchspace.org/user/2>;
dcterms:created "2012-10-08T12:34:56"^^xsd:dateTime;
rso:P3_has_title "Wikipedia";
rso:P3_has_description "Wikipedia is a world-wide collaboratively-created encyclopedia".
{noformat}

h2. Item Types

Target Items can be of the following types
| *Type Name* | *Type* | *Icon* | *Comments* |
| Data Annotation | rso:DataAnnotation | !data-annotation.png! | see [Annotation with OAC and Reification|Open Annotation Collaboration (OAC)#Annotation with OAC and Reification]\\
New subclass of oac:Annotation that allows the Basket code to recognize more easily the item type. \\ (!) TODO Mitac & Stanislav: Change the Data & Image Annotation backend to use rso:DataAnnotation and rso:ImageAnnotation&nbsp;{color:#ff00ff}Jana: Are we going to recognize type by the class or shall we have explicit property has_type?{color} |
| Forum | | !forum.png! | Not in RS3.5 |
| Image | crm:E38_Image | !img.png! | (?) Dominic: we don't have a display of the image only, so do we need this? Vlado: Yes - we will need this soon \\ (!) TODO Vlado: if we need it, change RKD mapping to make explicit image URL instead of has_image_file and attach E38 (BM mapping does that) |
| Image Annotation | rso:ImageAnnotation | !img-annotation.jpg! | see [Image Annotation Design#Example]. \\
New subclass of oac:Annotation: see comment of Data Annotation |
| Object | rso:FC70_Thing | !data-object.png! | This class is set by a rule in [FR Implementation]\\ |
| Object Field | rdf:Statement | !data-field.png! | see [Annotation with OAC and Reification|Open Annotation Collaboration (OAC)#Annotation with OAC and Reification]. \\
When an AP is added to Basket, this Statement is created, same as making annotation or a link to AP |
| Search | rso:Search | !search.png! | new class. It has one field P3_has_note storing the textual representation of the search \\ (!) TODO Jana: should this node be created when the Search is put in history, or only when it's put in basket?&nbsp;{color:#ff00ff}Jana: History is currently stored in Nuxeo{color} |
| Text Snippet | (none) | !txt.png! | Does not have item URI, therefore no type. Its title and content (rich-text description) are saved in Bookmark's body \\ (!) TODO Svetoslav & Stanislav: assume that no type means Text Snippet |
| Web Link | foaf:Document | !web.png! | New class with no fields. \\ (!) TODO Svetoslav: add statement as per ## Note1 above |

h1. Discussion

Dominic: The specification is written specific according to existing tools. However, the way that the data basket works should be generic for existing and new tools to come. The production version of research space will require an API that means that all tools that adhere to it can be accessed and inetgrated with the databasket tool. This means that there must be a consistent type of URI / URL with tool parameter so that tools can be launched and placed in the appropriate state. These links should be ones that could be used as a normal web link in a browser (RESTful) so that the links could be used outside the databasket using a simple browser address box. To this end the specification should also have a technical specification outlining the way in which the databasket would interact with the ResearchSpace environment

Vlado:
- I agree that bookmarking should be more in the style of using "browser address box". However, our URIs are currently not resolvable, see [RS URLs and URIs].
Adding a new item type ("tool") to the basket is a matter of adding it to the table above, and to frontend handling code (different types have somewhat different handling behavior).
- For full extensibility the Basket should be able to figure out the item's type from the item URI alone. That is the case above, except for Web Link (for which we need to add a type statement upon adding to basket).
-- I've used "a foaf:Document" above (that's the range of foaf:homePage)
-- OA recommends using "a dcmitype:Text; dc:format "text/html" which I don't find very nice (and may change)