Skip to content

Commit

Permalink
Updated for API changes in the IChemObjectBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Oct 17, 2010
1 parent a346769 commit c159bd5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/org/openscience/cdk/libio/jena/Convertor.java
Expand Up @@ -351,20 +351,20 @@ public static IMolecule model2Molecule(Model model,
IMolecule mol = null;
if (mols.hasNext()) {
Resource rdfMol = mols.next();
mol = builder.newMolecule();
mol = builder.newInstance(IMolecule.class);
Map<Resource,IAtom> rdfToCDKAtomMap = new HashMap<Resource,IAtom>();
StmtIterator atoms = rdfMol.listProperties(CDK.HASATOM);
while (atoms.hasNext()) {
Resource rdfAtom = atoms.nextStatement().getResource();
IAtom atom;
if (rdfAtom.hasProperty(RDF.type, CDK.PSEUDOATOM)) {
atom = builder.newPseudoAtom();
atom = builder.newInstance(IPseudoAtom.class);
atom.setStereoParity(0);
Statement label = rdfAtom.getProperty(CDK.HASLABEL);
if (label != null)
((IPseudoAtom)atom).setLabel(label.getString());
} else {
atom = builder.newAtom();
atom = builder.newInstance(IAtom.class);
}
Statement symbol = rdfAtom.getProperty(CDK.SYMBOL);
if (symbol != null) atom.setSymbol(symbol.getString());
Expand All @@ -375,7 +375,7 @@ public static IMolecule model2Molecule(Model model,
StmtIterator bonds = rdfMol.listProperties(CDK.HASBOND);
while (bonds.hasNext()) {
Resource rdfBond = bonds.nextStatement().getResource();
IBond bond = builder.newBond();
IBond bond = builder.newInstance(IBond.class);
StmtIterator bondAtoms = rdfBond.listProperties(CDK.BINDSATOM);
int atomCounter = 0;
while (bondAtoms.hasNext()) {
Expand Down

0 comments on commit c159bd5

Please sign in to comment.