Search in sources :

Example 1 with ProvenanceProxy

use of org.vcell.pathway.persistence.BiopaxProxy.ProvenanceProxy in project vcell by virtualcell.

the class PathwayReaderBiopax3 method addObjectProvenance.

private Provenance addObjectProvenance(Element element) {
    if (element.getChildren().size() == 0) {
        // if there are no children it must be a resource inside another object
        ProvenanceProxy proxy = new ProvenanceProxy();
        addAttributes(proxy, element);
        pathwayModel.add(proxy);
        return proxy;
    }
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (childElement.getName().equals("Provenance")) {
                Provenance thingie = addObjectProvenance(childElement);
                pathwayModel.add(thingie);
                return thingie;
            }
        }
    }
    Provenance provenance = new Provenance();
    addAttributes(provenance, element);
    for (Object child : element.getChildren()) {
        if (child instanceof Element) {
            Element childElement = (Element) child;
            if (!addContentProvenance(provenance, element, childElement)) {
                showUnexpected(childElement);
            }
        }
    }
    pathwayModel.add(provenance);
    return provenance;
}
Also used : Provenance(org.vcell.pathway.Provenance) ProvenanceProxy(org.vcell.pathway.persistence.BiopaxProxy.ProvenanceProxy) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject)

Aggregations

Element (org.jdom.Element)1 BioPaxObject (org.vcell.pathway.BioPaxObject)1 GroupObject (org.vcell.pathway.GroupObject)1 Provenance (org.vcell.pathway.Provenance)1 ProvenanceProxy (org.vcell.pathway.persistence.BiopaxProxy.ProvenanceProxy)1