Re: Any way to specify the default URI for the @id of a @type or the values of a property.

Hi Simon,

thank you for your reply.

The cases you mention are close to the one I've in mind, but not so 
much. I don't want to have to use prefixes (although it might be a 
compromise) and I'm interested in expanding a value using a prefix that 
depends on, let's put it this way, variable contextual information, e.g.,

[
   "@type": "ex:Person";
   "@id": "123"
]

@id becomes http:/www.example.com/Person/123, because 
http:/www.example.com/Person/ is associated to @type = 'ex:Person' (somehow)

Similarly:

[
   "@type": "ex:Address";
   "@id": "456"
]

becomes @id = http:/www.example.com/Address/456

Also I would like to declare that values like  "hasAddress":  "789" 
becomes "hasAddress": "http://www.example.com/Address/789", with the 
prefix associated to the property.

My understanding is it's not an available feature, I think I can living 
with @id with full URI and some other field with identifier-only, I'd 
just like to check I'm not missing something from the specifications.

Best,
M

On 21/11/2017 06:52, Simon Steyskal wrote:
> Hi!
>
> > What I would like to do is to specify those prefixes and keep data 
> telling @id = '123', with the value joins happening at RDF 
> serialisation stage (the same specification would make it possible to 
> do the opposite conversion too). Clearly, in such a use case, the 
> prefixes depend on the @type of objects, and the @base mechanism is 
> not enough. Moreover, it would be useful to have this mechanism 
> available for properties too, e.g., to associate the address URI 
> prefix to the values of the "address" JSON property.
>
> and using namespaces (cf. example 40 in [4.11 IRI Expansion within a 
> Context] or [4.14 Scoped Contexts]) isn't an option for you?
>
> br, simon
>
> [4.11 IRI Expansion within a Context] 
> https://json-ld.org/spec/latest/json-ld/#iri-expansion-within-a-context
> [4.14 Scoped Contexts] 
> https://json-ld.org/spec/latest/json-ld/#scoped-contexts
>
>
>
>

=========================================================================
Marco Brandizi <marco.brandizi@gmail.com>
http://www.marcobrandizi.info

Received on Tuesday, 21 November 2017 22:53:10 UTC