[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Handle-info] OpenHandle: JSON



Hi:

Just wanted to share a couple demo JSON serializations of a handle record
(<info:hdl/10101/nature>) for comment [1], [2].

The first one [1] is a hand transcription of the RDF/N3 [3] - seems to parse
OK with Rhino. It includes namespacing (rdf, handle) and a notation for
declaring namespaces ("@prefix") which are not supported by JSON.

A second version [2] sans namespaces (and excluding the rdf: properties,
here just rdf:type) leads to a more streamlined look and is copied below.

The examples are based on <info:hdl/10101/nature> and include fictional
reference info for demo purposes.

I guess the real problem with JSON would be "difficult" data types - strings
that would need encoding, although should be reasonably straightforward [4],
[5].

char
    any-Unicode-character-
        except-"-or-\-or-
        control-character
    \"
    \\
    \/
    \b
    \f
    \n
    \r
    \t
    \u four-hex-digits

Cheers,

Tony


[1] http://nurture.nature.com/tony/schemas/10101_nature_new.json
[2] http://nurture.nature.com/tony/schemas/10101_nature_bis.json
[3] http://nurture.nature.com/tony/schemas/10101_nature_new.n3

[4] http://www.json.org/
[5] http://www.ietf.org/rfc/rfc4627.txt


###¢

h = {
        "handleValues" : [
            {
             "data" : {
                 "adminPermission" : {
                     "r:type" : "AdminPermission" ,
                     "addAdmin" : "true" ,
                     "addHandle" : "true" ,
                     "addNA" : "true" ,
                     "addValue" : "true" ,
                     "authorizedRead" : "true" ,
                     "deleteHandle" : "true" ,
                     "deleteNA" : "true" ,
                     "deleteValue" : "true" ,
                     "listHandle" : "true" ,
                     "modifyAdmin" : "true" ,
                     "modifyValue" : "true" ,
                     "removeAdmin" : "true"
                 } ,
                 "adminRef" : "<info:hdl/0.NA/10101#index=200>"
             } ,
             "index" : "100" ,
             "permission" : {
                 "adminRead" : "true" ,
                 "adminWrite" : "true" ,
                 "publicRead" : "true" ,
                 "publicWrite" : "false"
             } ,
             "reference" : {
                 "referenceCount" : "0" ,
                 "referenceList" : []
             } ,
             "timestamp" : "2007-02-28T17:08:15Z" ,
             "ttl" : {
                 "ttlType" : "relative" ,
                 "ttlValue" : "86400"
             } ,
             "type" : "HS_ADMIN"
         } ,
         {
             "data" : "<http://www.nature.com/>" ,
             "index" : "1" ,
             "permission" : {
                 "adminRead" : "true" ,
                 "adminWrite" : "true" ,
                 "publicRead" : "true" ,
                 "publicWrite" : "false"
             } ,
             "reference"  : {
                 "referenceCount" : "2" ,
                 "referenceList" : [
                     "<info:hdl/1234/567#index=4>" ,
                     "<info:hdl/567/1234#index=7>"
                 ]
             } ,
             "timestamp" : "2007-02-28T17:08:15Z" ,
             "ttl" : {
                 "ttlType" : "relative" ,
                 "ttlValue" : "86400"
             } ,
             "type" : "URL"
         }
    ] 
}
 
####


********************************************************************************   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   
********************************************************************************


_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info