use of org.sbolstandard.core.datatree.Datatree.NestedDocument in project libSBOLj by SynBioDex.
the class SBOLWriter method formatComponents.
private static void formatComponents(Set<Component> components, List<NamedProperty<QName>> properties) {
for (Component s : components) {
List<NamedProperty<QName>> list = new ArrayList<>();
formatCommonIdentifiedData(list, s);
for (URI roles : s.getRoles()) {
list.add(NamedProperty(Sbol2Terms.Component.roles, roles));
}
if (s.isSetRoleIntegration()) {
list.add(NamedProperty(Sbol2Terms.Component.roleIntegration, RoleIntegrationType.convertToURI(s.getRoleIntegration())));
}
list.add(NamedProperty(Sbol2Terms.ComponentInstance.access, AccessType.convertToURI(s.getAccess())));
list.add(NamedProperty(Sbol2Terms.ComponentInstance.hasComponentDefinition, s.getDefinitionURI()));
List<NestedDocument<QName>> referenceList = getMapsTo(s.getMapsTos());
for (NestedDocument<QName> n : referenceList) {
list.add(NamedProperty(Sbol2Terms.ComponentInstance.hasMapsTo, n));
}
properties.add(NamedProperty(Sbol2Terms.ComponentDefinition.hasComponent, NestedDocument(Sbol2Terms.Component.Component, s.getIdentity(), NamedProperties(list))));
}
}
use of org.sbolstandard.core.datatree.Datatree.NestedDocument in project libSBOLj by SynBioDex.
the class SBOLWriter method formatParticipations.
private static List<NestedDocument<QName>> formatParticipations(Set<Participation> participations) {
List<NestedDocument<QName>> nestedDoc = new ArrayList<>();
for (Participation p : participations) {
List<NamedProperty<QName>> list = new ArrayList<>();
formatCommonIdentifiedData(list, p);
for (URI r : p.getRoles()) list.add(NamedProperty(Sbol2Terms.Participation.role, r));
list.add(NamedProperty(Sbol2Terms.Participation.hasParticipant, p.getParticipantURI()));
nestedDoc.add(NestedDocument(Sbol2Terms.Participation.Participation, p.getIdentity(), NamedProperties(list)));
}
return nestedDoc;
}
use of org.sbolstandard.core.datatree.Datatree.NestedDocument in project libSBOLj by SynBioDex.
the class SBOLWriter method formatInteractions.
/**
* formatInteractions for Module
* @param interactions
* @param properties
*/
private static void formatInteractions(Set<Interaction> interactions, List<NamedProperty<QName>> properties) {
for (Interaction i : interactions) {
List<NamedProperty<QName>> list = new ArrayList<>();
formatCommonIdentifiedData(list, i);
for (URI type : i.getTypes()) {
list.add(NamedProperty(Sbol2Terms.Interaction.type, type));
}
List<NestedDocument<QName>> participantList = formatParticipations(i.getParticipations());
for (NestedDocument<QName> n : participantList) {
list.add(NamedProperty(Sbol2Terms.Interaction.hasParticipations, n));
}
properties.add(NamedProperty(Sbol2Terms.ModuleDefinition.hasInteractions, NestedDocument(Sbol2Terms.Interaction.Interaction, i.getIdentity(), NamedProperties(list))));
}
}
Aggregations