Re:

> On Nov 16, 2024, at 1:21 PM, Melvin Carvalho <melvincarvalho@gmail.com> wrote:
> 
> 
> 
> st 21. 8. 2024 v 0:41 odesílatel Gregg Kellogg <gregg@greggkellogg.com <mailto:gregg@greggkellogg.com>> napsal:
>> From Section 9.2 on Node Objects [1].
>> 
>>> If the node object <https://www.w3.org/TR/json-ld11/#dfn-node-object> contains the @type key, its value MUST be either an IRI reference <https://tools.ietf.org/html/rfc3987#section-1.3>, a compact IRI <https://www.w3.org/TR/json-ld11/#dfn-compact-iri> (including blank node identifiers <https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node-identifier>), a term <https://www.w3.org/TR/json-ld11/#dfn-term> defined in the active context <https://www.w3.org/TR/json-ld11/#dfn-active-context> expanding into an IRI <https://tools.ietf.org/html/rfc3987#section-2>, or an array <https://infra.spec.whatwg.org/#list> of any of these. See § 3.5 Specifying the Type <https://www.w3.org/TR/json-ld11/#specifying-the-type>for further discussion on @type values.
>> 
>> So, yes, @type can be resolved either to the default vocabulary or the document location. It’s about the only term that has this dual expansion capability.
> 
> Thanks Gregg
> 
> But what if I want "Thing" to be a relative URI, and it's already in the @context? <>
> 
>  <>
> Is there some precedence to it? <>
> 
>  <>
> Or am I out of luck with wanting to use a relative URI when a context contains a term.  If so, might there be an issue of context terms polluting the namespace? <>
The operative language is in step 13.4.4.4 of the Expansion Algorithm (https://www.w3.org/TR/json-ld11-api/#expansion-tsc), where the value of @type is the result of IRI expanding each value with document relative set to true, which also implicitly has vocab set to true.

Presuming that the value doesn’t look like an IRI, there is a process that is followed. If it does look like an IRI (could be a Compact IRI), then step 6 determines the value returned.

Otherwise, in the IRI Expansion algorithm (https://www.w3.org/TR/json-ld11-api/#iri-expansion), step 5 will return the IRI associated with a matching term, if it exists. Otherwise, in step 7, if the context has @vocab, it is prepended. If there is no vocabulary mapping (@vocab), given that document relative is true, the value is resolved against the base IRI.

If there is a vocabulary mapping, it will be used as the basis for expanding the value, otherwise, the document base. If the vocabulary mapping is getting in the way, you might add a context in this object that sets @vocab to null, which would prevent vocabulary expansion.

(Note that the vocabulary mapping, itself, can be document relative).

Gregg

>  
>> 
>>> Gregg Kellogg
>> 
>> [1] https://www.w3.org/TR/json-ld11/#node-objects
>> 
>> Sent from my iPhone
>> 
>>> On Aug 20, 2024, at 2:09 AM, Melvin Carvalho <melvincarvalho@gmail.com <mailto:melvincarvalho@gmail.com>> wrote:
>>> 
>>> 
>>> if I have :
>>> 
>>> "@type": "Thing"
>>> 
>>> will that look for a relative URI in the current document if there is no context?
>>> 
>>> and if there is a context, can I still point to a relative URI?

Received on Saturday, 16 November 2024 22:29:28 UTC