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

name vs title #10

Closed
m-mohr opened this issue Mar 11, 2024 · 4 comments · Fixed by #11
Closed

name vs title #10

m-mohr opened this issue Mar 11, 2024 · 4 comments · Fixed by #11
Assignees

Comments

@m-mohr
Copy link
Contributor

m-mohr commented Mar 11, 2024

Currently, the alternate asset extension defines title and description. I think this is not ideal, due to the reasone below:

Here's an example that I've seen in the wild:

{
      "href": "https://example.com/example.tif",
      "type": "image/jp2",
      "file:size": 100015921,
      "file:checksum": "1620a7e5018b93dd4c9b99b379215b6fe924466829154c821c0044ceb6a304dedc61",
      "title": "Green (band 3) - 10m",
      "alternate": {
        "s3": {
          "href": "s3://example.com/example.tif",
          "storage:platform": "OTHER",
          "storage:region": "waw",
          "storage:requester_pays": false,
          "storage:tier": "hot"
        } 
      }
    }

The title in the overall asset is a generic title for the file and looks fine. Providing the title again in the sub-asset doesn't make a lot of sense though, it would be the same, just hosted on S3.

STAC Browser implements this extension as a Tab interface. Showing the titles for the tabs doesn't make sense. I've implemented it as such, that it supports a name field to provide short labels for the tab headers.

I'd actually propose to add a name field for such cases to the Alternate Asset Object.

title and description I'd remove and refer back to common metadata, saying that extensions and common metadata fields such as title and description can be used to further define the alternative asset.

The updates example would look like this:

{
      "href": "https://example.com/example.tif",
      "type": "image/jp2",
       "name": "HTTP",
      "file:size": 100015921,
      "file:checksum": "1620a7e5018b93dd4c9b99b379215b6fe924466829154c821c0044ceb6a304dedc61",
      "title": "Green (band 3) - 10m",
      "alternate": {
        "s3": {
          "href": "s3://example.com/example.tif",
          "name": "S3",
          "storage:platform": "OTHER",
          "storage:region": "waw",
          "storage:requester_pays": false,
          "storage:tier": "hot"
        } 
      }
    }

and render as such:
altassets

See also: radiantearth/stac-browser@47dea4f

@m-mohr m-mohr self-assigned this Mar 11, 2024
@matthewhanson
Copy link
Member

I'm +1 on all this - dropping title and description and just using 'name' from common metadata.

@m-mohr
Copy link
Contributor Author

m-mohr commented Mar 11, 2024

I'll create PR, @matthewhanson to review.

@m-mohr m-mohr linked a pull request Mar 12, 2024 that will close this issue
@matthewhanson
Copy link
Member

Reconsidering this - there is already a key used in the alternate dictionary, in this case "s3". Having a name is a bit redundant, but if there is a name then Best Practices should state that the key and name should be the same.

@m-mohr
Copy link
Contributor Author

m-mohr commented Mar 25, 2024

Hmm, I don't think I agree. Name for me is human readable with spaces, special characters, and might be localized (language extension). A key should be stable and machine-optimized. Usually, I'd put the name in a title, but it's ambiguous with the main asset title, which describes the title for the asset and usually also applies without change to the alternate asset.

Example:

Name (English localization of an Item: "Local filesystem"
Name (German localization of an Item): "Lokales Dateisystem"
Asset key: "local"

You don't want to change the asset key when you change languages in a single catalog, don't you?

@m-mohr m-mohr closed this as completed in #11 Jul 9, 2024
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 a pull request may close this issue.

2 participants