W3C home > Mailing lists > Public > public-linked-json@w3.org > July 2011

Re: Another reason for overriding default keywords

From: Alexandre Passant <alex@seevl.net>
Date: Sun, 31 Jul 2011 15:19:57 +0100
Message-ID: <CALF6uCnzhe5HYO=nphR5-30z14MQeXn3kMagMJR3Gv0_fCwEpg@mail.gmail.com>
To: nathan@webr3.org
Cc: public-linked-json@w3.org
On Sun, Jul 31, 2011 at 3:11 PM, Nathan <nathan@webr3.org> wrote:
> Alexandre Passant wrote:
>>
>> The json_decode method in PHP creates PHP objects, and attributes can
>> be retrieved using $name->attribute.
>> Yet, attribute cannot start with a @
>>
>> So $object->@ won't work, but $object->uri will be OK.
>
> Attribute names can be anything in PHP (even NULL!) you use the
> $object->{'@context'} style to access non standard attribute names, although
> it's not quite as clean as $object->context that's for sure :)

Right, well spotted. But that's not the default approach - and I'd
rather make it as simple as possible.

Best,

Alex.

>
> Best,
>
> Nathan
>



-- 
Dr. Alexandre Passant - @terraces
Founder, CEO - seevl.net - @seevl
Reinventing Music Discovery
Received on Sunday, 31 July 2011 14:20:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:30 UTC