Muruca developement work plan: Talia + SWiCKyNotes

Data model examples

Note: isRelatdTo = referTo (sorry -))

  1. Notes attached to non-THCContent data

Note1 is attached to the entire web page (independently of its content) and is not associated to a Fragment. Note2 is attached to Fragment1 that is not part of a THCContent, but of the page itself.

Click to see larger image

  1. Notes attached to THCContents

This is an example of how information can be encoded in RDF and in JSON as well. Note1 connects two fragments (Fragment1 and Fragment2) that are part of different THCContents (THCContent2 ad THCContent5). THCContent2 is included in both page 1 and 2, while THCContent5 is included in page 2 only. Note: the apperasIn relation has been added to the model because it is handy in SwickyNotes?. However it is not always present: it links a fragment to a page only as a consequence of the user having annotated that page.

Click to see larger image

Annotations visualization/browsing

A note should look like this:

------------------------------
Posted by: author on date
------------------------------
Comment:
TEXTAREA
------------------------------
Structured data:
subj_1 pred_1 obj_1
subj_2 pred_2 obj_2
etc…
------------------------------
<a href="showByXPointer(note.refersTo.hasCoordinates)">Go to content</a> //This highlights the correct fragment in the correct page!
------------------------------
OnMouseover on each sbj, obj, or pred a baloon is shown. 
Given the focused subj/obj/pred is X. The baloon is soemthing like this:
------------
X.label is a X.type[0], X.type[0], etc...
X.comment
<a href="LINK" target="_blank">go to X.label</a>
----------------------

The LINK is:

IF X.type==SourceFragment {

    if X belongsto the current page {
        LINK=this.showByXPointer(X.hasCoordinates)

    } else {
        //open correct page and select correct fragments! an xpointer is like http://domain.org/contentId#xpointer[...].
        Load http://domain.org/contentId and call showByXPointer(xpointer)
        
        //Question: are all the contentIds (uris in THCContent divs) addressable in Talia?
    }

} else if X.type==Source {
        LINK=X.uri
        // We put a link because we are reasonably sure a Source is resolvable
    
} else {
        LINK=null
    } 

}

Users/Notebooks management

Task 1

Talia to implement a RESTful API for storing notebooks. Each user has a folder where he/she can upload (.rdf) files. Users can upload, delete and overwrite files. In addition to what said in the google wave: user should be able to decide if a file is public or if it requires a password.

API sketch:

  • Users notebooks management API
    writeNotebook(RDF/XML, notebook URL, user, pwd, (boolean)public/private)
    throws invalidUserPwd, notebookNotFound
    Method PUT , URI http://DOMAIN_NAME/users/USERNAME/swicky_notebooks/NOTEBOOK_NAME
    Payload: <RDF>…</RDF>
    
    getNotebook(URL, user, pwd)
    returns RDF/XML
    throws invalidUserPwd, FileNotFound
    Method GET, URI http://DOMAIN_NAME/users/USERNAME/swicky_notebooks/NOTEBOOK_NAME
    
    notebookExists(URL, user, pwd)
    Method HEAD, URI http://DOMAIN_NAME/users/USERNAME/swicky_notebooks/NOTEBOOK_NAME
    
    deleteNotebook(URL, user, pwd)
    Method DEL, URI http://DOMAIN_NAME/users/USERNAME/swicky_notebooks/NOTEBOOK_NAME
    
    listNotebooks(user,pwd)
    returns a list of URLs
    Method GET, URI http://DOMAIN_NAME/users/USERNAME/swicky_notebooks/
    
  • Contextual notes and metadata management API
    getAnnotatedFragments(URL)
    returns XPointer list
    Method GET, URI http://DOMAIN_NAME/swicky_notebooks/context/annotated_fragments?uri=URL
    Server side query: SELECT ?coordinates WHERE ?fragment scho:isPartOf URL . ?fragment ph:hasCoordinates ?coordinates. ?note ph:refersTo ?fragment
            
    getAnnotations(URL/XPOINTER)
    returns JSON representation of the note
    Method GET, URI http://DOMAIN_NAME/swicky_notebooks/context/annotations?uri=URI
    Method GET, URI http://DOMAIN_NAME/swicky_notebooks/context/annotations?xpointer=XPOINTER
    Server side: HeaH
    
    Get all the available notes:
        SELECT ?n WHERE ?n ph:refersTo ?f . ?f ph:hasCoordinates XPOINTER
        PLUS
        SELECT ?n WHERE ?n ph:refersTo URI
    Create a JSON representation of the Note...
         Get basic note's info:
             SELECT ?a, ?l, ?d WHERE NOTE_URI rdf:type ph:Note; ph:hasNoteAuthor ?a; rdfs:label ?l; ph:hasCreationDate ?d .
         Get note's statements:
             SELECT ?s ?p ?o WHERE NOTE_URI ph:hasStatement ?s . ?s ?p ?o
    

Task 2

SwickyNotes? to support the new API [DONE]

  • Support for multiple publishing accounts
  • At startup users insert user, pwd and server. A default server should be available (the public one?) [DONE]
  • At every time users can switch to an other account (user,pwd,server). All the accounts should be persisted (keychain) to be used later without reinserting all the data. [DONE]
  • Issue: if the user is using a writing on a remote notebook and changes server the system should notify and ask the user to switch notebook. [DONE]
  • BUG to be fixed: a shared notebook is valid even if the publishing account has changed.
  • Partial solution: SwickyNotes? prevent users from writing into other's notebooks.[DONE] But public.dbin.org allows it, we have to build a new publishing service.
  • Update public.dbin.org.
  • We should support the new Rest API
  • We should restyle the pages (Philospace -> SWickyNotes)
  • Precooked Queries: show all fragments that have a specific subject, from an author, all the fragments that are related to a subejct and the relations...

Annotations editing/visualization/browsing

Task 1

Refactoring and extending the THCTag js library.

  • Sub task 1: support for in-browser visualization of metadata. The idea is to make a library that can be included in Talia or used client side by SwickyNotes?. Given a RDF store (remote or local), the RDF contained in annotations is visualized in the web pages in the form of triples and can be used for navigation.
  • Sub task 2: compatibility with Talia. We experienced problems with the use of JQuery and other js libraries...
  • Sub task 3: support for in-browser annotation editing. TO BE CONTINUED...

RDF NOTE EXAMPLE

<rdf:Description rdf:about="http://discovery-project.eu/ontologies/philoSpace/Note#1fe8d5dbecb733b04969f5b2a61b6026">
    <rdf:type rdf:resource="http://discovery-project.eu/ontologies/philoSpace/Note"/>
    <ns1:hasCreationDate>01-02-2010 16:17:45</ns1:hasCreationDate>
    <ns1:hasNoteAuthor rdf:resource="http://public.dbin.org/thristo"/>
    <rdfs:label>Note by: thristo (01-02-2010 16:17:45)</rdfs:label>
    <rdfs:comment>Comment bla bla</rdfs:comment>

    <ns1:hasLiteralStatement rdf:resource="http://discovery-project.eu/ontologies/philoSpace/Note#7176dbd3b29afb603d0164e5fa642ebd"/>
    <ns1:hasStatement rdf:resource="http://discovery-project.eu/ontologies/philoSpace/Note#85a214c1ed7461aa797523eda42908bf"/>

</rdf:Description>

<rdf:Description rdf:about="http://discovery-project.eu/ontologies/philoSpace>
</rdf:Description>

<rdf:Description rdf:about="http://discovery-project.eu/ontologies/philoSpace/Note#1fe8d5dbecb733b04969f5b2a61b6026">
    <ns1:refersTo>http://discovery-project.eu/ontologies/philoSpace/SourceFragment#f664177a6b6078ee8e0fbf3e1cbbfc65</ns1:refersTo>
</rdf:Description>

<rdf:Description rdf:about="http://discovery-project.eu/ontologies/philoSpace/SourceFragment#f664177a6b6078ee8e0fbf3e1cbbfc65">
    <rdf:type rdf:resource="http://discovery-project.eu/ontologies/philoSpace/SourceFragment"/>
    <ns5:isPartOf rdf:resource="http://dbin.org/swickynotes/demo/HanselAndGretel.htm"/>
    <ns1:hasCoordinates rdf:resource="http://dbin.org/swickynotes/demo/HanselAndGretel.htm#xpointer(start-point(string-range(//DIV[@id = 'http://dbin.org/swickynotes/demo/HG_1']/P[1]/SPAN[1]/text()[1],'',0))/range-to(string-range(//DIV[@id = 'http://dbin.org/swickynotes/demo/HG_1']/P[1]/SPAN[1]/text()[1],'',266)))"/>
</rdf:Description>


</rdf:RDF>

Api description

Swicky Notebooks API

Get the list of notebooks for a user
URI: http://host/<user_name>/swicky_notebooks/
HTTP: GET
ACTION: index
Formats: XML (<notebooks><notebook></notebook>...</notebooks>) and HTML

Show a notebook
URI: http://host/<user_name>/swicky_notebooks/<notebook_name>
HTTP: GET
ACTION: show
Formats: XML, RDF(/XML) and HTML

Upload a notebook
URI: http://host/<user_name>/swicky_notebooks/<notebook_name>
HTTP: POST
ACTION: create
Params: contentfile (file upload), containing the RDF/XML of the notebook

Update a notebook
URI: http://host/<user_name>/swicky_notebooks/<notebook_name>
HTTP: PUT
ACTION: update
Params: contentfile (file upload), containing the RDF/XML of the notebook

Delete a notebook
URI: http://host/<user_name>/swicky_notebooks/<notebook_name>
HTTP: DELETE
ACTION: destroy

Annotations for URI
URI: http://host/swicky_notebooks/context/annotated_fragments/<encoded_uri>
HTTP: GET
ACTION: annotated_fragments
Formats: Json
Returns: List of XPath elements that refer to annotations on the given URL

Get annotation triples
URI: http://host/swicky_notebooks/context/annotations/
HTTP: GET
ACTION: create
Formats: Json, HTML, XML/XML-RDF
Params: "uri" or "xpointer", depending on the element for which to get the annotations
Returns: A Json/XML/Description of all triples that have to do with the note which refers to the given parameter

Authentication

In general, all non-"GET" calls require HTTP BASIC authentication with the user's email address and password

Attachments