Search in sources :

Example 16 with NestedDocument

use of org.sbolstandard.core.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))));
    }
}
Also used : StringifyQName(org.sbolstandard.core.io.json.StringifyQName) QName(javax.xml.namespace.QName) NamedProperty(org.sbolstandard.core.datatree.NamedProperty) NamedProperty(org.sbolstandard.core.datatree.Datatree.NamedProperty) ArrayList(java.util.ArrayList) URI(java.net.URI) NestedDocument(org.sbolstandard.core.datatree.NestedDocument) NestedDocument(org.sbolstandard.core.datatree.Datatree.NestedDocument)

Aggregations

URI (java.net.URI)16 ArrayList (java.util.ArrayList)16 NestedDocument (org.sbolstandard.core.datatree.NestedDocument)16 QName (javax.xml.namespace.QName)15 StringifyQName (org.sbolstandard.core.io.json.StringifyQName)15 HashSet (java.util.HashSet)13 Literal (org.sbolstandard.core.datatree.Literal)13 URIcompliance.createCompliantURI (org.sbolstandard.core2.URIcompliance.createCompliantURI)13 IdentifiableDocument (org.sbolstandard.core.datatree.IdentifiableDocument)9 NamedProperty (org.sbolstandard.core.datatree.Datatree.NamedProperty)3 NestedDocument (org.sbolstandard.core.datatree.Datatree.NestedDocument)3 NamedProperty (org.sbolstandard.core.datatree.NamedProperty)3 HashMap (java.util.HashMap)1 Set (java.util.Set)1 DateTime (org.joda.time.DateTime)1 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)1