Search in sources :

Example 11 with NamedProperty

use of org.sbolstandard.core.datatree.Datatree.NamedProperty in project libSBOLj by SynBioDex.

the class SBOLWriter method formatModuleDefinitions.

private static void formatModuleDefinitions(Set<ModuleDefinition> module, List<TopLevelDocument<QName>> topLevelDoc) {
    for (ModuleDefinition m : module) {
        List<NamedProperty<QName>> list = new ArrayList<>();
        formatCommonTopLevelData(list, m);
        for (URI role : m.getRoles()) {
            list.add(NamedProperty(Sbol2Terms.ModuleDefinition.roles, role));
        }
        formatFunctionalComponents(m.getFunctionalComponents(), list);
        formatInteractions(m.getInteractions(), list);
        formatModelProperties(m.getModelURIs(), list);
        formatModule(m.getModules(), list);
        topLevelDoc.add(TopLevelDocument(Sbol2Terms.ModuleDefinition.ModuleDefinition, m.getIdentity(), NamedProperties(list)));
    }
}
Also used : NamedProperty(org.sbolstandard.core.datatree.NamedProperty) NamedProperty(org.sbolstandard.core.datatree.Datatree.NamedProperty) ArrayList(java.util.ArrayList) URI(java.net.URI)

Example 12 with NamedProperty

use of org.sbolstandard.core.datatree.Datatree.NamedProperty in project libSBOLj by SynBioDex.

the class SBOLWriter method formatAssociations.

private static void formatAssociations(Set<Association> associations, List<NamedProperty<QName>> properties) {
    for (Association association : associations) {
        List<NamedProperty<QName>> list = new ArrayList<>();
        formatCommonIdentifiedData(list, association);
        for (URI role : association.getRoles()) {
            list.add(NamedProperty(Sbol2Terms.Association.role, role));
        }
        list.add(NamedProperty(Sbol2Terms.Association.agent, association.getAgentURI()));
        if (association.isSetPlan()) {
            list.add(NamedProperty(Sbol2Terms.Association.plan, association.getPlanURI()));
        }
        properties.add(NamedProperty(Sbol2Terms.Activity.qualifiedAssociation, NestedDocument(Sbol2Terms.Association.Association, association.getIdentity(), NamedProperties(list))));
    }
}
Also used : NamedProperty(org.sbolstandard.core.datatree.NamedProperty) NamedProperty(org.sbolstandard.core.datatree.Datatree.NamedProperty) ArrayList(java.util.ArrayList) URI(java.net.URI)

Aggregations

URI (java.net.URI)12 ArrayList (java.util.ArrayList)12 NamedProperty (org.sbolstandard.core.datatree.Datatree.NamedProperty)12 NamedProperty (org.sbolstandard.core.datatree.NamedProperty)12 NestedDocument (org.sbolstandard.core.datatree.Datatree.NestedDocument)3 NestedDocument (org.sbolstandard.core.datatree.NestedDocument)3 QName (javax.xml.namespace.QName)2 StringifyQName (org.sbolstandard.core.io.json.StringifyQName)2