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

keys in the top object #218

Closed
gmabey opened this issue Jan 21, 2022 · 10 comments
Closed

keys in the top object #218

gmabey opened this issue Jan 21, 2022 · 10 comments
Labels

Comments

@gmabey
Copy link
Contributor

gmabey commented Jan 21, 2022

I see that an asymmetry exists between .sigmf-meta files and .sigmf-collection files in that other keys besides "global", "captures", and "annotations" are allowed to be defined by the user (via an extension) for meta, but that collections may only have a single "collection" key.

Was this difference deliberate? Is there rationale for this besides my guess that the concept of a collection is very narrow in scope, whereas the metadata for recordings involves more unknowns?

For myself, I wish that only "global", "captures", and "annotations" were allowed at the top level for a recording, thereby forcing the user to decide whether it's a global concept or not.

@jacobagilbert
Copy link
Member

SigMF .sigmf-meta files and .sigmf-collection files are really orthogonal in terms of metadata structure. Metadata schema have the usual three fields, which can all be extended via extensions, and collection files have specific objects which are applicable to the whole collection of individual SigMF recordings, and can also be extended by extensions.

There is some overlap in the key names from keys within sigmf-meta top level objects and sigmf-collection collection objects, but the values themselves are not interchangeable.

@gmabey
Copy link
Contributor Author

gmabey commented Jan 27, 2022

Yes, but I think all of what you said is already in the spec, and you didn't address the asymmetry in allowance of top level fields like I'd hoped. I'm not hung up on this question, and if there's not a good answer then I can just close it I guess.

@jacobagilbert
Copy link
Member

you didn't address the asymmetry in allowance of top level fields like I'd hoped

I must be missing something. Are you asking why collections files cannot have global, captures and annotations objects?

@gmabey
Copy link
Contributor Author

gmabey commented Jan 27, 2022

Sorry let me back up. Both recordings and collections have a canonical set of top-level keys; in the case of recordings, that set is of size 3, whereas for collections it's 1.

The asymmetry I observe in the spec is that it's apparently allowed for there to exist other top-level keys (outside of their respective canonical set) in a .sigmf-meta file but not in a .sigmf-collection file.

@jacobagilbert
Copy link
Member

jacobagilbert commented Jan 27, 2022

Additional top level keys are not permitted in compliant metadata or collections.

For Metadata:

The top-level Object MUST contain three JSON Objects named global, captures, and annotations.

For Collections:

The Collection Object MUST be the only top-level object in the file.

Extensions are not permitted to create additional top level keys as far as i know though this could probably be more explicit in the spec. I think we can sharpen some of this to make it more clear "The top-level Object MUST contain exactly three JSON Objects"

It is possible to have noncompliant but still functional and useful SigMF schema though, just not something we really advocate users do.

@gmabey
Copy link
Contributor Author

gmabey commented Jan 27, 2022

I agree that it could/should be sharpened, but here's the line that led me to believe that extensions could add new top-level, under Extension Namespaces:

4. An extension namespace MAY define new top-level SigMF Objects, key/value pairs, new files, new Dataset formats, or new datatypes.

Oh, does "SigMF Objects" refer to additional files?? Surely not ... at least now you know what wording let me to believe that other top-level key words were allowed.

And as I tried to originally state, I support the concept of only allowing those 3 key words at the top level.

@jacobagilbert
Copy link
Member

Hm. This is not something I was aware of and is somewhat problematic. Will think on it.

@jacobagilbert
Copy link
Member

@bhilburn

Is this still what we want? Specifically should new top level metadata keys or "new files" really be permitted by extensions?

@jacobagilbert jacobagilbert added this to Backburner in v1.x Development Feb 2, 2022
@jacobagilbert jacobagilbert removed this from Backburner in v1.x Development Feb 2, 2022
@gmabey
Copy link
Contributor Author

gmabey commented Feb 13, 2022

poke @bhilburn

@jacobagilbert
Copy link
Member

Going to close this out.

Collections are intentionally very narrow in scope, while Recordings can be created to contain a wide range of data which may cause users to wish to have the freedom to create new top level objects. The spec is consistent in that metadata files must contain at least those three top level objects, and collections are restricted to the single top level object. On some level I would have probably liked to limit the metadata to those three top level keys but this is out there and its fine as far as i can tell.

If there are breaking use cases here [for collections], lets address them specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants