Prefixes and the use of ':'

Hello,
I am trying to use JSON-LD for exchanging some content and I need to be
able to express namespaces.
I was looking at example 33 in the spec:
http://json-ld.org/spec/FCGS/json-ld-syntax/20120626/

If I use something like this
{"foaf:age":"33"}

I cannot access the value of that key - for instance in Grails/Groovy or
JavaScript - with something like:
myobject.foaf:age

In Grails/Groovy I have to change it into something like
((JSONObject) myobject).get("foaf:age");

I was therefore wondering if you have any recommendations/preferred
approach for dealing with prefixes.
I thought of just substituting the ':' with the '_' and then map all the
properties singularly in the context but it looks verbose and not elegant.

Thank you,
Paolo

Received on Friday, 21 September 2012 14:13:21 UTC