Skip to content

Issue 596: Language Resolution#851

Open
bergos wants to merge 1 commit intogh-pagesfrom
ui/lang-resolution
Open

Issue 596: Language Resolution#851
bergos wants to merge 1 commit intogh-pagesfrom
ui/lang-resolution

Conversation

@bergos
Copy link
Copy Markdown
Contributor

@bergos bergos commented Apr 6, 2026

Adds the language resolution logic to the UI specification.

Closes #596

@robert-david robert-david self-requested a review April 7, 2026 08:55
The values of <code>sh:languageIn</code>, when present in the applicable <a>shapes graph</a> context. This
specification extends the semantics of <code>sh:languageIn</code> giving the order of language tags in the
list a meaning. Implementations MUST prefer literals according to the order of the
<code>sh:languageIn</code> values.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, from left to right.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is necessary, as the lead in to the ordered list states earlier entries are preferred over later ones. But if it is...

Suggested change
<code>sh:languageIn</code> values.
<code>sh:languageIn</code> values, from left to right and top to bottom.

But this seems to assume one serialization (which seems likely to be Turtle), which I don't think is required anywhere.

<p>
If no literal matching the preferred language is available, implementations MAY fall back to a literal in
another available language or apply the <a>label resolution</a> fallback strategy as defined for the relevant
context.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferred default should be a literal with no language?

Copy link
Copy Markdown
Member

@smessie smessie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me content-wise. I just included some suggestions below to improve the wording to my feeling.

Comment on lines +1044 to +1047
UI literals — such as labels, descriptions, and other human-readable strings required for
rendering a user interface — are selected based on language tags. This section defines how
an application determines which language to use when multiple language-tagged literals are
available for a given property.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
UI literalssuch as labels, descriptions, and other human-readable strings required for
rendering a user interface are selected based on language tags. This section defines how
an application determines which language to use when multiple language-tagged literals are
available for a given property.
UI literals, such as labels, descriptions, and other human-readable strings used for
rendering a user interface, are selected based on language tags. This section defines how
an application determines which language to use when multiple language-tagged literals are
available for a given property.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using commas to offset this sub-sentence makes it more difficult to parse, especially but not only for people for whom English is a second or later language. The em-dashes offset the sub-sentence more clearly, such that readers can ignore that section when reading for comprehension, and then return to parse the "such as" details.

Comment on lines +1061 to +1064
The values of <code>sh:languageIn</code>, when present in the applicable <a>shapes graph</a> context. This
specification extends the semantics of <code>sh:languageIn</code> giving the order of language tags in the
list a meaning. Implementations MUST prefer literals according to the order of the
<code>sh:languageIn</code> values.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The values of <code>sh:languageIn</code>, when present in the applicable <a>shapes graph</a> context. This
specification extends the semantics of <code>sh:languageIn</code> giving the order of language tags in the
list a meaning. Implementations MUST prefer literals according to the order of the
<code>sh:languageIn</code> values.
The values of <code>sh:languageIn</code>, when present in the applicable <a>shapes graph</a> context. The use
of `sh:languageIn` in this document extends its semantics, providing a meaningful order to the language tags
in the list. Implementations MUST prefer literals according to the order of the
<code>sh:languageIn</code> values.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rephrasing results in an inaccurate statement.

Comment on lines +1096 to +1103
ex:PersonShape
a sh:NodeShape ;
sh:property [
sh:path foaf:name ;
sh:name "Name"@en ;
sh:name "Nom"@fr ;
sh:languageIn ( "fr" "en" ) ;
] .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ex:PersonShape
a sh:NodeShape ;
sh:property [
sh:path foaf:name ;
sh:name "Name"@en ;
sh:name "Nom"@fr ;
sh:languageIn ( "fr" "en" ) ;
] .
ex:PersonShape
a sh:NodeShape ;
sh:property [
sh:path foaf:name ;
sh:name "Name"@en ;
sh:name "Nom"@fr ;
sh:languageIn ( "fr" "en" ) ;
] .

Comment on lines +1109 to +1111
ex:alice a ex:Person ;
foaf:name "Alice"@en ;
foaf:name "Alice"@fr .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ex:alice a ex:Person ;
foaf:name "Alice"@en ;
foaf:name "Alice"@fr .
ex:alice a ex:Person ;
foaf:name "Alice"@en ;
foaf:name "Alice"@fr .

Comment on lines +1088 to +1090
If no literal matching the preferred language is available, implementations MAY fall back to a literal in
another available language or apply the <a>label resolution</a> fallback strategy as defined for the relevant
context.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting from @robert-david's suggestion (which only commented on line 1090)

Suggested change
If no literal matching the preferred language is available, implementations MAY fall back to a literal in
another available language or apply the <a>label resolution</a> fallback strategy as defined for the relevant
context.
If no literal matching the preferred language is available, implementations MAY fall back to a literal in
another available language (or without a declared language) or apply the <a>label resolution</a>
fallback strategy as defined for the relevant context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Literal language handling

4 participants