#172 Read an IMolecule from and save into N3-formatted RDF graphs

Needs_Review
closed
nobody
cdk-1.4.x (181)
5
2012-10-28
2010-03-27
No

The attached patch against CDK master adds functionality to save an IMolecule into a RDF graph and read it back into an IMolecule, using an OWL model reflecting the CDK data model. I believe this is the first format with the potential of roundtripping CDK models without loss of information.

With the Jena libraries, the patch is too large to attach to this report. Instead, you can find it online at my GitHub cdk repository in two versions:

http://github.com/egonw/cdk/tree/73-rdf/ (for historical reasons)
http://github.com/egonw/cdk/tree/f-73-rdf (patch to apply)

The first has all 32-ish patches separately, and the second collapsed into one patch. Note that the 73-rdf contains two patches files elsewhere in this tracker, which are not present in the f-73-rdf branch (f=final). The collapsed patch must therefore be applied, not the patches from 73-rdf. Those are referred to, to see the history of the patch.

Discussion

  • Egon Willighagen

    Hi Rajarshi, my apologies for the long delay... I have update the patch.

    GitHub should normally take care of the refs, but I think the problem is the URI you used for cloning... you should use the regular CDK repos URI on my account, and then take the f-73-rdf branch...

    You could do:

    git remote add egonw git://github.com/egonw/cdk.git
    git fetch egonw
    git checkout -b my73rdf egonw/f-73-rdf

    But I will also attach a patch file now, based on the today's master.

     
  • Egon Willighagen

    Hi Rajarshi, my apologies for the long delay... I have update the patch.

    GitHub should normally take care of the refs, but I think the problem is the URI you used for cloning... you should use the regular CDK repos URI on my account, and then take the f-73-rdf branch...

    You could do:

    git remote add egonw git://github.com/egonw/cdk.git
    git fetch egonw
    git checkout -b my73rdf egonw/f-73-rdf

     
  • Rajarshi Guha

    Rajarshi Guha - 2010-10-16

    Could you rebase against master, makes it easier to review

     
  • Rajarshi Guha

    Rajarshi Guha - 2010-10-17

    In the OWL reader, you have

    • public IChemObject read(IChemObject object) throws CDKException {
    • if (object instanceof IMolecule) {
    • return readMolecule((IMolecule)object);
    • } else {
    • throw new CDKException(
    • "Only supported is reading of IMolecule objects."
    • );
    • }
    • }

    but readMolecule(IMolecule) is a private method that just returns the input argument? I think you could drop this private method and just return the molecule. Or is there a reason for it being there?

    The class CDK could be renamed to something else s it is the same name as the CDK class in o..o.c (which provides version info).

     

Log in to post a comment.