Skip to content

Localized String Syntax for 0.FDO/Name and Description #40

Description

@Pfeil

For name and description, I was trying to figure out how to model it properly.

I thought that for both, the syntax could be the same: A serialization of some string and a ISO639 language tag. In our case, we'd expect in JSON, e.g.

{
"prefix/StringSyntax": "Any kind of string",
"prefix/LangugeTagIso639": "en"
}

I thought I'd simply define this and reuse it for 0.FDO/Name and 0.FDO/Description.

Now, you see that this "LocalizedStringSyntax" is pretty generic (on purpose). It contains no strict semantics and should not be used as an attribute directly. Therefore, it should not be an AttributeDef, but a SyntaxDef.

At the same time, I need to use 0.FDO/ValidationMechanism and 0.FDO/DataType to compose two syntaxes. Those are only in AttributeDef, not in SyntaxDef, though. The specification does not forbid me to do it, but as a developer, I wonder if I SHOULD do it? I am unsure because:

  • Will implementations use/recognize this?
  • Should the specification be more attribute-driven than "type-driven"? At least for the implementation I will consider re-designing the foundational model in the long run to be more flexible. If this is successful, it might be more developer friendly to go this way.

Attachments:

Record draft of 0.FDO/LocalizedStringSyntax
{
  "0.FDO/Type": [
    "FDO_Syntax_Definition"
  ],
  "0.FDO/Profile": [
    "0.FDO/SyntaxDef"
  ],
  "0.FDO/Data": [
    "Not_Applicable"
  ],
  "0.FDO/Name": [
    {
      "value": "Localized string",
      "lang": "en"
    }
  ],
  "0.FDO/Description": [
    {
      "value": "Specifies the way to express a string value that is localized to a specific language.",
      "lang": "en"
    }
  ],
  "0.FDO/ValidationMechanism": [
    "InlineCombination"
  ],
  "0.FDO/DataType": [
    "0.FDO/StringSyntax",
    "0.FDO/LanguageTagIso639"
  ]
}

Alternatives I considered:

  • Some specialized syntax, not composing/combining FDOs
    • Not really reusable (hides semantics from the common semantic layer of FDOs)
    • adds a second "shadow structure" (more parsing required)
    • Doesn't feel native to our approach, I wanted to try what exists already
  • Using 0.FDO/Name as a main label (not localized), and expect users to somehow inherit the name semantics and create a new type
    • How to expect consistent reuse if it is not in core?
    • We do not really have the semantics transport defined, maybe with 0.FDO/Extends? Currently, Extends is quite special, e.g. only transports 0.FDO/Attribute and other profile-specific information
    • If we would have it defined, can we replace it with 0.FDO/Name? I think we did not specify yet.

I wonder if I miss something in the specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions