Search in sources :

Example 1 with NamedProperty

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

the class SBOLWriter method formatSequenceAnnotations.

private static void formatSequenceAnnotations(Set<SequenceAnnotation> sequenceAnnotations, List<NamedProperty<QName>> properties) {
    for (SequenceAnnotation s : sequenceAnnotations) {
        List<NamedProperty<QName>> list = new ArrayList<>();
        formatCommonIdentifiedData(list, s);
        for (URI roles : s.getRoles()) {
            list.add(NamedProperty(Sbol2Terms.SequenceAnnotation.roles, roles));
        }
        // }
        for (Location location : s.getLocations()) {
            list.add(getLocation(location));
        }
        if (s.isSetComponent())
            list.add(NamedProperty(Sbol2Terms.SequenceAnnotation.hasComponent, s.getComponentURI()));
        properties.add(NamedProperty(Sbol2Terms.ComponentDefinition.hasSequenceAnnotations, NestedDocument(Sbol2Terms.SequenceAnnotation.SequenceAnnotation, s.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 2 with NamedProperty

use of org.sbolstandard.core.datatree.NamedProperty 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))));
    }
}
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)

Example 3 with NamedProperty

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

the class SBOLWriter method formatCollections.

private static void formatCollections(Set<Collection> collections, List<TopLevelDocument<QName>> topLevelDoc) {
    for (Collection c : collections) {
        List<NamedProperty<QName>> list = new ArrayList<>();
        formatCommonTopLevelData(list, c);
        for (URI member : c.getMemberURIs()) {
            list.add(NamedProperty(Sbol2Terms.Collection.hasMembers, member));
        }
        topLevelDoc.add(TopLevelDocument(Sbol2Terms.Collection.Collection, c.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 4 with NamedProperty

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

the class SBOLWriter method formatVariableComponents.

private static void formatVariableComponents(Set<VariableComponent> variableComponents, List<NamedProperty<QName>> properties) {
    for (VariableComponent variableComponent : variableComponents) {
        List<NamedProperty<QName>> list = new ArrayList<>();
        formatCommonIdentifiedData(list, variableComponent);
        list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariable, variableComponent.getVariableURI()));
        list.add(NamedProperty(Sbol2Terms.VariableComponent.hasOperator, OperatorType.convertToURI(variableComponent.getOperator())));
        for (URI variant : variableComponent.getVariantURIs()) {
            list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariants, variant));
        }
        for (URI variantCollection : variableComponent.getVariantCollectionURIs()) {
            list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariantCollections, variantCollection));
        }
        for (URI variantDerivation : variableComponent.getVariantDerivationURIs()) {
            list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariantDerivations, variantDerivation));
        }
        properties.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.hasVariableComponent, NestedDocument(Sbol2Terms.VariableComponent.VariableComponent, variableComponent.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 5 with NamedProperty

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

the class SBOLWriter method formatComponentDefinitions.

private static void formatComponentDefinitions(Set<ComponentDefinition> componentDefinitions, List<TopLevelDocument<QName>> topLevelDoc) {
    for (ComponentDefinition c : componentDefinitions) {
        List<NamedProperty<QName>> list = new ArrayList<>();
        formatCommonTopLevelData(list, c);
        for (URI types : c.getTypes()) {
            list.add(NamedProperty(Sbol2Terms.ComponentDefinition.type, types));
        }
        for (URI roles : c.getRoles()) {
            list.add(NamedProperty(Sbol2Terms.ComponentDefinition.roles, roles));
        }
        formatComponents(c.getComponents(), list);
        formatSequenceAnnotations(c.getSequenceAnnotations(), list);
        formatSequenceConstraints(c.getSequenceConstraints(), list);
        for (URI sUri : c.getSequenceURIs()) formatSequence(sUri, list);
        topLevelDoc.add(TopLevelDocument(Sbol2Terms.ComponentDefinition.ComponentDefinition, c.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