Re: JSON-LD Java Implementation feedback.

Am Samstag, 22. Oktober 2011 schrieb Markus Lanthaler :

> > >> PrefixMapping
> > > "@context": {
> > >     "@prefix" : {    // property namespace prefix mapping
> > >                          "foaf": "http://xmlns.com/foaf/0.1/"
> > >                      }
> > >     "@token" : {    // token is a property uri
> > >                          "name": "http://xmlns.com/foaf/0.1/name",
> > // can
> > > fully specified as iri
> > >                          "age"   : "foaf:age",    // or can leverage
> > prefix
> > > mapping
> > >                          "homepage": "foaf:homepage"
> > >                      }
> > >     "@coerce": {
> > >                          "@iri": "homepage"
> > >                         "age" : "xsd:integer",
> > >                         "birthday" : "xsd:date"
> > >                      }
> > >   }
> > > }
> >
> > I would be +1 for this.
>
>
> I can't see what can be achieved with it that can't be done with the
> current spec!? Is it just about using prefixes in other prefix definitions
> or do I miss something?
>

How is a JSON-LD parser supposed to know whether some String is build using
a prefix notation? Is it just by looking for a ":" in the string an trying
to find a substitution for this? If you make it explicitly in the preamble
what are prefixes and what are shortnames (token) there is one source for
failure eliminated. If you mix @prefixes and @token in @context you don't
know which one is used for prefix substitution and which one is a shortname.
A parser would have to do some try and error and maybe in case of name
clashes you get unwanted results.

That's why I use either prefix notation or shortnames but avoid both in one
serialization. Maybe a clever parser could do everything right but it makes
things more complicated than necessary. And even for a human reader things
become more clearly.

Best,
 - Fabian



-- 
Fabian
http://twitter.com/fctwitt

Received on Sunday, 23 October 2011 10:03:32 UTC