-
Notifications
You must be signed in to change notification settings - Fork 7
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
JSON Schema (or similar) definition #34
Comments
Hello Keith,
Apparently landed in the right place :--)
It is correct that we never defined a json schema for EBUCore. Like in mediainfo, we mostly provide mechanisms to translate metadata instances into JSON.
I worked with mediainfo on this output. We tried to be as generic as possible in generating mostly arrays.
I don’t know how far json schema has progressed, or parsers/libraries to validate JSON in varipus environments… I guess you have answers to this when speaking of validation.
Anyway, if you have any suggestions on working on this, I am open to it. We are working on version 1,10 of EBUCore and that could be the right time to come with a JSON schema for EBUCore.
What do you think?
Jean-Pierre Evain, EBU
From: Keith Layne <[email protected]>
Sent: mardi, 11 février 2020 17:59
To: ebu/ebucore <[email protected]>
Cc: Subscribed <[email protected]>
Subject: [ebu/ebucore] JSON Schema (or similar) definition (#34)
I apologize if this isn't the right place for this question, please redirect me if so.
The current version of the spec mentions JSON, and mediainfo produces JSON output natively with its EBUCore_JSON output. However, I can't find any definition of this format. XSD does not map 1:1 to JSON Schema. Is the JSON format formalized? If so, can it be published in some format alongside the XSD?
I could try to maintain a handcrafted schema, but that doesn't fill me with confidence, and I don't know where/how I could get a library of test files to validate against other than by running mediainfo against a bunch of files, and that seems like a fragile approach anyway. I'd prefer to get the single source of truth from the horse's mouth.
If this resource already exists and I've just missed it, please let me know!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#34?email_source=notifications&email_token=ACLXRMV6MQ7WQQ5VKMIBRZ3RCLKMNA5CNFSM4KTEUFI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IMT6RQA>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACLXRMREELDSK54ZAOKQMM3RCLKMNANCNFSM4KTEUFIQ>.
------------------------------------------------------------------------------
**************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please notify the system manager. This footnote also confirms that this email message has been swept by the mailgateway
**************************************************
|
Thanks for replying so quickly! I looked through the mediainfo source and it appeared that the JSON output matches the XML very closely. This may be a case where the XSD->JSON schema tooling (there's not much) might be able to succeed with a simple mapping. I don't think JSON schema is actually standardized (still), but it seems widely used with pretty mature tooling across languages. In my current project I'm targeting TypeScript, which has good tooling for (at least) code generation from JSON Schema. I did see the use of arrays and was not sure of the semantics there. I guess what I really need to do is to dig into the XSD to answer questions like that. I'm not familiar enough with the spec to know what to expect. For example, I looked at output of a previous version of mediainfo (not sure which EBUCore version it supported) for a video file, and the structure was much more flat, i.e. no arrays. I guess what's not currently clear at the moment (and probably is answered by the XSD) is whether or not those arrays are intended to represet zero-or-one, zero-or-many, or one-or-many. Hopefully that makes sense. |
Hi Keith,
Of course, that’s what I have been trying to do all these years.
Good to see developers working on this.
The export from mediaInfo is quite simple when it comes to export structural technical metadata. It is a bit more complex when exporting dynamic metadata, but also not overly complicated. So the conversion to JSON is rather straightforward. We have made choices though to be able to adapt to any cardinality and this is why to systematically use an array even is only one element.
I gave up a long time with hoping for a standardised JSON schema :--)
Good to know tools have evolved. I am always sceptical because I can see that often libraries do not follow the evolution of specs e.g. for xml, xslt, etc. SO it is probably the same with JSON. But if you are satisfied, then it means there is already enough around.
While going around investigating the xsd schema, please do not hesitate to ask if you have any question. You can email me directly at [email protected]<mailto:[email protected]> or we keep exchanging via github.
If I remember well, we went directly to the present format when I sponsored Jérôme from mediaInfo to export data in EBUCore JSON too. SO I am not sure about you point on “things changed”.
About the cardinalities, as I said above, using arrays is the most flexible way to adapt to any from zero to unbounded.
From: Keith Layne <[email protected]>
Sent: mercredi, 12 février 2020 17:24
To: ebu/ebucore <[email protected]>
Cc: Evain, Jean-Pierre <[email protected]>; Comment <[email protected]>
Subject: Re: [ebu/ebucore] JSON Schema (or similar) definition (#34)
Thanks for replying so quickly!
I looked through the mediainfo source and it appeared that the JSON output matches the XML very closely. This may be a case where the XSD->JSON schema tooling (there's not much) might be able to succeed with a simple mapping.
I don't think JSON schema is actually standardized (still), but it seems widely used with pretty mature tooling across languages. In my current project I'm targeting TypeScript, which has good tooling for (at least) code generation from JSON Schema.
I did see the use of arrays and was not sure of the semantics there. I guess what I really need to do is to dig into the XSD to answer questions like that. I'm not familiar enough with the spec to know what to expect.
For example, I looked at output of a previous version of mediainfo (not sure which EBUCore version it supported) for a video file, and the structure was much more flat, i.e. no arrays. I guess what's not currently clear at the moment (and probably is answered by the XSD) is whether or not those arrays are intended to represet zero-or-one, zero-or-many, or one-or-many. Hopefully that makes sense.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#34?email_source=notifications&email_token=ACLXRMWHORHRU22PROVUD4DRCQPDPA5CNFSM4KTEUFI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELRMZRI#issuecomment-585288901>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACLXRMREI7ZIGMOT3J7ERWLRCQPDPANCNFSM4KTEUFIQ>.
------------------------------------------------------------------------------
**************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please notify the system manager. This footnote also confirms that this email message has been swept by the mailgateway
**************************************************
|
@keithlayne Hey, did you progress on the EBUCore JSON schema? I'd also like to use EBUCore in a JSON/TypeScript environment and I'm wondering if there's something existing work to take advantage of. |
@jstarpl I am just validating the fields that I depend on. Probably a good candidate for runtime types, e.g. |
I apologize if this isn't the right place for this question, please redirect me if so.
The current version of the spec mentions JSON, and
mediainfo
produces JSON output natively with itsEBUCore_JSON
output. However, I can't find any definition of this format. XSD does not map 1:1 to JSON Schema. Is the JSON format formalized? If so, can it be published in some format alongside the XSD?I could try to maintain a handcrafted schema, but that doesn't fill me with confidence, and I don't know where/how I could get a library of test files to validate against other than by running
mediainfo
against a bunch of files, and that seems like a fragile approach anyway. I'd prefer to get the single source of truth from the horse's mouth.If this resource already exists and I've just missed it, please let me know!
The text was updated successfully, but these errors were encountered: