JSON LD Conformance

14 views
Skip to first unread message

Melvin Carvalho

unread,
Sep 28, 2012, 1:36:01 PM9/28/12
to unhosted
Chatting today with Michiel and Elf we spotted an issue of remote storage data structure wrt JSON LD conformance

Example 51 -- Ability to read multiple Objects

http://json-ld.org/spec/latest/json-ld-syntax/

[
  {
    "@context": ...,
    "@id": "http://manu.sporny.org/i/public",
    "@type": "foaf:Person",
    "name": "Manu Sporny",
    "knows": "http://greggkellogg.net/foaf#me"
  },
  {
    "@context": ...,
    "@id": "http://greggkellogg.net/foaf#me",
    "@type": "foaf:Person",
    "name": "Gregg Kellogg",
    "knows": "http://manu.sporny.org/i/public"
  }
]

This pattern is extensively used in linked data. e.g for calendar events, transactions, etc.

The consequence of non conformance will be that remote storage will NOT be able to read arbitrary JSON LD. And not be able to write JSON LD where there is more than one object. Obviously this could make it difficult for unhosted apps to interact with other web apps such as RWW..

I just wanted to establish whether it's a goal of remote storage to be in conformance with JSON LD on this issue, or whether it's a willful violation of the spec.

Michiel de Jong

unread,
Sep 28, 2012, 2:50:43 PM9/28/12
to unho...@googlegroups.com
On Fri, Sep 28, 2012 at 7:36 PM, Melvin Carvalho
<melvinc...@gmail.com> wrote:
> I just wanted to establish whether it's a goal of remote storage to be in
> conformance with JSON LD on this issue, or whether it's a willful violation
> of the spec.

a willful violation. We already have the directory listings for that.

Melvin Carvalho

unread,
Sep 28, 2012, 3:32:45 PM9/28/12
to unho...@googlegroups.com

Thanks for getting back. 

I understand you're trying out a lot of things at this point and want to have things working.  I do think in the longer term the benefits of this feature of Linked Data will become much more obvious.  It's not an edge case of LD, but very much core.  For example, my opentabs transactions will not be loadable by an unhosted opentabs app. 

I would recommend that you note this deviation of the spec in your documentation, as has implications of other linked data systems (outside of unhosted), and interop, for the time being.
 

--




Michiel de Jong

unread,
Sep 28, 2012, 6:06:55 PM9/28/12
to unho...@googlegroups.com
On Fri, Sep 28, 2012 at 9:32 PM, Melvin Carvalho
<melvinc...@gmail.com> wrote:
> my opentabs transactions will not be loadable by an unhosted opentabs app.

wait, you are not using remotestorage, so then it doesn't affect you.
All you need to do is serve your data with CORS headers, then any
unhosted web app can load your data, regardless of how the
remotestorage module structures its own data, that's independent.

Melvin Carvalho

unread,
Sep 28, 2012, 6:14:29 PM9/28/12
to unho...@googlegroups.com

Im definitely keen to use remotestorage, when it's linked data ready.  Probably makes sense to wait a bit, at this stage.
 

--




☮ elf Pavlik ☮

unread,
Sep 29, 2012, 5:25:25 AM9/29/12
to unhosted
Excerpts from Melvin Carvalho's message of 2012-09-28 22:14:29 +0000:
guys c'mon! let's take it calm and look at Melvin's use case?

i understand that you want to shovel an array of financial transactions into your remotestroage account.

[ {}, {}, {}, ...]

what URI you would like to PUT it to and GET it from?

ex. /transactions/2021/09/29

how do you see it organized within remote storage paths? do you just want to PUT and GET from given path or you expect storage to do something *intelligent* with an array you PUT?


Melvin Carvalho

unread,
Sep 29, 2012, 6:19:04 AM9/29/12
to unho...@googlegroups.com
On 29 September 2012 11:25, ☮ elf Pavlik ☮ <perpetua...@wwelves.org> wrote:
Excerpts from Melvin Carvalho's message of 2012-09-28 22:14:29 +0000:
> On 29 September 2012 00:06, Michiel de Jong <mic...@unhosted.org> wrote:
>
> > On Fri, Sep 28, 2012 at 9:32 PM, Melvin Carvalho
> > <melvinc...@gmail.com> wrote:
> > > my opentabs transactions will not be loadable by an unhosted opentabs
> > app.
> >
> > wait, you are not using remotestorage, so then it doesn't affect you.
> > All you need to do is serve your data with CORS headers, then any
> > unhosted web app can load your data, regardless of how the
> > remotestorage module structures its own data, that's independent.
> >
>
> Im definitely keen to use remotestorage, when it's linked data ready.
> Probably makes sense to wait a bit, at this stage.

guys c'mon! let's take it calm and look at Melvin's use case?

i understand that you want to shovel an array of financial transactions into your remotestroage account.

[ {}, {}, {}, ...]

Yes
 

what URI you would like to PUT it to and GET it from?

ex. /transactions/2021/09/29

how do you see it organized within remote storage paths? do you just want to PUT and GET from given path or you expect storage to do something *intelligent* with an array you PUT?

Yes, just PUT and GET JSON from a given path
 



--




☮ elf Pavlik ☮

unread,
Sep 29, 2012, 8:56:18 AM9/29/12
to Melvin Carvalho, unhosted
Excerpts from Melvin Carvalho's message of 2012-09-29 10:19:04 +0000:
➜ curl -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -X PUT -d '[{"foo": "123"}, {"bar": "456"}]' https://5apps.com/storage/elf-pavlik/public/test123

➜ curl https://5apps.com/storage/elf-pavlik/public/test123
[{"foo": "123"}, {"bar": "456"}]%

looks like working fine?

☮ elf Pavlik ☮

unread,
Sep 29, 2012, 9:02:17 AM9/29/12
to Melvin Carvalho, unhosted
Excerpts from ☮ elf Pavlik ☮'s message of 2012-09-29 12:56:18 +0000:
playing further it looks like i can shovel in there any string i want not only valid JSON, which makes sense for storing images and other binary data...

Melvin Carvalho

unread,
Sep 29, 2012, 9:02:34 AM9/29/12
to ☮ elf Pavlik ☮, unhosted

Looks great, thanks.

Will I be able to use remotestorage to do this, or must I use something like curl?

☮ elf Pavlik ☮

unread,
Sep 29, 2012, 9:14:32 AM9/29/12
to Melvin Carvalho, unhosted
Excerpts from Melvin Carvalho's message of 2012-09-29 13:02:34 +0000:
do you mean remoteStorage.js lib?

you better check with niklas about it, i remember mentions of exposing 'wireclient' or sth. which offers bit more raw alternative than modules...

Melvin Carvalho

unread,
Sep 29, 2012, 9:36:31 AM9/29/12
to ☮ elf Pavlik ☮, unhosted

Great, thanks.  I'll do that.
 

☮ elf Pavlik ☮

unread,
Oct 4, 2012, 4:25:53 PM10/4/12
to Melvin Carvalho, unhosted
Excerpts from Melvin Carvalho's message of 2012-09-29 13:02:34 +0000:
looking and remotestorage.js docs before this weekend hackathon i noticed what you might look for:
http://remotestoragejs.com/doc/code/files/lib/wireClient-js.html

Melvin Carvalho

unread,
Oct 4, 2012, 4:34:41 PM10/4/12
to ☮ elf Pavlik ☮, unhosted

Nice, thanks!  That's a great feature to use in an 'emergency' :)

Reply all
Reply to author
Forward
0 new messages