Enumeration value in JSON-LD without @context #3355
Replies: 5 comments 1 reply
-
The schema validator seems to extract "CompletedActionStatus" to http://schema.org/CompletedActionStatus
|
Beta Was this translation helpful? Give feedback.
-
JSON-LD does not perform any vocabulary processing, so the fact that the range of This does not mean that other tools can't use the stated range to infer something different, but the Linter, for one, will not. Generally, schema.org has a high tolerance for accepting strings where an IRI (or object) might be expected to the point where properties are often defined to have a textual range, so the schema.org context is not overly aggressive in using |
Beta Was this translation helpful? Give feedback.
-
This look relevant... (Edited: for explaining enumerations in RDF) |
Beta Was this translation helpful? Give feedback.
-
For the record, the schema.org validator is essentially doing the non-standardised third option which is part of a "coercion" layer (read "Anything non-standard that is common on the web") We have a copy of the schema definition from schema.org and we normalize "" -> "https://schema.org/" if it's a valid enum value for any enumeration in the range. |
Beta Was this translation helpful? Give feedback.
-
Let’s call it normalization or canonicalization, to avoid
misunderstandings. I prefer the former as the same data might be normalized
differently for different consuming environments. In practice all schema.org
consumers need to do quite a lot of this…
…On Mon, 27 Nov 2023 at 15:22, Ryan Levering ***@***.***> wrote:
For the record, the schema.org validator is essentially doing 3) which is
part of a "coercion" layer (read "Anything non-standard that is common on
the web") We have a copy of the schema definition from schema.org and we
normalize "" -> "https://schema.org/" if it's a valid enum value for any
enumeration in the range.
—
Reply to this email directly, view it on GitHub
<#3355 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJSGNG4ILKIUSQ4FMEJIDYGSV4NAVCNFSM6AAAAAA27O7OVSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMOBSGI4TI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
What's the right way to represent a schema.org enumeration value in JSON-LD without using
@context
? Does it follow from some specification?@id
:Analysis
The https://schema.org/actionStatus property (JSON-LD) has a range that includes https://schema.org/ActionStatusType (JSON-LD), which is a subclass of https://schema.org/StatusEnumeration (JSON-LD) and thus also https://schema.org/Enumeration (JSON-LD).
The https://schema.org/CompletedActionStatus enumeration value (JSON-LD) is an instance of https://schema.org/ActionStatusType and has "CompletedActionStatus" as its label.
If I understand correctly, the https://schema.org/CompletedActionStatus node would be a suitable value for the https://schema.org/actionStatus property. The string "CompletedActionStatus" would not be suitable as is, and would have to be coerced. However, it is not clear to me whether this coercion would be done as part of converting from JSON-LD to tuples, or in a subsequent processing step. It is also not clear whether the coercion would be based on the http://www.w3.org/2000/01/rdf-schema#label property of the enumeration members, on the path components of the URLs, or on hardcoded knowledge about the https://schema.org/actionStatus property and the https://schema.org/ActionStatusType enumeration type.
If
"@context": "https://schema.org/"
were usedThe JSON-LD context at https://schema.org/docs/jsonldcontext.jsonld declares "actionStatus" as meaning http://schema.org/actionStatus, but does not specify a
@type
for coercing the property value:schemaorg/data/releases/22.0/schemaorgcontext.jsonld
Line 24 in 12e9bbb
schemaorg/data/releases/22.0/schemaorgcontext.jsonld
Line 1433 in 12e9bbb
The context also declares "CompletedActionStatus" as meaning http://schema.org/CompletedActionStatus:
schemaorg/data/releases/22.0/schemaorgcontext.jsonld
Line 250 in 12e9bbb
If the context specified
"@type": "@vocab"
for the http://schema.org/actionStatus property, then that would cause the JSON-LD consumer to treat the property value "CompletedActionStatus" as a term and expand it to http://schema.org/CompletedActionStatus. The context doesn't currently do so, though. And of course this cannot help when the JSON-LD document does not use@context
.Beta Was this translation helpful? Give feedback.
All reactions