Support for DDMS JSON Encoding

53 views
Skip to first unread message

Jeff Vettraino

unread,
May 23, 2014, 1:09:55 PM5/23/14
to ddms...@googlegroups.com
Have you put any thought or found any need for a JSON DDMS encoding?

We are looking to provide metadata in a nice format for WebApps to handle, so wondering if someone has done any JSON/DDMS mappings (outside of a raw XML to JSON converter).

Brian Uri!

unread,
May 23, 2014, 1:33:24 PM5/23/14
to ddms...@googlegroups.com
Hello again Jeff,

I'm not aware of any work that has been done to date on DDMS-to-JSON mappings. I opened up Issue #218 to track this enhancement request.

In the meantime, take a look at the toText() method on the Resource class. This converts the record into a flat name-value pairing of data in accordance with the DDMS specification's suggested approach for Text output. (There is a comparable toHTML() method which creates HTML meta tags with the same data). The original specification resulted in some ambiguities on naming and proper namespacing in the flat format, but the output from DDMSence has a standardized output with lowerCamel names and consistency.

Additionally, there is a configurable property, output.indexLevel, that will insert indices into the text output to clear up ambiguity when multiple elements of the same name are possible.

It should be pretty straightforward to parse the flat name-value into flat JSON. As an actual enhancement to the DDMSence library, I would probably want to consider a better hierarchical structure. I'll take a look as time permits and update Issue #218 with my thoughts.

Regards,
BU

Jeff Vettraino

unread,
May 23, 2014, 1:39:26 PM5/23/14
to ddms...@googlegroups.com
Thanks Brian!  I will take a look at that this next week.  

Just an FYI, we are looking to leverage DDMSence for some Content Discovery & Retrieval software (http://www.dni.gov/index.php/about/organization/chief-information-officer/cdr-search) that is compatible with DDF (http://codice.github.io/ddf/). 

Jeff Vettraino
Cohesive Integrations
jeff.ve...@cohesiveintegrations.com
(602) 332-1377


--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/KJkwwlloOOc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Uri!

unread,
May 29, 2014, 8:57:17 PM5/29/14
to ddms...@googlegroups.com
I have a promising implementation under development using google-gson as a JSON provider. Look for a DDMSence 2.3.0 release in the next couple weeks, depending on my free time.

Regards,
BU

Brian Uri!

unread,
May 30, 2014, 7:19:45 PM5/30/14
to ddms...@googlegroups.com
v2.3.0 has been released. I attempted a DDMS-to-JSON mapping closer to the underlying DDMS data model (rather than a "dumb" XML conversion), in hopes that it would be more useful in DDMS-related contexts. There are also configurable properties for pretty-printing and for controlling the output of attribute groups. To get started with the new release, take a look at the first Tutorial application, Essentials. It has been updated for JSON, and can load DDMS metacards to show how they would look in JSON.

Since JSON is not part of the official specification, I have some wiggle room to improve the output in the future. Please let me know how it works in the real world, and if you have any thoughts on how it might be more useful in your use case.

Thanks for the suggestion!
BU
Reply all
Reply to author
Forward
0 new messages