Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-defined semantics #326

Open
javagl opened this issue Dec 5, 2024 · 0 comments
Open

User-defined semantics #326

javagl opened this issue Dec 5, 2024 · 0 comments

Comments

@javagl
Copy link
Contributor

javagl commented Dec 5, 2024

(This was originally considered to become part of #325 , but may warrant its own issue:)

At some point, we'd like to address CesiumGS/3d-tiles#643 and CesiumGS/3d-tiles#574 . And I think that one important aspect of that is to establish a mechanism for how these new semantics are brought into the validator. The first issue already suggests that new semantics could (nearly) be defined with a pure, plain 3D Tiles Metadata schema, using the 'semantics' as property names in that schema. And that's basically what is already done in the validator. There is the minor caveat that the componentType in this schema can also be a RegEx like FLOAT(32|64), to match the different options of component types. But I'd suggest to simply disallow this for future semantics definitions.

Given that the validation of semantics then boils down to loading a plain, pure, 3D Tiles Metadata schema and comparing its properties to other properties, the generalization here would be:

  • Move the "matching schema" that is currently used here into a file, like CesiumMetadataSemantics-0.0.1.json
  • Load this file and use it for the validator
  • (Eventually:) Allow users to define their own "matching schema files", and also use them for the validation

The last point means that users could define their semantics in a schema, like

{
  id: "CompanyNameMetadataSemantics-0.0.0",
  classes: {
    CompanyNameSemantics: {
      properties: {
        COMPANY_NAME_SEMANTIC_A : {
          description: "What this semantic is...",
          type: "STRING",
          array: true
        }
      }
    }
  }
}

and pass in a command line argument like
... -semantics ["CompanyNameMetadataSemantics-0.0.0.json"]
to take these semantics into account during the validation.

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

No branches or pull requests

1 participant