private static void formatModelProperties(Set<URI> models, List<NamedProperty<QName>> list) { for(URI m : models) { list.add(NamedProperty(Sbol2Terms.ModuleDefinition.hasModels, m)); } }
private static void formatSequence(URI sequence, List<NamedProperty<QName>> list) { list.add(NamedProperty(Sbol2Terms.ComponentDefinition.hasSequence, sequence)); }
private static void formatWasInformedByProperties(Set<URI> wasInformedBys, List<NamedProperty<QName>> list) { for(URI wib : wasInformedBys) { list.add(NamedProperty(Sbol2Terms.Activity.wasInformedBy, wib)); } }
/** * Create a value property from a Boolean value. * * @param name the property name * @param value the property value * @param <N> the property name type * @return a new NamedProperty with the supplied name and value */ public static <N> NamedProperty<N> NamedProperty(final N name, final Boolean value) { return NamedProperty(name, Datatree.<N>Literal(value)); }
/** * Create a value property from an int value. * * @param name the property name * @param value the property value * @param <N> the property name type * @return a new NamedProperty with the supplied name and value */ public static <N> NamedProperty<N> NamedProperty(final N name, final int value) { return NamedProperty(name, Datatree.<N>Literal(value)); }
/** * Create a value property from a Double value. * * @param name the property name * @param value the property value * @param <N> the property name type * @return a new NamedProperty with the supplied name and value */ public static <N> NamedProperty<N> NamedProperty(final N name, final Double value) { return NamedProperty(name, Datatree.<N>Literal(value)); }
/** * Create a value property from a string value. * * @param name the property name * @param value the property value * @param <N> the property name type * @return a new NamedProperty with the supplied name and value */ public static <N> NamedProperty<N> NamedProperty(final N name, final String value) { return NamedProperty(name, Datatree.<N>Literal(value)); }
/** * Create a value property from a URI value. * * @param name the property name * @param value the property value * @param <N> the property name type * @return a new NamedProperty with the supplied name and value */ public static <N> NamedProperty<N> NamedProperty(final N name, final URI value) { return NamedProperty(name, Datatree.<N>Literal(value)); }
private static void formatModels (Set<Model> models, List<TopLevelDocument<QName>> topLevelDoc) { for(Model m : models) { List<NamedProperty<QName>> list = new ArrayList<>(); formatCommonTopLevelData(list,m); list.add(NamedProperty(Sbol2Terms.Model.source, m.getSource())); list.add(NamedProperty(Sbol2Terms.Model.language, m.getLanguage())); list.add(NamedProperty(Sbol2Terms.Model.framework, m.getFramework())); topLevelDoc.add(TopLevelDocument(Sbol2Terms.Model.Model, m.getIdentity(), NamedProperties(list))); } }
private static void formatSequenceConstraints(Set<SequenceConstraint> sequenceConstraint, List<NamedProperty<QName>> properties) { for(SequenceConstraint s : sequenceConstraint) { List<NamedProperty<QName>> list = new ArrayList<>(); formatCommonIdentifiedData(list, s); list.add(NamedProperty(Sbol2Terms.SequenceConstraint.restriction, s.getRestrictionURI())); list.add(NamedProperty(Sbol2Terms.SequenceConstraint.hasSubject, s.getSubjectURI())); list.add(NamedProperty(Sbol2Terms.SequenceConstraint.hasObject, s.getObjectURI())); properties.add(NamedProperty(Sbol2Terms.ComponentDefinition.hasSequenceConstraints, NestedDocument( Sbol2Terms.SequenceConstraint.SequenceConstraint, s.getIdentity(), NamedProperties(list)))); } }
private static void formatCommonTopLevelData (List<NamedProperty<QName>> list, TopLevel t) { formatCommonIdentifiedData(list,t); for(URI attachment : t.getAttachmentURIs()) { list.add(NamedProperty(Sbol2Terms.TopLevel.hasAttachment, attachment)); } }
private static List<NestedDocument<QName>> getMapsTo(Set<MapsTo> references) { List<NestedDocument<QName>> nestedDoc = new ArrayList<>(); for(MapsTo m : references) { List<NamedProperty<QName>> list = new ArrayList<>(); formatCommonIdentifiedData(list, m); list.add(NamedProperty(Sbol2Terms.MapsTo.refinement, RefinementType.convertToURI(m.getRefinement()))); list.add(NamedProperty(Sbol2Terms.MapsTo.hasRemote, m.getRemoteURI())); list.add(NamedProperty(Sbol2Terms.MapsTo.hasLocal, m.getLocalURI())); nestedDoc.add(NestedDocument(Sbol2Terms.MapsTo.MapsTo, m.getIdentity(), NamedProperties(list))); } return nestedDoc; }
private static void formatSequences (Set<Sequence> sequences, List<TopLevelDocument<QName>> topLevelDoc) { for(Sequence s : sequences) { List<NamedProperty<QName>> list = new ArrayList<>(); formatCommonTopLevelData(list, s); list.add(NamedProperty(Sbol2Terms.Sequence.elements, s.getElements())); list.add(NamedProperty(Sbol2Terms.Sequence.encoding, s.getEncoding())); topLevelDoc.add(TopLevelDocument(Sbol2Terms.Sequence.Sequence, s.getIdentity(), NamedProperties(list))); } }
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; }
private static void formatDNASequence(Sequence sequence, List<TopLevelDocument<QName>> topLevelDoc) { List<NamedProperty<QName>> list = new ArrayList<>(); list.add(NamedProperty(Sbol1Terms.DNASequence.nucleotides, sequence.getElements())); topLevelDoc.add(TopLevelDocument(Sbol1Terms.DNASequence.DNASequence, sequence.getIdentity(), NamedProperties(list))); }
private static NestedDocument<QName> getSequenceV1(Sequence sequence) { List<NamedProperty<QName>> list = new ArrayList<>(); list.add(NamedProperty(Sbol1Terms.DNASequence.nucleotides, sequence.getElements())); return NestedDocument(Sbol1Terms.DNASequence.DNASequence, sequence.getIdentity(), NamedProperties(list)); }
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))); } }
private static void formatImplementation(Set<Implementation> implementations, List<TopLevelDocument<QName>> topLevelDoc) { for(Implementation implementation : implementations) { List<NamedProperty<QName>> list = new ArrayList<>(); formatCommonTopLevelData(list, implementation); if (implementation.isSetBuilt()) { list.add(NamedProperty(Sbol2Terms.Implementation.built, implementation.getBuiltURI())); } topLevelDoc.add(TopLevelDocument(Sbol2Terms.Implementation.Implementation, implementation.getIdentity(), NamedProperties(list))); } }
private static void formatCombinatorialDerivation(Set<CombinatorialDerivation> combinatorialDerivations, List<TopLevelDocument<QName>> topLevelDoc) { for(CombinatorialDerivation combinatorialDerivation : combinatorialDerivations) { List<NamedProperty<QName>> list = new ArrayList<>(); formatCommonTopLevelData(list, combinatorialDerivation); list.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.template, combinatorialDerivation.getTemplateURI())); if (combinatorialDerivation.isSetStrategy()) { list.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.strategy, StrategyType.convertToURI(combinatorialDerivation.getStrategy()))); } formatVariableComponents(combinatorialDerivation.getVariableComponents(), list); topLevelDoc.add(TopLevelDocument(Sbol2Terms.CombinatorialDerivation.CombinatorialDerivation, combinatorialDerivation.getIdentity(), NamedProperties(list))); } }
public NamedProperty<To> mapVP(NamedProperty<From> f) { return Datatree.NamedProperty(transformName(f.getName()), mapV(f.getValue())); }