Search in sources :

Example 1 with XrefProxy

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

the class PathwayReaderBiopax3 method addObjectXref.

private Xref addObjectXref(Element element) {
    Namespace bp = Namespace.getNamespace("bp", "http://www.biopax.org/release/biopax-level3.owl#");
    if (element.getChild("UnificationXref", bp) != null) {
        UnificationXref xref = addObjectUnificationXref(element.getChild("UnificationXref", bp));
        return xref;
    }
    if (element.getChild("RelationshipXref", bp) != null) {
        RelationshipXref xref = addObjectRelationshipXref(element.getChild("RelationshipXref", bp));
        return xref;
    }
    if (element.getChild("PublicationXref", bp) != null) {
        PublicationXref xref = addObjectPublicationXref(element.getChild("PublicationXref", bp));
        return xref;
    }
    if (element.getChildren().size() == 0) {
        XrefProxy xref = new XrefProxy();
        addAttributes(xref, element);
        pathwayModel.add(xref);
        return xref;
    } else {
        for (Object child : element.getChildren()) {
            if (child instanceof Element) {
                Element childElement = (Element) child;
                showUnexpected(childElement);
            }
        }
        Xref xref = new Xref();
        pathwayModel.add(xref);
        System.out.println("should never happen");
        return xref;
    }
}
Also used : Xref(org.vcell.pathway.Xref) PublicationXref(org.vcell.pathway.PublicationXref) UnificationXref(org.vcell.pathway.UnificationXref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) UnificationXref(org.vcell.pathway.UnificationXref) Element(org.jdom.Element) GroupObject(org.vcell.pathway.GroupObject) BioPaxObject(org.vcell.pathway.BioPaxObject) Namespace(org.jdom.Namespace) RelationshipXref(org.vcell.pathway.RelationshipXref) XrefProxy(org.vcell.pathway.persistence.BiopaxProxy.XrefProxy)

Example 2 with XrefProxy

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

the class PathwayReader method addObjectXref.

private Xref addObjectXref(Element element) {
    Namespace bp = Namespace.getNamespace("bp", "http://www.biopax.org/release/biopax-level2.owl#");
    if (element.getChild("unificationXref", bp) != null) {
        UnificationXref xref = addObjectUnificationXref(element.getChild("unificationXref", bp));
        return xref;
    }
    if (element.getChild("relationshipXref", bp) != null) {
        RelationshipXref xref = addObjectRelationshipXref(element.getChild("relationshipXref", bp));
        return xref;
    }
    if (element.getChild("publicationXref", bp) != null) {
        PublicationXref xref = addObjectPublicationXref(element.getChild("publicationXref", bp));
        return xref;
    }
    if (element.getChildren().size() == 0) {
        XrefProxy xref = new XrefProxy();
        addAttributes(xref, element);
        pathwayModel.add(xref);
        return xref;
    } else {
        Xref xref = new Xref();
        for (Object child : element.getChildren()) {
            if (child instanceof Element) {
                Element childElement = (Element) child;
                if (!addContentXref(xref, element, childElement)) {
                    showUnexpected(childElement, xref);
                }
            }
        }
        pathwayModel.add(xref);
        System.out.println("should never happen");
        return xref;
    }
}
Also used : Xref(org.vcell.pathway.Xref) PublicationXref(org.vcell.pathway.PublicationXref) UnificationXref(org.vcell.pathway.UnificationXref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) UnificationXref(org.vcell.pathway.UnificationXref) Element(org.jdom.Element) BioPaxObject(org.vcell.pathway.BioPaxObject) Namespace(org.jdom.Namespace) RelationshipXref(org.vcell.pathway.RelationshipXref) XrefProxy(org.vcell.pathway.persistence.BiopaxProxy.XrefProxy)

Aggregations

Element (org.jdom.Element)2 Namespace (org.jdom.Namespace)2 BioPaxObject (org.vcell.pathway.BioPaxObject)2 PublicationXref (org.vcell.pathway.PublicationXref)2 RelationshipXref (org.vcell.pathway.RelationshipXref)2 UnificationXref (org.vcell.pathway.UnificationXref)2 Xref (org.vcell.pathway.Xref)2 XrefProxy (org.vcell.pathway.persistence.BiopaxProxy.XrefProxy)2 GroupObject (org.vcell.pathway.GroupObject)1