Closed BigBlueHat closed 9 months ago
You should be able to do it in the value object, such as the following:
{
"@context": [
"https://schema.org/"
],
"name": {"@value": {}, "@language": "en-US"}
}
Yeah...I know, but I'm Lazy and only want to do that once. 😄 Guessing this is a feature request then?
The context only has meaning to expand the frame (and re-compact the results). If you defined @language
on a term in the context, it might work, but not at the top-level.
{
"@context": [
"https://schema.org/",
{"name": {"@language": "en-US"}}
],
"name": {}
}
Yeah...I get it. It's the repetition I'm trying to avoid, because developers will just (typically) want a single language for the whole new output document--and not want to repeat that (nor complicate the "query"/selection structure per term).
So...consider this a feature request. 😉
Not sure how that would be accommodated. Framing works on the expanded frame, so any notion of default language is lost.
I'd hoped I could use Framing to take an incoming multilingual JSON-LD document down to a single language without having to set
@language
with every@value
as seen in Example 13.Here's what I tried and was sad didn't work (fwiw):
Full example at https://gist.github.com/BigBlueHat/b111cab41361e149701ff288d9186d4c