I don't think we need to worry about the naming conventions of corner cases
just yet. Taking something basic, ethane in cml

<molecule>
 <atomArray>
  <atom id="a1" elementType="C" x3="0.229656" y3="0.720147" z3="-0.015085"/>
  <atom id="a2" elementType="C" x3="-0.229656" y3="-0.720147" z3="0.015085"/>
 </atomArray>
 <bondArray>
  <bond atomRefs2="a1 a2" order="1"/>
 </bondArray></molecule>

and my translation to json

{
    "atoms": {
        "a1": { "element type": "C", "x3": 0.229656, "y3": 0.720147,
"z3": -0.015085 },
        "a2": { "element type": "C", "x3": -0.229656, "y3": -0.720147,
"z3": 0.015085 }

    }
    "bonds": [
        {"atom refs": ["a1", "a2"], "order": 1}
    ]}

it could use some cleaning up, but that's the idea.


On Fri, Jun 7, 2013 at 12:50 PM, Dimitri Maziuk <dmaz...@bmrb.wisc.edu>wrote:

> On 06/07/2013 12:25 PM, Patrick Fuller wrote:
>
> > Geoff - Outside of some fairly minor issues, xml translates easily to
> json.
> > Could the chemical xml specification just be translated to json?
>
> If you gloss over things like #[P]CDATA, (elt+), (#CDATA|(foo,bar,baz)),
> it's trivial. Except for attributes: if you have bad xml, like <atom
> idx="1" id="C"/> instead of <atom><idx>1</idx><id>C</id></atom>, then it
> isn't.
>
> --
> Dimitri Maziuk
> Programmer/sysadmin
> BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu
>
>
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. A cloud service to automate IT design, transition and operations
> 2. Dashboards that offer high-level views of enterprise services
> 3. A single system of record for all IT processes
> http://p.sf.net/sfu/servicenow-d2d-j
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to