use of org.vcell.pathway.Provenance 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;
}
use of org.vcell.pathway.Provenance in project vcell by virtualcell.
the class PathwayProducerBiopax3 method addContentEntity.
// dataSource Provenance multiple
// availability String multiple
// name String multiple
// xref Xref multiple
// evidence Evidence multiple
private Element addContentEntity(BioPaxObject bpObject, Element element) {
element = addContentBioPaxObject(bpObject, element);
Entity ob = (Entity) bpObject;
Element tmpElement = null;
if (ob.getDataSource() != null && ob.getDataSource().size() > 0) {
ArrayList<Provenance> list = ob.getDataSource();
for (Provenance item : list) {
tmpElement = new Element("dataSource", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getAvailability() != null && ob.getAvailability().size() > 0) {
ArrayList<String> list = ob.getAvailability();
for (String item : list) {
tmpElement = new Element("availability", bp);
tmpElement.setAttribute("datatype", schemaString, rdf);
tmpElement.setText(item);
element.addContent(tmpElement);
}
}
if (ob.getName() != null && ob.getName().size() > 0) {
ArrayList<String> list = ob.getName();
for (String item : list) {
tmpElement = new Element("name", bp);
tmpElement.setAttribute("datatype", schemaString, rdf);
tmpElement.setText(item);
element.addContent(tmpElement);
}
}
if (ob.getxRef() != null && ob.getxRef().size() > 0) {
ArrayList<Xref> list = ob.getxRef();
for (Xref item : list) {
String elementName = "xref";
tmpElement = new Element(elementName, bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getEvidence() != null && ob.getEvidence().size() > 0) {
ArrayList<Evidence> list = ob.getEvidence();
for (Evidence item : list) {
tmpElement = new Element("evidence", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
if (ob.getSBSubEntity() != null && ob.getSBSubEntity().size() > 0) {
ArrayList<SBEntity> list = ob.getSBSubEntity();
for (SBEntity item : list) {
tmpElement = new Element("sbSubEntity", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
return element;
}
use of org.vcell.pathway.Provenance in project vcell by virtualcell.
the class PathwayReader method addObjectProvenance.
private Provenance addObjectProvenance(Element element) {
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, provenance);
}
}
}
pathwayModel.add(provenance);
return provenance;
}
use of org.vcell.pathway.Provenance in project vcell by virtualcell.
the class PathwayProducerBiopax3 method addContentProvenance.
// name String multiple
// xref Xref multiple
private Element addContentProvenance(BioPaxObject bpObject, Element element) {
element = addContentUtilityClass(bpObject, element);
Provenance ob = (Provenance) bpObject;
Element tmpElement = null;
if (ob.getName() != null && ob.getName().size() > 0) {
List<String> list = ob.getName();
for (String item : list) {
tmpElement = new Element("name", bp);
tmpElement.setAttribute("datatype", schemaString, rdf);
tmpElement.setText(item);
element.addContent(tmpElement);
}
}
if (ob.getxRef() != null && ob.getxRef().size() > 0) {
List<Xref> list = ob.getxRef();
for (Xref item : list) {
tmpElement = new Element("xref", bp);
addIDToProperty(tmpElement, item);
mustPrintObject(item);
element.addContent(tmpElement);
}
}
return element;
}
Aggregations