From 4ebd616e098571ef8fe751f8ed95183ae7d73d7d Mon Sep 17 00:00:00 2001 From: goksel <> Date: Sun, 24 Apr 2022 11:53:03 +0100 Subject: [PATCH] Merging release 1.4 --- .../BBa_F2620_PoPSReceiver.ttl | 8 +- libSBOLj3/output/combine2020/combine2020.ttl | 8 +- .../output/entity/annotation/annotation.ttl | 10 +- .../entity/attachment/attachment.jsonld | 6 +- .../attachment/attachment.jsonld_expanded | 6 +- .../output/entity/attachment/attachment.nt | 2 +- .../output/entity/attachment/attachment.rdf | 2 +- .../output/entity/attachment/attachment.ttl | 8 +- .../output/entity/collection/collection.ttl | 8 +- .../component_urn_uri.jsonld | 4 +- .../component_urn_uri.jsonld_expanded | 4 +- .../component_urn_uri/component_urn_uri.nt | 8 +- .../component_urn_uri/component_urn_uri.rdf | 4 +- .../component_urn_uri/component_urn_uri.rj | 4 +- .../component_urn_uri/component_urn_uri.ttl | 12 +- .../component_urn_uri_ordered.nt | 8 +- .../entity/implementation/implementation.ttl | 8 +- .../output/entity/interface/interface.ttl | 8 +- libSBOLj3/output/entity/model/model.ttl | 8 +- .../component/component.jsonld | 82 + .../component/component.jsonld_expanded | 88 ++ .../entity_addiitonal/component/component.nt | 29 + .../entity_addiitonal/component/component.rdf | 48 + .../entity_addiitonal/component/component.rj | 158 ++ .../entity_addiitonal/component/component.ttl | 43 + .../component/component_ordered.nt | 29 + .../componentreference.jsonld | 85 + .../componentreference.jsonld_expanded | 81 + .../componentreference/componentreference.nt | 27 + .../componentreference/componentreference.rdf | 51 + .../componentreference/componentreference.rj | 153 ++ .../componentreference/componentreference.ttl | 45 + .../componentreference_ordered.nt | 27 + .../combinatorialderivation.jsonld | 74 + .../combinatorialderivation.jsonld_expanded | 58 + .../combinatorialderivation.nt | 19 + .../combinatorialderivation.rdf | 37 + .../combinatorialderivation.rj | 105 ++ .../combinatorialderivation.ttl | 32 + .../combinatorialderivation_ordered.nt | 19 + .../component/component.jsonld | 41 + .../component/component.jsonld_expanded | 22 + .../entity_additional/component/component.nt | 7 + .../entity_additional/component/component.rdf | 21 + .../entity_additional/component/component.rj | 39 + .../entity_additional/component/component.ttl | 18 + .../component/component_ordered.nt | 7 + .../constraint/constraint.jsonld | 126 ++ .../constraint/constraint.jsonld_expanded | 131 ++ .../constraint/constraint.nt | 44 + .../constraint/constraint.rdf | 75 + .../constraint/constraint.rj | 246 +++ .../constraint/constraint.ttl | 66 + .../constraint/constraint_ordered.nt | 44 + .../output/entity_additional/cut/cut.jsonld | 87 ++ .../entity_additional/cut/cut.jsonld_expanded | 70 + libSBOLj3/output/entity_additional/cut/cut.nt | 23 + .../output/entity_additional/cut/cut.rdf | 46 + libSBOLj3/output/entity_additional/cut/cut.rj | 128 ++ .../output/entity_additional/cut/cut.ttl | 39 + .../entity_additional/cut/cut_ordered.nt | 23 + .../experiment/experiment.jsonld | 46 + .../experiment/experiment.jsonld_expanded | 39 + .../experiment/experiment.nt | 13 + .../experiment/experiment.rdf | 29 + .../experiment/experiment.rj | 74 + .../experiment/experiment.ttl | 25 + .../experiment/experiment_ordered.nt | 13 + .../externallydefined.jsonld | 51 + .../externallydefined.jsonld_expanded | 42 + .../externallydefined/externallydefined.nt | 14 + .../externallydefined/externallydefined.rdf | 32 + .../externallydefined/externallydefined.rj | 79 + .../externallydefined/externallydefined.ttl | 28 + .../externallydefined_ordered.nt | 14 + .../interaction/interaction.jsonld | 49 + .../interaction/interaction.jsonld_expanded | 31 + .../interaction/interaction.nt | 10 + .../interaction/interaction.rdf | 26 + .../interaction/interaction.rj | 57 + .../interaction/interaction.ttl | 23 + .../interaction/interaction_ordered.nt | 10 + .../localsubcomponent.jsonld | 49 + .../localsubcomponent.jsonld_expanded | 31 + .../localsubcomponent/localsubcomponent.nt | 10 + .../localsubcomponent/localsubcomponent.rdf | 26 + .../localsubcomponent/localsubcomponent.rj | 57 + .../localsubcomponent/localsubcomponent.ttl | 23 + .../localsubcomponent_ordered.nt | 10 + .../participation/participation.jsonld | 190 +++ .../participation.jsonld_expanded | 232 +++ .../participation/participation.nt | 78 + .../participation/participation.rdf | 121 ++ .../participation/participation.rj | 430 +++++ .../participation/participation.ttl | 107 ++ .../participation/participation_ordered.nt | 78 + .../entity_additional/range/range.jsonld | 117 ++ .../range/range.jsonld_expanded | 115 ++ .../output/entity_additional/range/range.nt | 38 + .../output/entity_additional/range/range.rdf | 67 + .../output/entity_additional/range/range.rj | 209 +++ .../output/entity_additional/range/range.ttl | 56 + .../entity_additional/range/range_ordered.nt | 38 + .../sequencefeature/sequencefeature.jsonld | 90 ++ .../sequencefeature.jsonld_expanded | 70 + .../sequencefeature/sequencefeature.nt | 23 + .../sequencefeature/sequencefeature.rdf | 46 + .../sequencefeature/sequencefeature.rj | 128 ++ .../sequencefeature/sequencefeature.ttl | 39 + .../sequencefeature_ordered.nt | 23 + .../subcomponent/subcomponent.jsonld | 129 ++ .../subcomponent/subcomponent.jsonld_expanded | 133 ++ .../subcomponent/subcomponent.nt | 44 + .../subcomponent/subcomponent.rdf | 77 + .../subcomponent/subcomponent.rj | 242 +++ .../subcomponent/subcomponent.ttl | 64 + .../subcomponent/subcomponent_ordered.nt | 44 + .../componentreference.jsonld | 85 + .../componentreference.jsonld_expanded | 81 + .../componentreference/componentreference.nt | 27 + .../componentreference/componentreference.rdf | 51 + .../componentreference/componentreference.rj | 153 ++ .../componentreference/componentreference.ttl | 45 + .../componentreference_ordered.nt | 27 + .../output/invalid/displayid/displayid.ttl | 8 +- .../measurement/measurement.ttl | 8 +- .../measurement_using_units_From_OM.ttl | 8 +- .../output/multicellular/multicellular.ttl | 8 +- .../multicellular_simple.ttl | 8 +- .../activity/activity.jsonld | 12 +- .../activity/activity.jsonld_expanded | 10 +- .../provenance_entity/activity/activity.nt | 4 +- .../provenance_entity/activity/activity.rdf | 4 +- .../provenance_entity/activity/activity.rj | 12 +- .../provenance_entity/activity/activity.ttl | 12 +- .../activity/activity_ordered.nt | 4 +- .../output/provenance_entity/agent/agent.ttl | 8 +- .../output/provenance_entity/plan/plan.ttl | 8 +- .../output/toggle_switch/toggle_switch.ttl | 8 +- libSBOLj3/pom.xml | 45 +- .../org/sbolstandard/core3/api/SBOLAPI.java | 17 + .../sbolstandard/core3/entity/Attachment.java | 117 +- .../sbolstandard/core3/entity/Collection.java | 13 +- .../core3/entity/CombinatorialDerivation.java | 45 +- .../sbolstandard/core3/entity/Component.java | 124 +- .../core3/entity/ComponentReference.java | 44 +- .../sbolstandard/core3/entity/Constraint.java | 49 +- .../core3/entity/ControlledIdentified.java | 2 - .../core3/entity/ControlledTopLevel.java | 2 - .../org/sbolstandard/core3/entity/Cut.java | 37 +- .../core3/entity/EntireSequence.java | 5 - .../sbolstandard/core3/entity/Experiment.java | 2 - .../core3/entity/ExperimentalData.java | 4 +- .../core3/entity/ExternallyDefined.java | 41 +- .../sbolstandard/core3/entity/Feature.java | 37 +- .../sbolstandard/core3/entity/Identified.java | 152 +- .../core3/entity/Implementation.java | 11 +- .../core3/entity/Interaction.java | 31 +- .../sbolstandard/core3/entity/Interface.java | 27 +- .../core3/entity/LocalSubComponent.java | 33 +- .../sbolstandard/core3/entity/Location.java | 88 +- .../org/sbolstandard/core3/entity/Model.java | 47 +- .../core3/entity/Participation.java | 40 +- .../org/sbolstandard/core3/entity/Range.java | 51 +- .../core3/entity/SBOLDocument.java | 32 +- .../sbolstandard/core3/entity/Sequence.java | 32 +- .../core3/entity/SequenceFeature.java | 55 +- .../core3/entity/SubComponent.java | 128 +- .../sbolstandard/core3/entity/TopLevel.java | 53 +- .../core3/entity/VariableFeature.java | 73 +- .../core3/entity/measure/BinaryPrefix.java | 1 - .../core3/entity/measure/CompoundUnit.java | 1 - .../core3/entity/measure/Measure.java | 86 +- .../core3/entity/measure/Prefix.java | 47 +- .../core3/entity/measure/PrefixedUnit.java | 39 +- .../core3/entity/measure/SingularUnit.java | 45 +- .../core3/entity/measure/Unit.java | 87 +- .../core3/entity/measure/UnitDivision.java | 40 +- .../entity/measure/UnitExponentiation.java | 46 +- .../entity/measure/UnitMultiplication.java | 41 +- .../core3/entity/provenance/Activity.java | 86 +- .../core3/entity/provenance/Agent.java | 1 - .../core3/entity/provenance/Association.java | 41 +- .../core3/entity/provenance/Plan.java | 1 - .../core3/entity/provenance/Usage.java | 30 +- .../org/sbolstandard/core3/io/SBOLIO.java | 81 +- .../core3/util/Configuration.java | 65 + .../org/sbolstandard/core3/util/RDFUtil.java | 52 +- .../core3/validation/IdentityValidator.java | 257 +++ .../core3/validation/Message.java | 31 + .../core3/validation/PropertyValidator.java | 87 ++ .../core3/validation/SBOLComparator.java | 45 +- .../core3/validation/SBOLValidator.java | 166 +- .../core3/vocabulary/DataModel.java | 2 +- .../VariableFeatureCardinality.java | 25 +- .../resources/ValidationMessages.properties | 56 + .../entity/provenance/test/ActivityTest.java | 29 +- .../core3/entity/test/AnnotationTest.java | 2 +- .../core3/entity/test/AttachmentTest.java | 107 +- .../core3/entity/test/AttachmentTest2.java | 67 + .../core3/entity/test/CollectionTest.java | 12 +- .../test/CombinatorialDerivationTest.java | 75 + .../entity/test/ComponentReferenceTest.java | 66 + .../core3/entity/test/ComponentTest.java | 84 + .../core3/entity/test/ConstraintTest.java | 69 + .../core3/entity/test/CutTest.java | 82 + .../core3/entity/test/ExperimentTest.java | 50 + .../entity/test/ExternallyDefinedTest.java | 61 + .../core3/entity/test/ImplementationTest.java | 8 +- .../core3/entity/test/InteractionTest.java | 58 + .../core3/entity/test/InterfaceTest.java | 7 +- .../entity/test/LocalSubComponentTest.java | 60 + .../core3/entity/test/ModelTest.java | 22 +- .../core3/entity/test/ParticipantTest.java | 73 + .../core3/entity/test/RangeTest.java | 96 ++ .../entity/test/SequenceFeatureTest.java | 14 +- .../core3/entity/test/SubComponentTest.java | 80 + .../core3/measure/test/MeasureTest.java | 101 +- .../org/sbolstandard/core3/test/AppTest.java | 17 +- .../org/sbolstandard/core3/test/TestUtil.java | 1383 +++++++++-------- .../test/GettingStartedTutorial_Short.java | 4 +- .../usecase/test/PoPSReceiverExample.java | 3 +- .../validation/test/InvalidDisplayIdTest.java | 13 +- .../core3/validation/test/Validate.java | 5 +- .../test/ValidationReadWriteTest.java | 209 +++ 225 files changed, 11012 insertions(+), 1990 deletions(-) create mode 100644 libSBOLj3/output/entity_addiitonal/component/component.jsonld create mode 100644 libSBOLj3/output/entity_addiitonal/component/component.jsonld_expanded create mode 100644 libSBOLj3/output/entity_addiitonal/component/component.nt create mode 100644 libSBOLj3/output/entity_addiitonal/component/component.rdf create mode 100644 libSBOLj3/output/entity_addiitonal/component/component.rj create mode 100644 libSBOLj3/output/entity_addiitonal/component/component.ttl create mode 100644 libSBOLj3/output/entity_addiitonal/component/component_ordered.nt create mode 100644 libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld create mode 100644 libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld_expanded create mode 100644 libSBOLj3/output/entity_addiitonal/componentreference/componentreference.nt create mode 100644 libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rdf create mode 100644 libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rj create mode 100644 libSBOLj3/output/entity_addiitonal/componentreference/componentreference.ttl create mode 100644 libSBOLj3/output/entity_addiitonal/componentreference/componentreference_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld create mode 100644 libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.nt create mode 100644 libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rdf create mode 100644 libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rj create mode 100644 libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.ttl create mode 100644 libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/component/component.jsonld create mode 100644 libSBOLj3/output/entity_additional/component/component.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/component/component.nt create mode 100644 libSBOLj3/output/entity_additional/component/component.rdf create mode 100644 libSBOLj3/output/entity_additional/component/component.rj create mode 100644 libSBOLj3/output/entity_additional/component/component.ttl create mode 100644 libSBOLj3/output/entity_additional/component/component_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/constraint/constraint.jsonld create mode 100644 libSBOLj3/output/entity_additional/constraint/constraint.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/constraint/constraint.nt create mode 100644 libSBOLj3/output/entity_additional/constraint/constraint.rdf create mode 100644 libSBOLj3/output/entity_additional/constraint/constraint.rj create mode 100644 libSBOLj3/output/entity_additional/constraint/constraint.ttl create mode 100644 libSBOLj3/output/entity_additional/constraint/constraint_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/cut/cut.jsonld create mode 100644 libSBOLj3/output/entity_additional/cut/cut.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/cut/cut.nt create mode 100644 libSBOLj3/output/entity_additional/cut/cut.rdf create mode 100644 libSBOLj3/output/entity_additional/cut/cut.rj create mode 100644 libSBOLj3/output/entity_additional/cut/cut.ttl create mode 100644 libSBOLj3/output/entity_additional/cut/cut_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/experiment/experiment.jsonld create mode 100644 libSBOLj3/output/entity_additional/experiment/experiment.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/experiment/experiment.nt create mode 100644 libSBOLj3/output/entity_additional/experiment/experiment.rdf create mode 100644 libSBOLj3/output/entity_additional/experiment/experiment.rj create mode 100644 libSBOLj3/output/entity_additional/experiment/experiment.ttl create mode 100644 libSBOLj3/output/entity_additional/experiment/experiment_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld create mode 100644 libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/externallydefined/externallydefined.nt create mode 100644 libSBOLj3/output/entity_additional/externallydefined/externallydefined.rdf create mode 100644 libSBOLj3/output/entity_additional/externallydefined/externallydefined.rj create mode 100644 libSBOLj3/output/entity_additional/externallydefined/externallydefined.ttl create mode 100644 libSBOLj3/output/entity_additional/externallydefined/externallydefined_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/interaction/interaction.jsonld create mode 100644 libSBOLj3/output/entity_additional/interaction/interaction.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/interaction/interaction.nt create mode 100644 libSBOLj3/output/entity_additional/interaction/interaction.rdf create mode 100644 libSBOLj3/output/entity_additional/interaction/interaction.rj create mode 100644 libSBOLj3/output/entity_additional/interaction/interaction.ttl create mode 100644 libSBOLj3/output/entity_additional/interaction/interaction_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld create mode 100644 libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.nt create mode 100644 libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rdf create mode 100644 libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rj create mode 100644 libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.ttl create mode 100644 libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/participation/participation.jsonld create mode 100644 libSBOLj3/output/entity_additional/participation/participation.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/participation/participation.nt create mode 100644 libSBOLj3/output/entity_additional/participation/participation.rdf create mode 100644 libSBOLj3/output/entity_additional/participation/participation.rj create mode 100644 libSBOLj3/output/entity_additional/participation/participation.ttl create mode 100644 libSBOLj3/output/entity_additional/participation/participation_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/range/range.jsonld create mode 100644 libSBOLj3/output/entity_additional/range/range.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/range/range.nt create mode 100644 libSBOLj3/output/entity_additional/range/range.rdf create mode 100644 libSBOLj3/output/entity_additional/range/range.rj create mode 100644 libSBOLj3/output/entity_additional/range/range.ttl create mode 100644 libSBOLj3/output/entity_additional/range/range_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld create mode 100644 libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.nt create mode 100644 libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rdf create mode 100644 libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rj create mode 100644 libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.ttl create mode 100644 libSBOLj3/output/entity_additional/sequencefeature/sequencefeature_ordered.nt create mode 100644 libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld create mode 100644 libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additional/subcomponent/subcomponent.nt create mode 100644 libSBOLj3/output/entity_additional/subcomponent/subcomponent.rdf create mode 100644 libSBOLj3/output/entity_additional/subcomponent/subcomponent.rj create mode 100644 libSBOLj3/output/entity_additional/subcomponent/subcomponent.ttl create mode 100644 libSBOLj3/output/entity_additional/subcomponent/subcomponent_ordered.nt create mode 100644 libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld create mode 100644 libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld_expanded create mode 100644 libSBOLj3/output/entity_additonal/componentreference/componentreference.nt create mode 100644 libSBOLj3/output/entity_additonal/componentreference/componentreference.rdf create mode 100644 libSBOLj3/output/entity_additonal/componentreference/componentreference.rj create mode 100644 libSBOLj3/output/entity_additonal/componentreference/componentreference.ttl create mode 100644 libSBOLj3/output/entity_additonal/componentreference/componentreference_ordered.nt create mode 100644 libSBOLj3/src/main/java/org/sbolstandard/core3/util/Configuration.java create mode 100644 libSBOLj3/src/main/java/org/sbolstandard/core3/validation/IdentityValidator.java create mode 100644 libSBOLj3/src/main/java/org/sbolstandard/core3/validation/Message.java create mode 100644 libSBOLj3/src/main/java/org/sbolstandard/core3/validation/PropertyValidator.java create mode 100644 libSBOLj3/src/main/resources/ValidationMessages.properties create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest2.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CombinatorialDerivationTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentReferenceTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ConstraintTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CutTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExperimentTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExternallyDefinedTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InteractionTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/LocalSubComponentTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ParticipantTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/RangeTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SubComponentTest.java create mode 100644 libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/ValidationReadWriteTest.java diff --git a/libSBOLj3/output/BBa_F2620_PoPSReceiver/BBa_F2620_PoPSReceiver.ttl b/libSBOLj3/output/BBa_F2620_PoPSReceiver/BBa_F2620_PoPSReceiver.ttl index 4ca9882..f8c1d2b 100644 --- a/libSBOLj3/output/BBa_F2620_PoPSReceiver/BBa_F2620_PoPSReceiver.ttl +++ b/libSBOLj3/output/BBa_F2620_PoPSReceiver/BBa_F2620_PoPSReceiver.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . a sbol:Range ; diff --git a/libSBOLj3/output/combine2020/combine2020.ttl b/libSBOLj3/output/combine2020/combine2020.ttl index 511e6c5..af7cab5 100644 --- a/libSBOLj3/output/combine2020/combine2020.ttl +++ b/libSBOLj3/output/combine2020/combine2020.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . a sbol:Interaction ; diff --git a/libSBOLj3/output/entity/annotation/annotation.ttl b/libSBOLj3/output/entity/annotation/annotation.ttl index 67082b1..a542831 100644 --- a/libSBOLj3/output/entity/annotation/annotation.ttl +++ b/libSBOLj3/output/entity/annotation/annotation.ttl @@ -1,14 +1,14 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix igem: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . +@prefix igem: . @prefix om: . +@prefix prov: . +@prefix sbol: . a sbol:Identified , igem:IGEMUsage ; igem:inStock "true" ; diff --git a/libSBOLj3/output/entity/attachment/attachment.jsonld b/libSBOLj3/output/entity/attachment/attachment.jsonld index e57d3e4..2084695 100644 --- a/libSBOLj3/output/entity/attachment/attachment.jsonld +++ b/libSBOLj3/output/entity/attachment/attachment.jsonld @@ -27,12 +27,12 @@ "hasNamespace" : "https://sbolstandard.org/examples" } ], "@context" : { - "hashAlgorithm" : { - "@id" : "http://sbols.org/v3#hashAlgorithm" - }, "hash" : { "@id" : "http://sbols.org/v3#hash" }, + "hashAlgorithm" : { + "@id" : "http://sbols.org/v3#hashAlgorithm" + }, "size" : { "@id" : "http://sbols.org/v3#size" }, diff --git a/libSBOLj3/output/entity/attachment/attachment.jsonld_expanded b/libSBOLj3/output/entity/attachment/attachment.jsonld_expanded index 0791a15..9717e11 100644 --- a/libSBOLj3/output/entity/attachment/attachment.jsonld_expanded +++ b/libSBOLj3/output/entity/attachment/attachment.jsonld_expanded @@ -21,12 +21,12 @@ "@type" : [ "http://sbols.org/v3#Component" ] }, { "@id" : "https://sbolstandard.org/examples/attachment1", - "http://sbols.org/v3#hashAlgorithm" : [ { - "@value" : "Alg1" - } ], "http://sbols.org/v3#hash" : [ { "@value" : "aaa" } ], + "http://sbols.org/v3#hashAlgorithm" : [ { + "@value" : "Alg1" + } ], "http://sbols.org/v3#size" : [ { "@value" : "1000" } ], diff --git a/libSBOLj3/output/entity/attachment/attachment.nt b/libSBOLj3/output/entity/attachment/attachment.nt index 695a4ab..2b989a4 100644 --- a/libSBOLj3/output/entity/attachment/attachment.nt +++ b/libSBOLj3/output/entity/attachment/attachment.nt @@ -1,5 +1,5 @@ - "Alg1" . "aaa" . + "Alg1" . "1000" . . . diff --git a/libSBOLj3/output/entity/attachment/attachment.rdf b/libSBOLj3/output/entity/attachment/attachment.rdf index 905b8e5..32a3bea 100644 --- a/libSBOLj3/output/entity/attachment/attachment.rdf +++ b/libSBOLj3/output/entity/attachment/attachment.rdf @@ -29,8 +29,8 @@ TetR_protein - Alg1 aaa + Alg1 1000 diff --git a/libSBOLj3/output/entity/attachment/attachment.ttl b/libSBOLj3/output/entity/attachment/attachment.ttl index ae8bdb6..c0125f6 100644 --- a/libSBOLj3/output/entity/attachment/attachment.ttl +++ b/libSBOLj3/output/entity/attachment/attachment.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :attachment1 a sbol:Attachment ; sbol:displayId "attachment1" ; diff --git a/libSBOLj3/output/entity/collection/collection.ttl b/libSBOLj3/output/entity/collection/collection.ttl index 66e0475..f6ae0f5 100644 --- a/libSBOLj3/output/entity/collection/collection.ttl +++ b/libSBOLj3/output/entity/collection/collection.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :col1 a sbol:Collection ; sbol:displayId "col1" ; diff --git a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld index 26c772f..eb7fbf7 100644 --- a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld +++ b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld @@ -1,7 +1,7 @@ { - "@id" : "urn:uuid:d713be1d-3c4c-48b6-a0a3-669f13ee2d96", + "@id" : "urn:uuid:5a9913bd-8b15-492c-a5d5-707cbc3c7c58", "@type" : "sbol:Component", - "hasNamespace" : "urn:uuid:50c93ae6-96d7-4145-9673-c3acd68182a9", + "hasNamespace" : "urn:uuid:6752ab9a-9626-464c-aec5-52bf4a89a5fb", "name" : "TetR", "type" : "SBO:0000252", "@context" : { diff --git a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld_expanded b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld_expanded index bffb090..1fa83fb 100644 --- a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld_expanded +++ b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.jsonld_expanded @@ -1,10 +1,10 @@ [ { - "@id" : "urn:uuid:d713be1d-3c4c-48b6-a0a3-669f13ee2d96", + "@id" : "urn:uuid:5a9913bd-8b15-492c-a5d5-707cbc3c7c58", "http://sbols.org/v3#name" : [ { "@value" : "TetR" } ], "http://sbols.org/v3#hasNamespace" : [ { - "@id" : "urn:uuid:50c93ae6-96d7-4145-9673-c3acd68182a9" + "@id" : "urn:uuid:6752ab9a-9626-464c-aec5-52bf4a89a5fb" } ], "http://sbols.org/v3#type" : [ { "@id" : "https://identifiers.org/SBO:0000252" diff --git a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.nt b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.nt index 79745ce..0710478 100644 --- a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.nt +++ b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.nt @@ -1,4 +1,4 @@ - "TetR" . - . - . - . + "TetR" . + . + . + . diff --git a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rdf b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rdf index 3dc0032..3348b0c 100644 --- a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rdf +++ b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rdf @@ -10,9 +10,9 @@ xmlns="https://sbolstandard.org/examples/" xmlns:om="http://www.ontology-of-units-of-measure.org/resource/om-2/" xml:base="https://sbolstandard.org/examples/"> - + TetR - + diff --git a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rj b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rj index 247712d..8932fd6 100644 --- a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rj +++ b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.rj @@ -1,5 +1,5 @@ { - "urn:uuid:d713be1d-3c4c-48b6-a0a3-669f13ee2d96" : { + "urn:uuid:5a9913bd-8b15-492c-a5d5-707cbc3c7c58" : { "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { "type" : "uri" , "value" : "http://sbols.org/v3#Component" @@ -7,7 +7,7 @@ ] , "http://sbols.org/v3#hasNamespace" : [ { "type" : "uri" , - "value" : "urn:uuid:50c93ae6-96d7-4145-9673-c3acd68182a9" + "value" : "urn:uuid:6752ab9a-9626-464c-aec5-52bf4a89a5fb" } ] , "http://sbols.org/v3#name" : [ { diff --git a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.ttl b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.ttl index 9565db9..f966f00 100644 --- a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.ttl +++ b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri.ttl @@ -1,16 +1,16 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . - + a sbol:Component ; - sbol:hasNamespace ; + sbol:hasNamespace ; sbol:name "TetR" ; sbol:type SBO:0000252 . diff --git a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri_ordered.nt b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri_ordered.nt index f1fedad..6c624cb 100644 --- a/libSBOLj3/output/entity/component_urn_uri/component_urn_uri_ordered.nt +++ b/libSBOLj3/output/entity/component_urn_uri/component_urn_uri_ordered.nt @@ -1,4 +1,4 @@ - . - "TetR" . - . - . + . + "TetR" . + . + . diff --git a/libSBOLj3/output/entity/implementation/implementation.ttl b/libSBOLj3/output/entity/implementation/implementation.ttl index 733a25e..aadc3ef 100644 --- a/libSBOLj3/output/entity/implementation/implementation.ttl +++ b/libSBOLj3/output/entity/implementation/implementation.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :impl1 a sbol:Implementation ; sbol:built :TetR_protein ; diff --git a/libSBOLj3/output/entity/interface/interface.ttl b/libSBOLj3/output/entity/interface/interface.ttl index f0f08f3..8a78eea 100644 --- a/libSBOLj3/output/entity/interface/interface.ttl +++ b/libSBOLj3/output/entity/interface/interface.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . a sbol:SubComponent ; diff --git a/libSBOLj3/output/entity/model/model.ttl b/libSBOLj3/output/entity/model/model.ttl index 641abda..c0fae49 100644 --- a/libSBOLj3/output/entity/model/model.ttl +++ b/libSBOLj3/output/entity/model/model.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :toggle_switch a sbol:Component ; sbol:description "Toggle Switch genetic circuit" ; diff --git a/libSBOLj3/output/entity_addiitonal/component/component.jsonld b/libSBOLj3/output/entity_addiitonal/component/component.jsonld new file mode 100644 index 0000000..816e700 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/component/component.jsonld @@ -0,0 +1,82 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_F2620", + "@type" : "sbol:Component", + "description" : "PoPS Receiver", + "displayId" : "BBa_F2620", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "BBa_F2620", + "role" : "SO:0000704", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040", + "@type" : "sbol:Component", + "description" : "TetR repressible promoter", + "displayId" : "BBa_R0040", + "hasNamespace" : "https://synbiohub.org/public/igem", + "hasSequence" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "name" : "pTetR", + "role" : "SO:0000167", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "@type" : "sbol:Sequence", + "description" : "pTetR sequence", + "displayId" : "BBa_R0040_Sequence1", + "elements" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence1" + }, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence2", + "@type" : "sbol:Sequence", + "description" : "pTetR sequence", + "displayId" : "BBa_R0040_Sequence2", + "elements" : "aaaa", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence2" + } ], + "@context" : { + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasSequence" : { + "@id" : "http://sbols.org/v3#hasSequence", + "@type" : "@id" + }, + "encoding" : { + "@id" : "http://sbols.org/v3#encoding", + "@type" : "@id" + }, + "elements" : { + "@id" : "http://sbols.org/v3#elements" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_addiitonal/component/component.jsonld_expanded b/libSBOLj3/output/entity_addiitonal/component/component.jsonld_expanded new file mode 100644 index 0000000..4a73d85 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/component/component.jsonld_expanded @@ -0,0 +1,88 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/BBa_F2620", + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000704" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "PoPS Receiver" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "BBa_F2620" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_F2620" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040", + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000167" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "TetR repressible promoter" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "pTetR" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_R0040" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "pTetR sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_R0040_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +}, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence2", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "aaaa" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "pTetR sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence2" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_R0040_Sequence2" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +} ] diff --git a/libSBOLj3/output/entity_addiitonal/component/component.nt b/libSBOLj3/output/entity_addiitonal/component/component.nt new file mode 100644 index 0000000..f304165 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/component/component.nt @@ -0,0 +1,29 @@ + . + "PoPS Receiver" . + "BBa_F2620" . + . + . + "BBa_F2620" . + . + . + . + "TetR repressible promoter" . + "pTetR" . + . + . + "BBa_R0040" . + . + . + "aaaa" . + "pTetR sequence" . + "Sequence2" . + . + "BBa_R0040_Sequence2" . + . + . + "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" . + "pTetR sequence" . + "Sequence1" . + . + "BBa_R0040_Sequence1" . + . diff --git a/libSBOLj3/output/entity_addiitonal/component/component.rdf b/libSBOLj3/output/entity_addiitonal/component/component.rdf new file mode 100644 index 0000000..31655f1 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/component/component.rdf @@ -0,0 +1,48 @@ + + + + + TetR repressible promoter + pTetR + + + + + BBa_R0040 + + + + PoPS Receiver + BBa_F2620 + + + BBa_F2620 + + + + aaaa + pTetR sequence + Sequence2 + + BBa_R0040_Sequence2 + + + + tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac + pTetR sequence + Sequence1 + + BBa_R0040_Sequence1 + + diff --git a/libSBOLj3/output/entity_addiitonal/component/component.rj b/libSBOLj3/output/entity_addiitonal/component/component.rj new file mode 100644 index 0000000..4344e23 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/component/component.rj @@ -0,0 +1,158 @@ +{ + "https://synbiohub.org/public/igem/BBa_R0040" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_R0040" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000167" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "pTetR" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "TetR repressible promoter" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/BBa_F2620" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_F2620" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000704" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "BBa_F2620" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "PoPS Receiver" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/BBa_R0040_Sequence2" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_R0040_Sequence2" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "aaaa" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence2" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "pTetR sequence" + } + ] + } + , + "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_R0040_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "pTetR sequence" + } + ] + } +} diff --git a/libSBOLj3/output/entity_addiitonal/component/component.ttl b/libSBOLj3/output/entity_addiitonal/component/component.ttl new file mode 100644 index 0000000..bcac961 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/component/component.ttl @@ -0,0 +1,43 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:BBa_F2620 a sbol:Component ; + sbol:description "PoPS Receiver" ; + sbol:displayId "BBa_F2620" ; + sbol:hasNamespace ; + sbol:name "BBa_F2620" ; + sbol:role SO:0000704 ; + sbol:type SBO:0000251 . + +:BBa_R0040 a sbol:Component ; + sbol:description "TetR repressible promoter" ; + sbol:displayId "BBa_R0040" ; + sbol:hasNamespace ; + sbol:hasSequence :BBa_R0040_Sequence1 ; + sbol:name "pTetR" ; + sbol:role SO:0000167 ; + sbol:type SBO:0000251 . + +:BBa_R0040_Sequence2 a sbol:Sequence ; + sbol:description "pTetR sequence" ; + sbol:displayId "BBa_R0040_Sequence2" ; + sbol:elements "aaaa" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence2" . + +:BBa_R0040_Sequence1 a sbol:Sequence ; + sbol:description "pTetR sequence" ; + sbol:displayId "BBa_R0040_Sequence1" ; + sbol:elements "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . diff --git a/libSBOLj3/output/entity_addiitonal/component/component_ordered.nt b/libSBOLj3/output/entity_addiitonal/component/component_ordered.nt new file mode 100644 index 0000000..d02f67c --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/component/component_ordered.nt @@ -0,0 +1,29 @@ + "PoPS Receiver" . + "BBa_F2620" . + . + "BBa_F2620" . + . + . + . + "TetR repressible promoter" . + "BBa_R0040" . + . + . + "pTetR" . + . + . + . + "pTetR sequence" . + "BBa_R0040_Sequence1" . + "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" . + . + . + "Sequence1" . + . + "pTetR sequence" . + "BBa_R0040_Sequence2" . + "aaaa" . + . + . + "Sequence2" . + . diff --git a/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld new file mode 100644 index 0000000..b728ff6 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld @@ -0,0 +1,85 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504", + "@type" : "sbol:Component", + "displayId" : "i13504", + "hasNamespace" : "https://synbiohub.org/public/igem", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_system", + "@type" : "sbol:Component", + "displayId" : "i13504_system", + "hasFeature" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "i13504 system", + "role" : "SBO:0000289", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "instanceOf" : "https://synbiohub.org/public/igem/i13504" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1", + "@type" : "sbol:Component", + "displayId" : "interlab16device1", + "hasFeature" : [ "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" ], + "hasNamespace" : "https://synbiohub.org/public/igem", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", + "@type" : "sbol:ComponentReference", + "displayId" : "ComponentReference1", + "inChildOf" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "refersTo" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "instanceOf" : "https://synbiohub.org/public/igem/i13504_system" + } ], + "@context" : { + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "inChildOf" : { + "@id" : "http://sbols.org/v3#inChildOf", + "@type" : "@id" + }, + "refersTo" : { + "@id" : "http://sbols.org/v3#refersTo", + "@type" : "@id" + }, + "instanceOf" : { + "@id" : "http://sbols.org/v3#instanceOf", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld_expanded b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld_expanded new file mode 100644 index 0000000..2649c50 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.jsonld_expanded @@ -0,0 +1,81 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/i13504", + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_system", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000289" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "i13504 system" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_system" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "interlab16device1" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", + "http://sbols.org/v3#inChildOf" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } ], + "http://sbols.org/v3#refersTo" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "ComponentReference1" + } ], + "@type" : [ "http://sbols.org/v3#ComponentReference" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +} ] diff --git a/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.nt b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.nt new file mode 100644 index 0000000..3b82c9f --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.nt @@ -0,0 +1,27 @@ + . + . + "i13504" . + . + . + . + . + . + "interlab16device1" . + . + . + . + "ComponentReference1" . + . + . + "SubComponent1" . + . + . + "SubComponent1" . + . + . + . + "i13504 system" . + . + . + "i13504_system" . + . diff --git a/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rdf b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rdf new file mode 100644 index 0000000..c2de452 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rdf @@ -0,0 +1,51 @@ + + + + + + + + SubComponent1 + + + + i13504 system + + + i13504_system + + + + + i13504 + + + + + + + + SubComponent1 + + + + ComponentReference1 + + + + + + interlab16device1 + + diff --git a/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rj b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rj new file mode 100644 index 0000000..cb633b2 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.rj @@ -0,0 +1,153 @@ +{ + "https://synbiohub.org/public/igem/i13504_system" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_system" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000289" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "i13504 system" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "interlab16device1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } + , { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "ComponentReference1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#ComponentReference" + } + ] , + "http://sbols.org/v3#inChildOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } + ] , + "http://sbols.org/v3#refersTo" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504_system/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504" + } + ] + } +} diff --git a/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.ttl b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.ttl new file mode 100644 index 0000000..1b448df --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference.ttl @@ -0,0 +1,45 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:i13504 a sbol:Component ; + sbol:displayId "i13504" ; + sbol:hasNamespace ; + sbol:type SBO:0000251 . + +:interlab16device1 a sbol:Component ; + sbol:displayId "interlab16device1" ; + sbol:hasFeature , ; + sbol:hasNamespace ; + sbol:type SBO:0000251 . + + + a sbol:ComponentReference ; + sbol:displayId "ComponentReference1" ; + sbol:inChildOf ; + sbol:refersTo . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:instanceOf :i13504_system . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:instanceOf :i13504 . + +:i13504_system a sbol:Component ; + sbol:displayId "i13504_system" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:name "i13504 system" ; + sbol:role SBO:0000289 ; + sbol:type SBO:0000251 . diff --git a/libSBOLj3/output/entity_addiitonal/componentreference/componentreference_ordered.nt b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference_ordered.nt new file mode 100644 index 0000000..b1ba183 --- /dev/null +++ b/libSBOLj3/output/entity_addiitonal/componentreference/componentreference_ordered.nt @@ -0,0 +1,27 @@ + "i13504" . + . + . + . + "SubComponent1" . + . + . + "i13504_system" . + . + . + "i13504 system" . + . + . + . + "ComponentReference1" . + . + . + . + "SubComponent1" . + . + . + "interlab16device1" . + . + . + . + . + . diff --git a/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld new file mode 100644 index 0000000..ac1c076 --- /dev/null +++ b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld @@ -0,0 +1,74 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040", + "@type" : "sbol:Component", + "description" : "TetR repressible promoter", + "displayId" : "BBa_R0040", + "hasNamespace" : "https://synbiohub.org/public/igem", + "hasSequence" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "name" : "pTetR", + "role" : "SO:0000167", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "@type" : "sbol:Sequence", + "description" : "pTetR sequence", + "displayId" : "BBa_R0040_Sequence1", + "elements" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence1" + }, { + "@id" : "https://synbiohub.org/public/igem/cs1", + "@type" : "sbol:CombinatorialDerivation", + "displayId" : "cs1", + "hasNamespace" : "https://synbiohub.org/public/igem", + "input" : "http://sbolstandard.org/template" + } ], + "@context" : { + "hasSequence" : { + "@id" : "http://sbols.org/v3#hasSequence", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "input" : { + "@id" : "http://sbols.org/v3#input", + "@type" : "@id" + }, + "encoding" : { + "@id" : "http://sbols.org/v3#encoding", + "@type" : "@id" + }, + "elements" : { + "@id" : "http://sbols.org/v3#elements" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld_expanded b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld_expanded new file mode 100644 index 0000000..3acc11c --- /dev/null +++ b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.jsonld_expanded @@ -0,0 +1,58 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040", + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000167" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "TetR repressible promoter" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "pTetR" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_R0040" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "pTetR sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_R0040_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +}, { + "@id" : "https://synbiohub.org/public/igem/cs1", + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#input" : [ { + "@id" : "http://sbolstandard.org/template" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "cs1" + } ], + "@type" : [ "http://sbols.org/v3#CombinatorialDerivation" ] +} ] diff --git a/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.nt b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.nt new file mode 100644 index 0000000..7a1edd3 --- /dev/null +++ b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.nt @@ -0,0 +1,19 @@ + . + . + "TetR repressible promoter" . + "pTetR" . + . + . + "BBa_R0040" . + . + . + . + "cs1" . + . + . + "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" . + "pTetR sequence" . + "Sequence1" . + . + "BBa_R0040_Sequence1" . + . diff --git a/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rdf b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rdf new file mode 100644 index 0000000..33a8cee --- /dev/null +++ b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rdf @@ -0,0 +1,37 @@ + + + + + + + TetR repressible promoter + pTetR + + + BBa_R0040 + + + + tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac + pTetR sequence + Sequence1 + + BBa_R0040_Sequence1 + + + + + cs1 + + diff --git a/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rj b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rj new file mode 100644 index 0000000..43d3d43 --- /dev/null +++ b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.rj @@ -0,0 +1,105 @@ +{ + "https://synbiohub.org/public/igem/BBa_R0040" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_R0040" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000167" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "pTetR" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "TetR repressible promoter" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/cs1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "cs1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#CombinatorialDerivation" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#input" : [ { + "type" : "uri" , + "value" : "http://sbolstandard.org/template" + } + ] + } + , + "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_R0040_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "pTetR sequence" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.ttl b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.ttl new file mode 100644 index 0000000..9fb1159 --- /dev/null +++ b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation.ttl @@ -0,0 +1,32 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:BBa_R0040 a sbol:Component ; + sbol:description "TetR repressible promoter" ; + sbol:displayId "BBa_R0040" ; + sbol:hasNamespace ; + sbol:hasSequence :BBa_R0040_Sequence1 ; + sbol:name "pTetR" ; + sbol:role SO:0000167 ; + sbol:type SBO:0000251 . + +:cs1 a sbol:CombinatorialDerivation ; + sbol:displayId "cs1" ; + sbol:hasNamespace ; + sbol:input . + +:BBa_R0040_Sequence1 a sbol:Sequence ; + sbol:description "pTetR sequence" ; + sbol:displayId "BBa_R0040_Sequence1" ; + sbol:elements "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . diff --git a/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation_ordered.nt b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation_ordered.nt new file mode 100644 index 0000000..24e36b5 --- /dev/null +++ b/libSBOLj3/output/entity_additional/combinatorialderivation/combinatorialderivation_ordered.nt @@ -0,0 +1,19 @@ + "TetR repressible promoter" . + "BBa_R0040" . + . + . + "pTetR" . + . + . + . + "pTetR sequence" . + "BBa_R0040_Sequence1" . + "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" . + . + . + "Sequence1" . + . + "cs1" . + . + . + . diff --git a/libSBOLj3/output/entity_additional/component/component.jsonld b/libSBOLj3/output/entity_additional/component/component.jsonld new file mode 100644 index 0000000..c891bc7 --- /dev/null +++ b/libSBOLj3/output/entity_additional/component/component.jsonld @@ -0,0 +1,41 @@ +{ + "@id" : "https://synbiohub.org/public/igem/BBa_F2620", + "@type" : "sbol:Component", + "description" : "PoPS Receiver", + "displayId" : "BBa_F2620", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "BBa_F2620", + "role" : "SO:0000704", + "type" : "SBO:0000251", + "@context" : { + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/component/component.jsonld_expanded b/libSBOLj3/output/entity_additional/component/component.jsonld_expanded new file mode 100644 index 0000000..52895b0 --- /dev/null +++ b/libSBOLj3/output/entity_additional/component/component.jsonld_expanded @@ -0,0 +1,22 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/BBa_F2620", + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000704" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "PoPS Receiver" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "BBa_F2620" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_F2620" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +} ] diff --git a/libSBOLj3/output/entity_additional/component/component.nt b/libSBOLj3/output/entity_additional/component/component.nt new file mode 100644 index 0000000..8ce0627 --- /dev/null +++ b/libSBOLj3/output/entity_additional/component/component.nt @@ -0,0 +1,7 @@ + . + "PoPS Receiver" . + "BBa_F2620" . + . + . + "BBa_F2620" . + . diff --git a/libSBOLj3/output/entity_additional/component/component.rdf b/libSBOLj3/output/entity_additional/component/component.rdf new file mode 100644 index 0000000..f91baf5 --- /dev/null +++ b/libSBOLj3/output/entity_additional/component/component.rdf @@ -0,0 +1,21 @@ + + + + PoPS Receiver + BBa_F2620 + + + BBa_F2620 + + diff --git a/libSBOLj3/output/entity_additional/component/component.rj b/libSBOLj3/output/entity_additional/component/component.rj new file mode 100644 index 0000000..33daf48 --- /dev/null +++ b/libSBOLj3/output/entity_additional/component/component.rj @@ -0,0 +1,39 @@ +{ + "https://synbiohub.org/public/igem/BBa_F2620" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_F2620" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000704" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "BBa_F2620" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "PoPS Receiver" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/component/component.ttl b/libSBOLj3/output/entity_additional/component/component.ttl new file mode 100644 index 0000000..1b684a0 --- /dev/null +++ b/libSBOLj3/output/entity_additional/component/component.ttl @@ -0,0 +1,18 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:BBa_F2620 a sbol:Component ; + sbol:description "PoPS Receiver" ; + sbol:displayId "BBa_F2620" ; + sbol:hasNamespace ; + sbol:name "BBa_F2620" ; + sbol:role SO:0000704 ; + sbol:type SBO:0000251 . diff --git a/libSBOLj3/output/entity_additional/component/component_ordered.nt b/libSBOLj3/output/entity_additional/component/component_ordered.nt new file mode 100644 index 0000000..af41ee2 --- /dev/null +++ b/libSBOLj3/output/entity_additional/component/component_ordered.nt @@ -0,0 +1,7 @@ + "PoPS Receiver" . + "BBa_F2620" . + . + "BBa_F2620" . + . + . + . diff --git a/libSBOLj3/output/entity_additional/constraint/constraint.jsonld b/libSBOLj3/output/entity_additional/constraint/constraint.jsonld new file mode 100644 index 0000000..4dd19a7 --- /dev/null +++ b/libSBOLj3/output/entity_additional/constraint/constraint.jsonld @@ -0,0 +1,126 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504", + "@type" : "sbol:Component", + "description" : "Screening plasmid intermediate", + "displayId" : "i13504", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "i13504", + "role" : "SBO:0000251", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_system", + "@type" : "sbol:Component", + "displayId" : "i13504_system", + "hasFeature" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "i13504 system", + "role" : "SBO:0000289", + "type" : "SBO:0000241" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "instanceOf" : "https://synbiohub.org/public/igem/i13504" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1", + "@type" : "sbol:Component", + "displayId" : "interlab16device1", + "hasConstraint" : "https://synbiohub.org/public/igem/interlab16device1/Constraint1", + "hasFeature" : [ "https://synbiohub.org/public/igem/interlab16device1/SubComponent2", "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" ], + "hasNamespace" : "https://synbiohub.org/public/igem", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", + "@type" : "sbol:ComponentReference", + "displayId" : "ComponentReference1", + "inChildOf" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "refersTo" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/Constraint1", + "@type" : "sbol:Constraint", + "displayId" : "Constraint1", + "object" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", + "restriction" : "sbol:meets", + "subject" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent2" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "instanceOf" : "https://synbiohub.org/public/igem/i13504_system" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent2", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent2", + "instanceOf" : "https://synbiohub.org/public/igem/j23101" + }, { + "@id" : "https://synbiohub.org/public/igem/j23101", + "@type" : "sbol:Component", + "displayId" : "j23101", + "hasNamespace" : "https://synbiohub.org/public/igem", + "type" : "SBO:0000251" + } ], + "@context" : { + "object" : { + "@id" : "http://sbols.org/v3#object", + "@type" : "@id" + }, + "subject" : { + "@id" : "http://sbols.org/v3#subject", + "@type" : "@id" + }, + "restriction" : { + "@id" : "http://sbols.org/v3#restriction", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "hasConstraint" : { + "@id" : "http://sbols.org/v3#hasConstraint", + "@type" : "@id" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "inChildOf" : { + "@id" : "http://sbols.org/v3#inChildOf", + "@type" : "@id" + }, + "refersTo" : { + "@id" : "http://sbols.org/v3#refersTo", + "@type" : "@id" + }, + "instanceOf" : { + "@id" : "http://sbols.org/v3#instanceOf", + "@type" : "@id" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/constraint/constraint.jsonld_expanded b/libSBOLj3/output/entity_additional/constraint/constraint.jsonld_expanded new file mode 100644 index 0000000..f363275 --- /dev/null +++ b/libSBOLj3/output/entity_additional/constraint/constraint.jsonld_expanded @@ -0,0 +1,131 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/i13504", + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "Screening plasmid intermediate" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "i13504" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_system", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000289" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "i13504 system" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000241" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_system" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1", + "http://sbols.org/v3#hasConstraint" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/Constraint1" + } ], + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent2" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "interlab16device1" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", + "http://sbols.org/v3#inChildOf" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } ], + "http://sbols.org/v3#refersTo" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "ComponentReference1" + } ], + "@type" : [ "http://sbols.org/v3#ComponentReference" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/Constraint1", + "http://sbols.org/v3#object" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + } ], + "http://sbols.org/v3#subject" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent2" + } ], + "http://sbols.org/v3#restriction" : [ { + "@id" : "http://sbols.org/v3#meets" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Constraint1" + } ], + "@type" : [ "http://sbols.org/v3#Constraint" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent2", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/j23101" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent2" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://synbiohub.org/public/igem/j23101", + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "j23101" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +} ] diff --git a/libSBOLj3/output/entity_additional/constraint/constraint.nt b/libSBOLj3/output/entity_additional/constraint/constraint.nt new file mode 100644 index 0000000..8d16315 --- /dev/null +++ b/libSBOLj3/output/entity_additional/constraint/constraint.nt @@ -0,0 +1,44 @@ + . + . + . + "Constraint1" . + . + . + "Screening plasmid intermediate" . + "i13504" . + . + . + "i13504" . + . + . + . + . + . + . + . + "interlab16device1" . + . + . + . + "ComponentReference1" . + . + . + "SubComponent1" . + . + . + "SubComponent1" . + . + . + . + "j23101" . + . + . + . + "i13504 system" . + . + . + "i13504_system" . + . + . + "SubComponent2" . + . diff --git a/libSBOLj3/output/entity_additional/constraint/constraint.rdf b/libSBOLj3/output/entity_additional/constraint/constraint.rdf new file mode 100644 index 0000000..5fb16d4 --- /dev/null +++ b/libSBOLj3/output/entity_additional/constraint/constraint.rdf @@ -0,0 +1,75 @@ + + + + + + + + SubComponent1 + + + + i13504 system + + + i13504_system + + + + Screening plasmid intermediate + i13504 + + + i13504 + + + + + + + + + + SubComponent1 + + + + ComponentReference1 + + + + + + + + SubComponent2 + + + + Constraint1 + + + + + + + + interlab16device1 + + + + + j23101 + + diff --git a/libSBOLj3/output/entity_additional/constraint/constraint.rj b/libSBOLj3/output/entity_additional/constraint/constraint.rj new file mode 100644 index 0000000..ea1119e --- /dev/null +++ b/libSBOLj3/output/entity_additional/constraint/constraint.rj @@ -0,0 +1,246 @@ +{ + "https://synbiohub.org/public/igem/i13504_system" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_system" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000289" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "i13504 system" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000241" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "i13504" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "Screening plasmid intermediate" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "interlab16device1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasConstraint" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/Constraint1" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } + , { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + } + , { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent2" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "ComponentReference1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#ComponentReference" + } + ] , + "http://sbols.org/v3#inChildOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } + ] , + "http://sbols.org/v3#refersTo" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/Constraint1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Constraint1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Constraint" + } + ] , + "http://sbols.org/v3#subject" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent2" + } + ] , + "http://sbols.org/v3#restriction" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#meets" + } + ] , + "http://sbols.org/v3#object" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + } + ] + } + , + "https://synbiohub.org/public/igem/j23101" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "j23101" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504_system/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/SubComponent2" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent2" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/j23101" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/constraint/constraint.ttl b/libSBOLj3/output/entity_additional/constraint/constraint.ttl new file mode 100644 index 0000000..a7a4bd2 --- /dev/null +++ b/libSBOLj3/output/entity_additional/constraint/constraint.ttl @@ -0,0 +1,66 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + + + a sbol:Constraint ; + sbol:displayId "Constraint1" ; + sbol:object ; + sbol:restriction sbol:meets ; + sbol:subject . + +:i13504 a sbol:Component ; + sbol:description "Screening plasmid intermediate" ; + sbol:displayId "i13504" ; + sbol:hasNamespace ; + sbol:name "i13504" ; + sbol:role SBO:0000251 ; + sbol:type SBO:0000251 . + +:interlab16device1 a sbol:Component ; + sbol:displayId "interlab16device1" ; + sbol:hasConstraint ; + sbol:hasFeature , , ; + sbol:hasNamespace ; + sbol:type SBO:0000251 . + + + a sbol:ComponentReference ; + sbol:displayId "ComponentReference1" ; + sbol:inChildOf ; + sbol:refersTo . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:instanceOf :i13504_system . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:instanceOf :i13504 . + +:j23101 a sbol:Component ; + sbol:displayId "j23101" ; + sbol:hasNamespace ; + sbol:type SBO:0000251 . + +:i13504_system a sbol:Component ; + sbol:displayId "i13504_system" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:name "i13504 system" ; + sbol:role SBO:0000289 ; + sbol:type SBO:0000241 . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent2" ; + sbol:instanceOf :j23101 . diff --git a/libSBOLj3/output/entity_additional/constraint/constraint_ordered.nt b/libSBOLj3/output/entity_additional/constraint/constraint_ordered.nt new file mode 100644 index 0000000..d5ecfff --- /dev/null +++ b/libSBOLj3/output/entity_additional/constraint/constraint_ordered.nt @@ -0,0 +1,44 @@ + "Screening plasmid intermediate" . + "i13504" . + . + "i13504" . + . + . + . + "SubComponent1" . + . + . + "i13504_system" . + . + . + "i13504 system" . + . + . + . + "ComponentReference1" . + . + . + . + "Constraint1" . + . + . + . + . + "SubComponent1" . + . + . + "SubComponent2" . + . + . + "interlab16device1" . + . + . + . + . + . + . + . + "j23101" . + . + . + . diff --git a/libSBOLj3/output/entity_additional/cut/cut.jsonld b/libSBOLj3/output/entity_additional/cut/cut.jsonld new file mode 100644 index 0000000..a6ab7ad --- /dev/null +++ b/libSBOLj3/output/entity_additional/cut/cut.jsonld @@ -0,0 +1,87 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040", + "@type" : "sbol:Component", + "description" : "TetR repressible promoter", + "displayId" : "BBa_R0040", + "hasFeature" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1", + "hasNamespace" : "https://synbiohub.org/public/igem", + "hasSequence" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "name" : "pTetR", + "role" : "SO:0000167", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1", + "@type" : "sbol:SequenceFeature", + "displayId" : "SequenceFeature1", + "hasLocation" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1/Cut1" + }, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1/Cut1", + "@type" : "sbol:Cut", + "at" : "5", + "displayId" : "Cut1", + "hasSequence" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + }, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "@type" : "sbol:Sequence", + "description" : "pTetR sequence", + "displayId" : "BBa_R0040_Sequence1", + "elements" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence1" + } ], + "@context" : { + "at" : { + "@id" : "http://sbols.org/v3#at" + }, + "hasSequence" : { + "@id" : "http://sbols.org/v3#hasSequence", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasLocation" : { + "@id" : "http://sbols.org/v3#hasLocation", + "@type" : "@id" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "encoding" : { + "@id" : "http://sbols.org/v3#encoding", + "@type" : "@id" + }, + "elements" : { + "@id" : "http://sbols.org/v3#elements" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/cut/cut.jsonld_expanded b/libSBOLj3/output/entity_additional/cut/cut.jsonld_expanded new file mode 100644 index 0000000..22eba56 --- /dev/null +++ b/libSBOLj3/output/entity_additional/cut/cut.jsonld_expanded @@ -0,0 +1,70 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000167" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "TetR repressible promoter" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "pTetR" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_R0040" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1", + "http://sbols.org/v3#hasLocation" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1/Cut1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SequenceFeature1" + } ], + "@type" : [ "http://sbols.org/v3#SequenceFeature" ] +}, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1/Cut1", + "http://sbols.org/v3#at" : [ { + "@value" : "5" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Cut1" + } ], + "@type" : [ "http://sbols.org/v3#Cut" ] +}, { + "@id" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "pTetR sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "BBa_R0040_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +} ] diff --git a/libSBOLj3/output/entity_additional/cut/cut.nt b/libSBOLj3/output/entity_additional/cut/cut.nt new file mode 100644 index 0000000..1483a60 --- /dev/null +++ b/libSBOLj3/output/entity_additional/cut/cut.nt @@ -0,0 +1,23 @@ + "5" . + . + "Cut1" . + . + . + "SequenceFeature1" . + . + . + . + . + "TetR repressible promoter" . + "pTetR" . + . + . + "BBa_R0040" . + . + . + "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" . + "pTetR sequence" . + "Sequence1" . + . + "BBa_R0040_Sequence1" . + . diff --git a/libSBOLj3/output/entity_additional/cut/cut.rdf b/libSBOLj3/output/entity_additional/cut/cut.rdf new file mode 100644 index 0000000..4dc1f0e --- /dev/null +++ b/libSBOLj3/output/entity_additional/cut/cut.rdf @@ -0,0 +1,46 @@ + + + + + + + 5 + + + + Cut1 + + + SequenceFeature1 + + + + + + + TetR repressible promoter + pTetR + + + BBa_R0040 + + + + tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac + pTetR sequence + Sequence1 + + BBa_R0040_Sequence1 + + diff --git a/libSBOLj3/output/entity_additional/cut/cut.rj b/libSBOLj3/output/entity_additional/cut/cut.rj new file mode 100644 index 0000000..d9baa8c --- /dev/null +++ b/libSBOLj3/output/entity_additional/cut/cut.rj @@ -0,0 +1,128 @@ +{ + "https://synbiohub.org/public/igem/BBa_R0040" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_R0040" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000167" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "pTetR" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "TetR repressible promoter" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1/Cut1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Cut1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Cut" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" + } + ] , + "http://sbols.org/v3#at" : [ { + "type" : "literal" , + "value" : "5" + } + ] + } + , + "https://synbiohub.org/public/igem/BBa_R0040_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "BBa_R0040_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "pTetR sequence" + } + ] + } + , + "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SequenceFeature1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SequenceFeature" + } + ] , + "http://sbols.org/v3#hasLocation" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/BBa_R0040/SequenceFeature1/Cut1" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/cut/cut.ttl b/libSBOLj3/output/entity_additional/cut/cut.ttl new file mode 100644 index 0000000..dcb8b6f --- /dev/null +++ b/libSBOLj3/output/entity_additional/cut/cut.ttl @@ -0,0 +1,39 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + + + a sbol:Cut ; + sbol:at "5" ; + sbol:displayId "Cut1" ; + sbol:hasSequence :BBa_R0040_Sequence1 . + + + a sbol:SequenceFeature ; + sbol:displayId "SequenceFeature1" ; + sbol:hasLocation . + +:BBa_R0040 a sbol:Component ; + sbol:description "TetR repressible promoter" ; + sbol:displayId "BBa_R0040" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:hasSequence :BBa_R0040_Sequence1 ; + sbol:name "pTetR" ; + sbol:role SO:0000167 ; + sbol:type SBO:0000251 . + +:BBa_R0040_Sequence1 a sbol:Sequence ; + sbol:description "pTetR sequence" ; + sbol:displayId "BBa_R0040_Sequence1" ; + sbol:elements "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . diff --git a/libSBOLj3/output/entity_additional/cut/cut_ordered.nt b/libSBOLj3/output/entity_additional/cut/cut_ordered.nt new file mode 100644 index 0000000..ef070a1 --- /dev/null +++ b/libSBOLj3/output/entity_additional/cut/cut_ordered.nt @@ -0,0 +1,23 @@ + "5" . + "Cut1" . + . + . + "SequenceFeature1" . + . + . + "TetR repressible promoter" . + "BBa_R0040" . + . + . + . + "pTetR" . + . + . + . + "pTetR sequence" . + "BBa_R0040_Sequence1" . + "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac" . + . + . + "Sequence1" . + . diff --git a/libSBOLj3/output/entity_additional/experiment/experiment.jsonld b/libSBOLj3/output/entity_additional/experiment/experiment.jsonld new file mode 100644 index 0000000..4c0acb9 --- /dev/null +++ b/libSBOLj3/output/entity_additional/experiment/experiment.jsonld @@ -0,0 +1,46 @@ +{ + "@graph" : [ { + "@id" : "https://sbolstandard.org/examples/attachment1", + "@type" : "sbol:Attachment", + "displayId" : "attachment1", + "hasNamespace" : "https://sbolstandard.org/examples", + "source" : "https://sbolstandard.org/attachment1" + }, { + "@id" : "https://sbolstandard.org/examples/attachment2", + "@type" : "sbol:Attachment", + "displayId" : "attachment2", + "hasNamespace" : "https://sbolstandard.org/examples", + "source" : "https://sbolstandard.org/attachment2" + }, { + "@id" : "https://sbolstandard.org/examples/exp1", + "@type" : "sbol:Experiment", + "displayId" : "exp1", + "hasNamespace" : "https://sbolstandard.org/examples", + "member" : [ "https://sbolstandard.org/examples/attachment2", "https://sbolstandard.org/examples/attachment1" ] + } ], + "@context" : { + "source" : { + "@id" : "http://sbols.org/v3#source", + "@type" : "@id" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "member" : { + "@id" : "http://sbols.org/v3#member", + "@type" : "@id" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/experiment/experiment.jsonld_expanded b/libSBOLj3/output/entity_additional/experiment/experiment.jsonld_expanded new file mode 100644 index 0000000..14f00ae --- /dev/null +++ b/libSBOLj3/output/entity_additional/experiment/experiment.jsonld_expanded @@ -0,0 +1,39 @@ +[ { + "@id" : "https://sbolstandard.org/examples/attachment1", + "http://sbols.org/v3#source" : [ { + "@id" : "https://sbolstandard.org/attachment1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "attachment1" + } ], + "@type" : [ "http://sbols.org/v3#Attachment" ] +}, { + "@id" : "https://sbolstandard.org/examples/attachment2", + "http://sbols.org/v3#source" : [ { + "@id" : "https://sbolstandard.org/attachment2" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "attachment2" + } ], + "@type" : [ "http://sbols.org/v3#Attachment" ] +}, { + "@id" : "https://sbolstandard.org/examples/exp1", + "http://sbols.org/v3#member" : [ { + "@id" : "https://sbolstandard.org/examples/attachment2" + }, { + "@id" : "https://sbolstandard.org/examples/attachment1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "exp1" + } ], + "@type" : [ "http://sbols.org/v3#Experiment" ] +} ] diff --git a/libSBOLj3/output/entity_additional/experiment/experiment.nt b/libSBOLj3/output/entity_additional/experiment/experiment.nt new file mode 100644 index 0000000..c64692f --- /dev/null +++ b/libSBOLj3/output/entity_additional/experiment/experiment.nt @@ -0,0 +1,13 @@ + . + . + "attachment1" . + . + . + . + . + "exp1" . + . + . + . + "attachment2" . + . diff --git a/libSBOLj3/output/entity_additional/experiment/experiment.rdf b/libSBOLj3/output/entity_additional/experiment/experiment.rdf new file mode 100644 index 0000000..c24ffee --- /dev/null +++ b/libSBOLj3/output/entity_additional/experiment/experiment.rdf @@ -0,0 +1,29 @@ + + + + + attachment2 + + + + + attachment1 + + + + + + exp1 + + diff --git a/libSBOLj3/output/entity_additional/experiment/experiment.rj b/libSBOLj3/output/entity_additional/experiment/experiment.rj new file mode 100644 index 0000000..2e41136 --- /dev/null +++ b/libSBOLj3/output/entity_additional/experiment/experiment.rj @@ -0,0 +1,74 @@ +{ + "https://sbolstandard.org/examples/exp1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "exp1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Experiment" + } + ] , + "http://sbols.org/v3#member" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/attachment2" + } + , { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/attachment1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] + } + , + "https://sbolstandard.org/examples/attachment2" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "attachment2" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Attachment" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#source" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/attachment2" + } + ] + } + , + "https://sbolstandard.org/examples/attachment1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "attachment1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Attachment" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#source" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/attachment1" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/experiment/experiment.ttl b/libSBOLj3/output/entity_additional/experiment/experiment.ttl new file mode 100644 index 0000000..cd469e3 --- /dev/null +++ b/libSBOLj3/output/entity_additional/experiment/experiment.ttl @@ -0,0 +1,25 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:attachment1 a sbol:Attachment ; + sbol:displayId "attachment1" ; + sbol:hasNamespace ; + sbol:source . + +:exp1 a sbol:Experiment ; + sbol:displayId "exp1" ; + sbol:hasNamespace ; + sbol:member :attachment2 , :attachment1 . + +:attachment2 a sbol:Attachment ; + sbol:displayId "attachment2" ; + sbol:hasNamespace ; + sbol:source . diff --git a/libSBOLj3/output/entity_additional/experiment/experiment_ordered.nt b/libSBOLj3/output/entity_additional/experiment/experiment_ordered.nt new file mode 100644 index 0000000..735f613 --- /dev/null +++ b/libSBOLj3/output/entity_additional/experiment/experiment_ordered.nt @@ -0,0 +1,13 @@ + "attachment1" . + . + . + . + "attachment2" . + . + . + . + "exp1" . + . + . + . + . diff --git a/libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld new file mode 100644 index 0000000..505acd9 --- /dev/null +++ b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld @@ -0,0 +1,51 @@ +{ + "@graph" : [ { + "@id" : "https://sbolstandard.org/examples/interlab16device1", + "@type" : "sbol:Component", + "displayId" : "interlab16device1", + "hasFeature" : [ "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined2", "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined1" ], + "hasNamespace" : "https://sbolstandard.org/examples", + "type" : "SBO:0000241" + }, { + "@id" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined1", + "@type" : "sbol:ExternallyDefined", + "definition" : "http://uniprot.org/gfp", + "displayId" : "ExternallyDefined1", + "type" : "SBO:0000252" + }, { + "@id" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined2", + "@type" : "sbol:ExternallyDefined", + "definition" : "http://uniprot.org/rfp", + "displayId" : "ExternallyDefined2", + "type" : "SBO:0000252" + } ], + "@context" : { + "definition" : { + "@id" : "http://sbols.org/v3#definition", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld_expanded b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld_expanded new file mode 100644 index 0000000..36f7a9b --- /dev/null +++ b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.jsonld_expanded @@ -0,0 +1,42 @@ +[ { + "@id" : "https://sbolstandard.org/examples/interlab16device1", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined2" + }, { + "@id" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000241" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "interlab16device1" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined1", + "http://sbols.org/v3#definition" : [ { + "@id" : "http://uniprot.org/gfp" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000252" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "ExternallyDefined1" + } ], + "@type" : [ "http://sbols.org/v3#ExternallyDefined" ] +}, { + "@id" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined2", + "http://sbols.org/v3#definition" : [ { + "@id" : "http://uniprot.org/rfp" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000252" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "ExternallyDefined2" + } ], + "@type" : [ "http://sbols.org/v3#ExternallyDefined" ] +} ] diff --git a/libSBOLj3/output/entity_additional/externallydefined/externallydefined.nt b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.nt new file mode 100644 index 0000000..841d4c5 --- /dev/null +++ b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.nt @@ -0,0 +1,14 @@ + . + . + "ExternallyDefined2" . + . + . + . + "ExternallyDefined1" . + . + . + . + . + . + "interlab16device1" . + . diff --git a/libSBOLj3/output/entity_additional/externallydefined/externallydefined.rdf b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.rdf new file mode 100644 index 0000000..7b3325b --- /dev/null +++ b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.rdf @@ -0,0 +1,32 @@ + + + + + + + ExternallyDefined2 + + + + + + + ExternallyDefined1 + + + + + interlab16device1 + + diff --git a/libSBOLj3/output/entity_additional/externallydefined/externallydefined.rj b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.rj new file mode 100644 index 0000000..75f62a5 --- /dev/null +++ b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.rj @@ -0,0 +1,79 @@ +{ + "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined2" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "ExternallyDefined2" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#ExternallyDefined" + } + ] , + "http://sbols.org/v3#definition" : [ { + "type" : "uri" , + "value" : "http://uniprot.org/rfp" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000252" + } + ] + } + , + "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "ExternallyDefined1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#ExternallyDefined" + } + ] , + "http://sbols.org/v3#definition" : [ { + "type" : "uri" , + "value" : "http://uniprot.org/gfp" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000252" + } + ] + } + , + "https://sbolstandard.org/examples/interlab16device1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "interlab16device1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined2" + } + , { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/interlab16device1/ExternallyDefined1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000241" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/externallydefined/externallydefined.ttl b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.ttl new file mode 100644 index 0000000..77e7706 --- /dev/null +++ b/libSBOLj3/output/entity_additional/externallydefined/externallydefined.ttl @@ -0,0 +1,28 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + + + a sbol:ExternallyDefined ; + sbol:definition ; + sbol:displayId "ExternallyDefined2" ; + sbol:type SBO:0000252 . + + + a sbol:ExternallyDefined ; + sbol:definition ; + sbol:displayId "ExternallyDefined1" ; + sbol:type SBO:0000252 . + +:interlab16device1 a sbol:Component ; + sbol:displayId "interlab16device1" ; + sbol:hasFeature , ; + sbol:hasNamespace ; + sbol:type SBO:0000241 . diff --git a/libSBOLj3/output/entity_additional/externallydefined/externallydefined_ordered.nt b/libSBOLj3/output/entity_additional/externallydefined/externallydefined_ordered.nt new file mode 100644 index 0000000..e3f4af6 --- /dev/null +++ b/libSBOLj3/output/entity_additional/externallydefined/externallydefined_ordered.nt @@ -0,0 +1,14 @@ + . + "ExternallyDefined1" . + . + . + . + "ExternallyDefined2" . + . + . + "interlab16device1" . + . + . + . + . + . diff --git a/libSBOLj3/output/entity_additional/interaction/interaction.jsonld b/libSBOLj3/output/entity_additional/interaction/interaction.jsonld new file mode 100644 index 0000000..9da2a26 --- /dev/null +++ b/libSBOLj3/output/entity_additional/interaction/interaction.jsonld @@ -0,0 +1,49 @@ +{ + "@graph" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system", + "@type" : "sbol:Component", + "displayId" : "i13504_system", + "hasInteraction" : "https://sbolstandard.org/examples/i13504_system/Interaction1", + "hasNamespace" : "https://sbolstandard.org/examples", + "name" : "i13504 system", + "role" : "SBO:0000289", + "type" : "SBO:0000251" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1", + "@type" : "sbol:Interaction", + "displayId" : "Interaction1", + "type" : "SBO:0000589" + } ], + "@context" : { + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasInteraction" : { + "@id" : "http://sbols.org/v3#hasInteraction", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/interaction/interaction.jsonld_expanded b/libSBOLj3/output/entity_additional/interaction/interaction.jsonld_expanded new file mode 100644 index 0000000..71f318b --- /dev/null +++ b/libSBOLj3/output/entity_additional/interaction/interaction.jsonld_expanded @@ -0,0 +1,31 @@ +[ { + "@id" : "https://sbolstandard.org/examples/i13504_system", + "http://sbols.org/v3#hasInteraction" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000289" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "i13504 system" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_system" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1", + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000589" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Interaction1" + } ], + "@type" : [ "http://sbols.org/v3#Interaction" ] +} ] diff --git a/libSBOLj3/output/entity_additional/interaction/interaction.nt b/libSBOLj3/output/entity_additional/interaction/interaction.nt new file mode 100644 index 0000000..3cadde0 --- /dev/null +++ b/libSBOLj3/output/entity_additional/interaction/interaction.nt @@ -0,0 +1,10 @@ + . + "Interaction1" . + . + . + . + "i13504 system" . + . + . + "i13504_system" . + . diff --git a/libSBOLj3/output/entity_additional/interaction/interaction.rdf b/libSBOLj3/output/entity_additional/interaction/interaction.rdf new file mode 100644 index 0000000..7c015f5 --- /dev/null +++ b/libSBOLj3/output/entity_additional/interaction/interaction.rdf @@ -0,0 +1,26 @@ + + + + + + Interaction1 + + + + i13504 system + + + i13504_system + + diff --git a/libSBOLj3/output/entity_additional/interaction/interaction.rj b/libSBOLj3/output/entity_additional/interaction/interaction.rj new file mode 100644 index 0000000..1ba0d38 --- /dev/null +++ b/libSBOLj3/output/entity_additional/interaction/interaction.rj @@ -0,0 +1,57 @@ +{ + "https://sbolstandard.org/examples/i13504_system" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_system" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000289" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "i13504 system" + } + ] , + "http://sbols.org/v3#hasInteraction" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/Interaction1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/Interaction1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Interaction1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Interaction" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000589" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/interaction/interaction.ttl b/libSBOLj3/output/entity_additional/interaction/interaction.ttl new file mode 100644 index 0000000..8b55c12 --- /dev/null +++ b/libSBOLj3/output/entity_additional/interaction/interaction.ttl @@ -0,0 +1,23 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + + + a sbol:Interaction ; + sbol:displayId "Interaction1" ; + sbol:type SBO:0000589 . + +:i13504_system a sbol:Component ; + sbol:displayId "i13504_system" ; + sbol:hasInteraction ; + sbol:hasNamespace ; + sbol:name "i13504 system" ; + sbol:role SBO:0000289 ; + sbol:type SBO:0000251 . diff --git a/libSBOLj3/output/entity_additional/interaction/interaction_ordered.nt b/libSBOLj3/output/entity_additional/interaction/interaction_ordered.nt new file mode 100644 index 0000000..b085fa1 --- /dev/null +++ b/libSBOLj3/output/entity_additional/interaction/interaction_ordered.nt @@ -0,0 +1,10 @@ + "Interaction1" . + . + . + "i13504_system" . + . + . + "i13504 system" . + . + . + . diff --git a/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld new file mode 100644 index 0000000..3a7118a --- /dev/null +++ b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld @@ -0,0 +1,49 @@ +{ + "@graph" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system", + "@type" : "sbol:Component", + "displayId" : "i13504_system", + "hasFeature" : "https://sbolstandard.org/examples/i13504_system/LocalSubComponent1", + "hasNamespace" : "https://sbolstandard.org/examples", + "name" : "i13504 system", + "role" : "SBO:0000289", + "type" : "SBO:0000251" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/LocalSubComponent1", + "@type" : "sbol:LocalSubComponent", + "displayId" : "LocalSubComponent1", + "type" : "SBO:0000251" + } ], + "@context" : { + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld_expanded b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld_expanded new file mode 100644 index 0000000..c06a69c --- /dev/null +++ b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.jsonld_expanded @@ -0,0 +1,31 @@ +[ { + "@id" : "https://sbolstandard.org/examples/i13504_system", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/LocalSubComponent1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000289" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "i13504 system" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_system" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/LocalSubComponent1", + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "LocalSubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#LocalSubComponent" ] +} ] diff --git a/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.nt b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.nt new file mode 100644 index 0000000..f934cdb --- /dev/null +++ b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.nt @@ -0,0 +1,10 @@ + . + "LocalSubComponent1" . + . + . + . + "i13504 system" . + . + . + "i13504_system" . + . diff --git a/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rdf b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rdf new file mode 100644 index 0000000..2b94acc --- /dev/null +++ b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rdf @@ -0,0 +1,26 @@ + + + + + + LocalSubComponent1 + + + + i13504 system + + + i13504_system + + diff --git a/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rj b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rj new file mode 100644 index 0000000..04726f2 --- /dev/null +++ b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.rj @@ -0,0 +1,57 @@ +{ + "https://sbolstandard.org/examples/i13504_system" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_system" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000289" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/LocalSubComponent1" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "i13504 system" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/LocalSubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "LocalSubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#LocalSubComponent" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.ttl b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.ttl new file mode 100644 index 0000000..622a2e9 --- /dev/null +++ b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent.ttl @@ -0,0 +1,23 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + + + a sbol:LocalSubComponent ; + sbol:displayId "LocalSubComponent1" ; + sbol:type SBO:0000251 . + +:i13504_system a sbol:Component ; + sbol:displayId "i13504_system" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:name "i13504 system" ; + sbol:role SBO:0000289 ; + sbol:type SBO:0000251 . diff --git a/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent_ordered.nt b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent_ordered.nt new file mode 100644 index 0000000..9f154f2 --- /dev/null +++ b/libSBOLj3/output/entity_additional/localsubcomponent/localsubcomponent_ordered.nt @@ -0,0 +1,10 @@ + "LocalSubComponent1" . + . + . + "i13504_system" . + . + . + "i13504 system" . + . + . + . diff --git a/libSBOLj3/output/entity_additional/participation/participation.jsonld b/libSBOLj3/output/entity_additional/participation/participation.jsonld new file mode 100644 index 0000000..935da83 --- /dev/null +++ b/libSBOLj3/output/entity_additional/participation/participation.jsonld @@ -0,0 +1,190 @@ +{ + "@graph" : [ { + "@id" : "https://sbolstandard.org/examples/E0040", + "@type" : "sbol:Component", + "description" : "gfp coding sequence", + "displayId" : "E0040", + "hasNamespace" : "https://sbolstandard.org/examples", + "hasSequence" : "https://sbolstandard.org/examples/E0040_Sequence1", + "name" : "gfp", + "role" : "SO:0000316", + "type" : "SBO:0000251" + }, { + "@id" : "https://sbolstandard.org/examples/E0040_Sequence1", + "@type" : "sbol:Sequence", + "description" : "gfp sequence", + "displayId" : "E0040_Sequence1", + "elements" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://sbolstandard.org/examples", + "name" : "Sequence1" + }, { + "@id" : "https://sbolstandard.org/examples/GFP_protein", + "@type" : "sbol:Component", + "description" : "GFP", + "displayId" : "GFP_protein", + "hasNamespace" : "https://sbolstandard.org/examples", + "name" : "GFP", + "type" : "SBO:0000252" + }, { + "@id" : "https://sbolstandard.org/examples/i13504", + "@type" : "sbol:Component", + "displayId" : "i13504", + "hasFeature" : "https://sbolstandard.org/examples/i13504/SubComponent1", + "hasNamespace" : "https://sbolstandard.org/examples", + "hasSequence" : "https://sbolstandard.org/examples/i13504_Sequence1", + "type" : "SBO:0000251" + }, { + "@id" : "https://sbolstandard.org/examples/i13504/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "hasLocation" : "https://sbolstandard.org/examples/i13504/SubComponent1/Range1", + "instanceOf" : "https://sbolstandard.org/examples/E0040", + "orientation" : "SO:0001030" + }, { + "@id" : "https://sbolstandard.org/examples/i13504/SubComponent1/Range1", + "@type" : "sbol:Range", + "displayId" : "Range1", + "end" : "719", + "hasSequence" : "https://sbolstandard.org/examples/i13504_Sequence1", + "orientation" : "SO:0001030", + "start" : "1" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_Sequence1", + "@type" : "sbol:Sequence", + "description" : "null sequence", + "displayId" : "i13504_Sequence1", + "elements" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://sbolstandard.org/examples", + "name" : "Sequence1" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system", + "@type" : "sbol:Component", + "displayId" : "i13504_system", + "hasFeature" : [ "https://sbolstandard.org/examples/i13504_system/SubComponent2", "https://sbolstandard.org/examples/i13504_system/SubComponent1", "https://sbolstandard.org/examples/i13504_system/ComponentReference1" ], + "hasInteraction" : "https://sbolstandard.org/examples/i13504_system/Interaction1", + "hasNamespace" : "https://sbolstandard.org/examples", + "name" : "i13504 system", + "role" : "SBO:0000289", + "type" : "SBO:0000251" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/ComponentReference1", + "@type" : "sbol:ComponentReference", + "displayId" : "ComponentReference1", + "inChildOf" : "https://sbolstandard.org/examples/i13504_system/SubComponent1", + "refersTo" : "https://sbolstandard.org/examples/i13504/SubComponent1" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1", + "@type" : "sbol:Interaction", + "displayId" : "Interaction1", + "hasParticipation" : [ "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation2", "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation1" ], + "type" : "SBO:0000589" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation1", + "@type" : "sbol:Participation", + "displayId" : "Participation1", + "participant" : "https://sbolstandard.org/examples/i13504_system/ComponentReference1", + "role" : "SBO:0000645" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation2", + "@type" : "sbol:Participation", + "displayId" : "Participation2", + "participant" : "https://sbolstandard.org/examples/i13504_system/SubComponent2", + "role" : "SBO:0000011" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "instanceOf" : "https://sbolstandard.org/examples/i13504" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent2", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent2", + "instanceOf" : "https://sbolstandard.org/examples/GFP_protein" + } ], + "@context" : { + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "inChildOf" : { + "@id" : "http://sbols.org/v3#inChildOf", + "@type" : "@id" + }, + "refersTo" : { + "@id" : "http://sbols.org/v3#refersTo", + "@type" : "@id" + }, + "hasLocation" : { + "@id" : "http://sbols.org/v3#hasLocation", + "@type" : "@id" + }, + "orientation" : { + "@id" : "http://sbols.org/v3#orientation", + "@type" : "@id" + }, + "instanceOf" : { + "@id" : "http://sbols.org/v3#instanceOf", + "@type" : "@id" + }, + "encoding" : { + "@id" : "http://sbols.org/v3#encoding", + "@type" : "@id" + }, + "elements" : { + "@id" : "http://sbols.org/v3#elements" + }, + "participant" : { + "@id" : "http://sbols.org/v3#participant", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "hasInteraction" : { + "@id" : "http://sbols.org/v3#hasInteraction", + "@type" : "@id" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "hasSequence" : { + "@id" : "http://sbols.org/v3#hasSequence", + "@type" : "@id" + }, + "hasParticipation" : { + "@id" : "http://sbols.org/v3#hasParticipation", + "@type" : "@id" + }, + "end" : { + "@id" : "http://sbols.org/v3#end" + }, + "start" : { + "@id" : "http://sbols.org/v3#start" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/participation/participation.jsonld_expanded b/libSBOLj3/output/entity_additional/participation/participation.jsonld_expanded new file mode 100644 index 0000000..1c8e39f --- /dev/null +++ b/libSBOLj3/output/entity_additional/participation/participation.jsonld_expanded @@ -0,0 +1,232 @@ +[ { + "@id" : "https://sbolstandard.org/examples/E0040", + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://sbolstandard.org/examples/E0040_Sequence1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000316" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "gfp coding sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "gfp" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "E0040" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/E0040_Sequence1", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "gfp sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "E0040_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +}, { + "@id" : "https://sbolstandard.org/examples/GFP_protein", + "http://sbols.org/v3#description" : [ { + "@value" : "GFP" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "GFP" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000252" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "GFP_protein" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504", + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_Sequence1" + } ], + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://sbolstandard.org/examples/i13504/SubComponent1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504/SubComponent1", + "http://sbols.org/v3#hasLocation" : [ { + "@id" : "https://sbolstandard.org/examples/i13504/SubComponent1/Range1" + } ], + "http://sbols.org/v3#orientation" : [ { + "@id" : "https://identifiers.org/SO:0001030" + } ], + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://sbolstandard.org/examples/E0040" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504/SubComponent1/Range1", + "http://sbols.org/v3#orientation" : [ { + "@id" : "https://identifiers.org/SO:0001030" + } ], + "http://sbols.org/v3#end" : [ { + "@value" : "719" + } ], + "http://sbols.org/v3#start" : [ { + "@value" : "1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_Sequence1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Range1" + } ], + "@type" : [ "http://sbols.org/v3#Range" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_Sequence1", + "http://sbols.org/v3#elements" : [ { + "@value" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" + } ], + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "null sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system", + "http://sbols.org/v3#hasInteraction" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1" + } ], + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent2" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent1" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/ComponentReference1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000289" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "i13504 system" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_system" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/ComponentReference1", + "http://sbols.org/v3#inChildOf" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent1" + } ], + "http://sbols.org/v3#refersTo" : [ { + "@id" : "https://sbolstandard.org/examples/i13504/SubComponent1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "ComponentReference1" + } ], + "@type" : [ "http://sbols.org/v3#ComponentReference" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1", + "http://sbols.org/v3#hasParticipation" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation2" + }, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation1" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000589" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Interaction1" + } ], + "@type" : [ "http://sbols.org/v3#Interaction" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation1", + "http://sbols.org/v3#participant" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/ComponentReference1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000645" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Participation1" + } ], + "@type" : [ "http://sbols.org/v3#Participation" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation2", + "http://sbols.org/v3#participant" : [ { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent2" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000011" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Participation2" + } ], + "@type" : [ "http://sbols.org/v3#Participation" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent1", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://sbolstandard.org/examples/i13504" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://sbolstandard.org/examples/i13504_system/SubComponent2", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://sbolstandard.org/examples/GFP_protein" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent2" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +} ] diff --git a/libSBOLj3/output/entity_additional/participation/participation.nt b/libSBOLj3/output/entity_additional/participation/participation.nt new file mode 100644 index 0000000..4d1470c --- /dev/null +++ b/libSBOLj3/output/entity_additional/participation/participation.nt @@ -0,0 +1,78 @@ + "GFP" . + "GFP" . + . + . + "GFP_protein" . + . + . + . + "ComponentReference1" . + . + . + . + . + "SubComponent1" . + . + . + "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" . + "gfp sequence" . + "Sequence1" . + . + "E0040_Sequence1" . + . + . + "SubComponent1" . + . + . + . + "Participation2" . + . + . + . + . + "i13504 system" . + . + . + . + "i13504_system" . + . + . + . + . + . + . + "i13504" . + . + . + . + "gfp coding sequence" . + "gfp" . + . + . + "E0040" . + . + . + . + . + "Interaction1" . + . + . + "SubComponent2" . + . + . + "719" . + "1" . + . + "Range1" . + . + . + . + "Participation1" . + . + "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" . + . + "null sequence" . + "Sequence1" . + . + "i13504_Sequence1" . + . diff --git a/libSBOLj3/output/entity_additional/participation/participation.rdf b/libSBOLj3/output/entity_additional/participation/participation.rdf new file mode 100644 index 0000000..217a006 --- /dev/null +++ b/libSBOLj3/output/entity_additional/participation/participation.rdf @@ -0,0 +1,121 @@ + + + + + + + + + + + 719 + 1 + + + + Range1 + + + + + + + SubComponent1 + + + + + i13504 + + + GFP + GFP + + + GFP_protein + + + + + + + + + + SubComponent2 + + + + Participation2 + + + + + + + + + + SubComponent1 + + + + ComponentReference1 + + + + Participation1 + + + + Interaction1 + + + + + i13504 system + + + + i13504_system + + + + + + + + gfp coding sequence + gfp + + + E0040 + + + + atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa + gfp sequence + Sequence1 + + E0040_Sequence1 + + + atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa + + null sequence + Sequence1 + + i13504_Sequence1 + + diff --git a/libSBOLj3/output/entity_additional/participation/participation.rj b/libSBOLj3/output/entity_additional/participation/participation.rj new file mode 100644 index 0000000..6251640 --- /dev/null +++ b/libSBOLj3/output/entity_additional/participation/participation.rj @@ -0,0 +1,430 @@ +{ + "https://sbolstandard.org/examples/E0040_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "E0040_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "gfp sequence" + } + ] + } + , + "https://sbolstandard.org/examples/i13504" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504/SubComponent1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://sbolstandard.org/examples/i13504/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#hasLocation" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504/SubComponent1/Range1" + } + ] , + "http://sbols.org/v3#orientation" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0001030" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/E0040" + } + ] + } + , + "https://sbolstandard.org/examples/i13504/SubComponent1/Range1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Range1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Range" + } + ] , + "http://sbols.org/v3#start" : [ { + "type" : "literal" , + "value" : "1" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_Sequence1" + } + ] , + "http://sbols.org/v3#orientation" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0001030" + } + ] , + "http://sbols.org/v3#end" : [ { + "type" : "literal" , + "value" : "719" + } + ] + } + , + "https://sbolstandard.org/examples/GFP_protein" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "GFP_protein" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "GFP" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "GFP" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000252" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/SubComponent2" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent2" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/GFP_protein" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation1" : { + "http://sbols.org/v3#participant" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/ComponentReference1" + } + ] , + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Participation1" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000645" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Participation" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "null sequence" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation2" : { + "http://sbols.org/v3#participant" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/SubComponent2" + } + ] , + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Participation2" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000011" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Participation" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_system" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000289" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/SubComponent1" + } + , { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/ComponentReference1" + } + , { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/SubComponent2" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "i13504 system" + } + ] , + "http://sbols.org/v3#hasInteraction" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/Interaction1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://sbolstandard.org/examples/E0040" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "E0040" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000316" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/E0040_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "gfp" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "gfp coding sequence" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/Interaction1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Interaction1" + } + ] , + "http://sbols.org/v3#hasParticipation" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation1" + } + , { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/Interaction1/Participation2" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Interaction" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000589" + } + ] + } + , + "https://sbolstandard.org/examples/i13504_system/ComponentReference1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "ComponentReference1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#ComponentReference" + } + ] , + "http://sbols.org/v3#inChildOf" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504_system/SubComponent1" + } + ] , + "http://sbols.org/v3#refersTo" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/i13504/SubComponent1" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/participation/participation.ttl b/libSBOLj3/output/entity_additional/participation/participation.ttl new file mode 100644 index 0000000..a6c9e9a --- /dev/null +++ b/libSBOLj3/output/entity_additional/participation/participation.ttl @@ -0,0 +1,107 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:GFP_protein a sbol:Component ; + sbol:description "GFP" ; + sbol:displayId "GFP_protein" ; + sbol:hasNamespace ; + sbol:name "GFP" ; + sbol:type SBO:0000252 . + + + a sbol:ComponentReference ; + sbol:displayId "ComponentReference1" ; + sbol:inChildOf ; + sbol:refersTo . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:hasLocation ; + sbol:instanceOf :E0040 ; + sbol:orientation SO:0001030 . + +:E0040_Sequence1 a sbol:Sequence ; + sbol:description "gfp sequence" ; + sbol:displayId "E0040_Sequence1" ; + sbol:elements "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:instanceOf :i13504 . + + + a sbol:Participation ; + sbol:displayId "Participation2" ; + sbol:participant ; + sbol:role SBO:0000011 . + +:i13504_system a sbol:Component ; + sbol:displayId "i13504_system" ; + sbol:hasFeature , , ; + sbol:hasInteraction ; + sbol:hasNamespace ; + sbol:name "i13504 system" ; + sbol:role SBO:0000289 ; + sbol:type SBO:0000251 . + +:i13504 a sbol:Component ; + sbol:displayId "i13504" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:hasSequence :i13504_Sequence1 ; + sbol:type SBO:0000251 . + +:E0040 a sbol:Component ; + sbol:description "gfp coding sequence" ; + sbol:displayId "E0040" ; + sbol:hasNamespace ; + sbol:hasSequence :E0040_Sequence1 ; + sbol:name "gfp" ; + sbol:role SO:0000316 ; + sbol:type SBO:0000251 . + + + a sbol:Interaction ; + sbol:displayId "Interaction1" ; + sbol:hasParticipation , ; + sbol:type SBO:0000589 . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent2" ; + sbol:instanceOf :GFP_protein . + + + a sbol:Range ; + sbol:displayId "Range1" ; + sbol:end "719" ; + sbol:hasSequence :i13504_Sequence1 ; + sbol:orientation SO:0001030 ; + sbol:start "1" . + + + a sbol:Participation ; + sbol:displayId "Participation1" ; + sbol:participant ; + sbol:role SBO:0000645 . + +:i13504_Sequence1 a sbol:Sequence ; + sbol:description "null sequence" ; + sbol:displayId "i13504_Sequence1" ; + sbol:elements "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . diff --git a/libSBOLj3/output/entity_additional/participation/participation_ordered.nt b/libSBOLj3/output/entity_additional/participation/participation_ordered.nt new file mode 100644 index 0000000..30de367 --- /dev/null +++ b/libSBOLj3/output/entity_additional/participation/participation_ordered.nt @@ -0,0 +1,78 @@ + "gfp coding sequence" . + "E0040" . + . + . + "gfp" . + . + . + . + "gfp sequence" . + "E0040_Sequence1" . + "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" . + . + . + "Sequence1" . + . + "GFP" . + "GFP_protein" . + . + "GFP" . + . + . + "Range1" . + "719" . + . + . + "1" . + . + "SubComponent1" . + . + . + . + . + "i13504" . + . + . + . + . + . + "null sequence" . + "i13504_Sequence1" . + "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" . + . + . + "Sequence1" . + . + "ComponentReference1" . + . + . + . + "Participation1" . + . + . + . + "Participation2" . + . + . + . + "Interaction1" . + . + . + . + . + "SubComponent1" . + . + . + "SubComponent2" . + . + . + "i13504_system" . + . + . + . + . + . + "i13504 system" . + . + . + . diff --git a/libSBOLj3/output/entity_additional/range/range.jsonld b/libSBOLj3/output/entity_additional/range/range.jsonld new file mode 100644 index 0000000..fd0d2df --- /dev/null +++ b/libSBOLj3/output/entity_additional/range/range.jsonld @@ -0,0 +1,117 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/B0015", + "@type" : "sbol:Component", + "description" : "B0015 double terminator", + "displayId" : "B0015", + "hasNamespace" : "https://synbiohub.org/public/igem", + "hasSequence" : "https://synbiohub.org/public/igem/B0015_Sequence1", + "name" : "terminator", + "role" : "SO:0000141", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/B0015_Sequence1", + "@type" : "sbol:Sequence", + "description" : "terminator sequence", + "displayId" : "B0015_Sequence1", + "elements" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence1" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504", + "@type" : "sbol:Component", + "displayId" : "i13504", + "hasFeature" : "https://synbiohub.org/public/igem/i13504/SubComponent1", + "hasNamespace" : "https://synbiohub.org/public/igem", + "hasSequence" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "hasLocation" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1", + "instanceOf" : "https://synbiohub.org/public/igem/B0015", + "orientation" : "SO:0001030" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1", + "@type" : "sbol:Range", + "displayId" : "Range1", + "end" : "80", + "hasSequence" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "start" : "1" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "@type" : "sbol:Sequence", + "description" : "null sequence", + "displayId" : "i13504_Sequence1", + "elements" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence1" + } ], + "@context" : { + "encoding" : { + "@id" : "http://sbols.org/v3#encoding", + "@type" : "@id" + }, + "elements" : { + "@id" : "http://sbols.org/v3#elements" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "hasSequence" : { + "@id" : "http://sbols.org/v3#hasSequence", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "hasLocation" : { + "@id" : "http://sbols.org/v3#hasLocation", + "@type" : "@id" + }, + "orientation" : { + "@id" : "http://sbols.org/v3#orientation", + "@type" : "@id" + }, + "instanceOf" : { + "@id" : "http://sbols.org/v3#instanceOf", + "@type" : "@id" + }, + "end" : { + "@id" : "http://sbols.org/v3#end" + }, + "start" : { + "@id" : "http://sbols.org/v3#start" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/range/range.jsonld_expanded b/libSBOLj3/output/entity_additional/range/range.jsonld_expanded new file mode 100644 index 0000000..408bfc7 --- /dev/null +++ b/libSBOLj3/output/entity_additional/range/range.jsonld_expanded @@ -0,0 +1,115 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/B0015", + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/B0015_Sequence1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000141" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "B0015 double terminator" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "terminator" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "B0015" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/B0015_Sequence1", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "terminator sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "B0015_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1", + "http://sbols.org/v3#hasLocation" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1" + } ], + "http://sbols.org/v3#orientation" : [ { + "@id" : "https://identifiers.org/SO:0001030" + } ], + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/B0015" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1", + "http://sbols.org/v3#end" : [ { + "@value" : "80" + } ], + "http://sbols.org/v3#start" : [ { + "@value" : "1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Range1" + } ], + "@type" : [ "http://sbols.org/v3#Range" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "http://sbols.org/v3#elements" : [ { + "@value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } ], + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "null sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +} ] diff --git a/libSBOLj3/output/entity_additional/range/range.nt b/libSBOLj3/output/entity_additional/range/range.nt new file mode 100644 index 0000000..15388a8 --- /dev/null +++ b/libSBOLj3/output/entity_additional/range/range.nt @@ -0,0 +1,38 @@ + . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + "terminator sequence" . + "Sequence1" . + . + "B0015_Sequence1" . + . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + . + "null sequence" . + "Sequence1" . + . + "i13504_Sequence1" . + . + . + . + . + . + "i13504" . + . + . + . + "B0015 double terminator" . + "terminator" . + . + . + "B0015" . + . + . + . + . + "SubComponent1" . + . + "80" . + "1" . + . + "Range1" . + . diff --git a/libSBOLj3/output/entity_additional/range/range.rdf b/libSBOLj3/output/entity_additional/range/range.rdf new file mode 100644 index 0000000..5b63e9e --- /dev/null +++ b/libSBOLj3/output/entity_additional/range/range.rdf @@ -0,0 +1,67 @@ + + + + + + + 80 + 1 + + + + Range1 + + + + + + + SubComponent1 + + + + + + + + i13504 + + + + + + + B0015 double terminator + terminator + + + B0015 + + + ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc + + null sequence + Sequence1 + + i13504_Sequence1 + + + + ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc + terminator sequence + Sequence1 + + B0015_Sequence1 + + diff --git a/libSBOLj3/output/entity_additional/range/range.rj b/libSBOLj3/output/entity_additional/range/range.rj new file mode 100644 index 0000000..052534e --- /dev/null +++ b/libSBOLj3/output/entity_additional/range/range.rj @@ -0,0 +1,209 @@ +{ + "https://synbiohub.org/public/igem/i13504_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "null sequence" + } + ] + } + , + "https://synbiohub.org/public/igem/B0015_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "B0015_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "terminator sequence" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#hasLocation" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1" + } + ] , + "http://sbols.org/v3#orientation" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0001030" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/B0015" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504/SubComponent1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/B0015" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "B0015" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000141" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/B0015_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "terminator" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "B0015 double terminator" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Range1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Range" + } + ] , + "http://sbols.org/v3#start" : [ { + "type" : "literal" , + "value" : "1" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } + ] , + "http://sbols.org/v3#end" : [ { + "type" : "literal" , + "value" : "80" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/range/range.ttl b/libSBOLj3/output/entity_additional/range/range.ttl new file mode 100644 index 0000000..b612fa3 --- /dev/null +++ b/libSBOLj3/output/entity_additional/range/range.ttl @@ -0,0 +1,56 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:B0015_Sequence1 a sbol:Sequence ; + sbol:description "terminator sequence" ; + sbol:displayId "B0015_Sequence1" ; + sbol:elements "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . + +:i13504_Sequence1 a sbol:Sequence ; + sbol:description "null sequence" ; + sbol:displayId "i13504_Sequence1" ; + sbol:elements "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . + +:i13504 a sbol:Component ; + sbol:displayId "i13504" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:hasSequence :i13504_Sequence1 ; + sbol:type SBO:0000251 . + +:B0015 a sbol:Component ; + sbol:description "B0015 double terminator" ; + sbol:displayId "B0015" ; + sbol:hasNamespace ; + sbol:hasSequence :B0015_Sequence1 ; + sbol:name "terminator" ; + sbol:role SO:0000141 ; + sbol:type SBO:0000251 . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:hasLocation ; + sbol:instanceOf :B0015 ; + sbol:orientation SO:0001030 . + + + a sbol:Range ; + sbol:displayId "Range1" ; + sbol:end "80" ; + sbol:hasSequence :i13504_Sequence1 ; + sbol:start "1" . diff --git a/libSBOLj3/output/entity_additional/range/range_ordered.nt b/libSBOLj3/output/entity_additional/range/range_ordered.nt new file mode 100644 index 0000000..df8f081 --- /dev/null +++ b/libSBOLj3/output/entity_additional/range/range_ordered.nt @@ -0,0 +1,38 @@ + "B0015 double terminator" . + "B0015" . + . + . + "terminator" . + . + . + . + "terminator sequence" . + "B0015_Sequence1" . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + . + . + "Sequence1" . + . + "Range1" . + "80" . + . + "1" . + . + "SubComponent1" . + . + . + . + . + "i13504" . + . + . + . + . + . + "null sequence" . + "i13504_Sequence1" . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + . + . + "Sequence1" . + . diff --git a/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld new file mode 100644 index 0000000..35b877e --- /dev/null +++ b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld @@ -0,0 +1,90 @@ +{ + "@graph" : [ { + "@id" : "https://sbolstandard.org/examples/E0040", + "@type" : "sbol:Component", + "displayId" : "E0040", + "hasFeature" : "https://sbolstandard.org/examples/E0040/SequenceFeature1", + "hasNamespace" : "https://sbolstandard.org/examples", + "hasSequence" : "https://sbolstandard.org/examples/E0040_Sequence1", + "name" : "E0040", + "role" : "SO:0000316", + "type" : "SBO:0000251" + }, { + "@id" : "https://sbolstandard.org/examples/E0040/SequenceFeature1", + "@type" : "sbol:SequenceFeature", + "displayId" : "SequenceFeature1", + "hasLocation" : "https://sbolstandard.org/examples/E0040/SequenceFeature1/Range1" + }, { + "@id" : "https://sbolstandard.org/examples/E0040/SequenceFeature1/Range1", + "@type" : "sbol:Range", + "displayId" : "Range1", + "end" : "3", + "hasSequence" : "https://sbolstandard.org/examples/E0040_Sequence1", + "start" : "1" + }, { + "@id" : "https://sbolstandard.org/examples/E0040_Sequence1", + "@type" : "sbol:Sequence", + "description" : "E0040 sequence", + "displayId" : "E0040_Sequence1", + "elements" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://sbolstandard.org/examples", + "name" : "Sequence1" + } ], + "@context" : { + "encoding" : { + "@id" : "http://sbols.org/v3#encoding", + "@type" : "@id" + }, + "elements" : { + "@id" : "http://sbols.org/v3#elements" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasLocation" : { + "@id" : "http://sbols.org/v3#hasLocation", + "@type" : "@id" + }, + "end" : { + "@id" : "http://sbols.org/v3#end" + }, + "start" : { + "@id" : "http://sbols.org/v3#start" + }, + "hasSequence" : { + "@id" : "http://sbols.org/v3#hasSequence", + "@type" : "@id" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld_expanded b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld_expanded new file mode 100644 index 0000000..31da04b --- /dev/null +++ b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.jsonld_expanded @@ -0,0 +1,70 @@ +[ { + "@id" : "https://sbolstandard.org/examples/E0040", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://sbolstandard.org/examples/E0040/SequenceFeature1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://sbolstandard.org/examples/E0040_Sequence1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000316" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "E0040" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "E0040" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://sbolstandard.org/examples/E0040/SequenceFeature1", + "http://sbols.org/v3#hasLocation" : [ { + "@id" : "https://sbolstandard.org/examples/E0040/SequenceFeature1/Range1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SequenceFeature1" + } ], + "@type" : [ "http://sbols.org/v3#SequenceFeature" ] +}, { + "@id" : "https://sbolstandard.org/examples/E0040/SequenceFeature1/Range1", + "http://sbols.org/v3#end" : [ { + "@value" : "3" + } ], + "http://sbols.org/v3#start" : [ { + "@value" : "1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://sbolstandard.org/examples/E0040_Sequence1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Range1" + } ], + "@type" : [ "http://sbols.org/v3#Range" ] +}, { + "@id" : "https://sbolstandard.org/examples/E0040_Sequence1", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "E0040 sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://sbolstandard.org/examples" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "E0040_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +} ] diff --git a/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.nt b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.nt new file mode 100644 index 0000000..47babaf --- /dev/null +++ b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.nt @@ -0,0 +1,23 @@ + . + "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" . + "E0040 sequence" . + "Sequence1" . + . + "E0040_Sequence1" . + . + . + "SequenceFeature1" . + . + "3" . + "1" . + . + "Range1" . + . + . + . + . + "E0040" . + . + . + "E0040" . + . diff --git a/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rdf b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rdf new file mode 100644 index 0000000..078f7e3 --- /dev/null +++ b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rdf @@ -0,0 +1,46 @@ + + + + + + + 3 + 1 + + + + Range1 + + + SequenceFeature1 + + + + + + + E0040 + + + E0040 + + + + atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa + E0040 sequence + Sequence1 + + E0040_Sequence1 + + diff --git a/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rj b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rj new file mode 100644 index 0000000..edb38ce --- /dev/null +++ b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.rj @@ -0,0 +1,128 @@ +{ + "https://sbolstandard.org/examples/E0040_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "E0040_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "E0040 sequence" + } + ] + } + , + "https://sbolstandard.org/examples/E0040/SequenceFeature1/Range1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Range1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Range" + } + ] , + "http://sbols.org/v3#start" : [ { + "type" : "literal" , + "value" : "1" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/E0040_Sequence1" + } + ] , + "http://sbols.org/v3#end" : [ { + "type" : "literal" , + "value" : "3" + } + ] + } + , + "https://sbolstandard.org/examples/E0040/SequenceFeature1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SequenceFeature1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SequenceFeature" + } + ] , + "http://sbols.org/v3#hasLocation" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/E0040/SequenceFeature1/Range1" + } + ] + } + , + "https://sbolstandard.org/examples/E0040" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "E0040" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000316" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/E0040_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://sbolstandard.org/examples/E0040/SequenceFeature1" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "E0040" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.ttl b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.ttl new file mode 100644 index 0000000..789b821 --- /dev/null +++ b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature.ttl @@ -0,0 +1,39 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:E0040_Sequence1 a sbol:Sequence ; + sbol:description "E0040 sequence" ; + sbol:displayId "E0040_Sequence1" ; + sbol:elements "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . + + + a sbol:SequenceFeature ; + sbol:displayId "SequenceFeature1" ; + sbol:hasLocation . + + + a sbol:Range ; + sbol:displayId "Range1" ; + sbol:end "3" ; + sbol:hasSequence :E0040_Sequence1 ; + sbol:start "1" . + +:E0040 a sbol:Component ; + sbol:displayId "E0040" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:hasSequence :E0040_Sequence1 ; + sbol:name "E0040" ; + sbol:role SO:0000316 ; + sbol:type SBO:0000251 . diff --git a/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature_ordered.nt b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature_ordered.nt new file mode 100644 index 0000000..4f91a52 --- /dev/null +++ b/libSBOLj3/output/entity_additional/sequencefeature/sequencefeature_ordered.nt @@ -0,0 +1,23 @@ + "Range1" . + "3" . + . + "1" . + . + "SequenceFeature1" . + . + . + "E0040" . + . + . + . + "E0040" . + . + . + . + "E0040 sequence" . + "E0040_Sequence1" . + "atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa" . + . + . + "Sequence1" . + . diff --git a/libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld new file mode 100644 index 0000000..8dfc77e --- /dev/null +++ b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld @@ -0,0 +1,129 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/B0015", + "@type" : "sbol:Component", + "description" : "B0015 double terminator", + "displayId" : "B0015", + "hasNamespace" : "https://synbiohub.org/public/igem", + "hasSequence" : "https://synbiohub.org/public/igem/B0015_Sequence1", + "name" : "terminator", + "role" : "SO:0000141", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/B0015_Sequence1", + "@type" : "sbol:Sequence", + "description" : "terminator sequence", + "displayId" : "B0015_Sequence1", + "elements" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence1" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504", + "@type" : "sbol:Component", + "displayId" : "i13504", + "hasFeature" : "https://synbiohub.org/public/igem/i13504/SubComponent1", + "hasNamespace" : "https://synbiohub.org/public/igem", + "hasSequence" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "hasLocation" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1", + "instanceOf" : "https://synbiohub.org/public/igem/B0015", + "orientation" : "SO:0001030", + "sourceLocation" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range2" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1", + "@type" : "sbol:Range", + "displayId" : "Range1", + "end" : "80", + "hasSequence" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "start" : "1" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range2", + "@type" : "sbol:Range", + "displayId" : "Range2", + "end" : "80", + "hasSequence" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "start" : "2" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "@type" : "sbol:Sequence", + "description" : "null sequence", + "displayId" : "i13504_Sequence1", + "elements" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc", + "encoding" : "EDAM:format_1207", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "Sequence1" + } ], + "@context" : { + "encoding" : { + "@id" : "http://sbols.org/v3#encoding", + "@type" : "@id" + }, + "elements" : { + "@id" : "http://sbols.org/v3#elements" + }, + "description" : { + "@id" : "http://sbols.org/v3#description" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "end" : { + "@id" : "http://sbols.org/v3#end" + }, + "start" : { + "@id" : "http://sbols.org/v3#start" + }, + "hasSequence" : { + "@id" : "http://sbols.org/v3#hasSequence", + "@type" : "@id" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "sourceLocation" : { + "@id" : "http://sbols.org/v3#sourceLocation", + "@type" : "@id" + }, + "hasLocation" : { + "@id" : "http://sbols.org/v3#hasLocation", + "@type" : "@id" + }, + "orientation" : { + "@id" : "http://sbols.org/v3#orientation", + "@type" : "@id" + }, + "instanceOf" : { + "@id" : "http://sbols.org/v3#instanceOf", + "@type" : "@id" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld_expanded b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld_expanded new file mode 100644 index 0000000..3199cbb --- /dev/null +++ b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.jsonld_expanded @@ -0,0 +1,133 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/B0015", + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/B0015_Sequence1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SO:0000141" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "B0015 double terminator" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "terminator" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "B0015" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/B0015_Sequence1", + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#elements" : [ { + "@value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "terminator sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "B0015_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1", + "http://sbols.org/v3#sourceLocation" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range2" + } ], + "http://sbols.org/v3#hasLocation" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1" + } ], + "http://sbols.org/v3#orientation" : [ { + "@id" : "https://identifiers.org/SO:0001030" + } ], + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/B0015" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1", + "http://sbols.org/v3#end" : [ { + "@value" : "80" + } ], + "http://sbols.org/v3#start" : [ { + "@value" : "1" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Range1" + } ], + "@type" : [ "http://sbols.org/v3#Range" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range2", + "http://sbols.org/v3#end" : [ { + "@value" : "80" + } ], + "http://sbols.org/v3#start" : [ { + "@value" : "2" + } ], + "http://sbols.org/v3#hasSequence" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "Range2" + } ], + "@type" : [ "http://sbols.org/v3#Range" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_Sequence1", + "http://sbols.org/v3#elements" : [ { + "@value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } ], + "http://sbols.org/v3#encoding" : [ { + "@id" : "https://identifiers.org/edam:format_1207" + } ], + "http://sbols.org/v3#description" : [ { + "@value" : "null sequence" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "Sequence1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_Sequence1" + } ], + "@type" : [ "http://sbols.org/v3#Sequence" ] +} ] diff --git a/libSBOLj3/output/entity_additional/subcomponent/subcomponent.nt b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.nt new file mode 100644 index 0000000..ed4c685 --- /dev/null +++ b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.nt @@ -0,0 +1,44 @@ + . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + "terminator sequence" . + "Sequence1" . + . + "B0015_Sequence1" . + . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + . + "null sequence" . + "Sequence1" . + . + "i13504_Sequence1" . + . + "80" . + "2" . + . + "Range2" . + . + . + . + . + . + "i13504" . + . + . + . + "B0015 double terminator" . + "terminator" . + . + . + "B0015" . + . + . + . + . + . + "SubComponent1" . + . + "80" . + "1" . + . + "Range1" . + . diff --git a/libSBOLj3/output/entity_additional/subcomponent/subcomponent.rdf b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.rdf new file mode 100644 index 0000000..54dca58 --- /dev/null +++ b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.rdf @@ -0,0 +1,77 @@ + + + + + + + 80 + 2 + + + + Range2 + + + + + 80 + 1 + + + + Range1 + + + + + + + SubComponent1 + + + + + + + + i13504 + + + + + + + B0015 double terminator + terminator + + + B0015 + + + ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc + + null sequence + Sequence1 + + i13504_Sequence1 + + + + ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc + terminator sequence + Sequence1 + + B0015_Sequence1 + + diff --git a/libSBOLj3/output/entity_additional/subcomponent/subcomponent.rj b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.rj new file mode 100644 index 0000000..d5d7086 --- /dev/null +++ b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.rj @@ -0,0 +1,242 @@ +{ + "https://synbiohub.org/public/igem/i13504_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "null sequence" + } + ] + } + , + "https://synbiohub.org/public/igem/B0015_Sequence1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "B0015_Sequence1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Sequence" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#elements" : [ { + "type" : "literal" , + "value" : "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "Sequence1" + } + ] , + "http://sbols.org/v3#encoding" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/edam:format_1207" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "terminator sequence" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#hasLocation" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1" + } + ] , + "http://sbols.org/v3#orientation" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0001030" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/B0015" + } + ] , + "http://sbols.org/v3#sourceLocation" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504/SubComponent1/Range2" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504/SubComponent1/Range2" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Range2" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Range" + } + ] , + "http://sbols.org/v3#start" : [ { + "type" : "literal" , + "value" : "2" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } + ] , + "http://sbols.org/v3#end" : [ { + "type" : "literal" , + "value" : "80" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504/SubComponent1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/B0015" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "B0015" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SO:0000141" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/B0015_Sequence1" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "terminator" + } + ] , + "http://sbols.org/v3#description" : [ { + "type" : "literal" , + "value" : "B0015 double terminator" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504/SubComponent1/Range1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "Range1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Range" + } + ] , + "http://sbols.org/v3#start" : [ { + "type" : "literal" , + "value" : "1" + } + ] , + "http://sbols.org/v3#hasSequence" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_Sequence1" + } + ] , + "http://sbols.org/v3#end" : [ { + "type" : "literal" , + "value" : "80" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additional/subcomponent/subcomponent.ttl b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.ttl new file mode 100644 index 0000000..c635d40 --- /dev/null +++ b/libSBOLj3/output/entity_additional/subcomponent/subcomponent.ttl @@ -0,0 +1,64 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:B0015_Sequence1 a sbol:Sequence ; + sbol:description "terminator sequence" ; + sbol:displayId "B0015_Sequence1" ; + sbol:elements "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . + +:i13504_Sequence1 a sbol:Sequence ; + sbol:description "null sequence" ; + sbol:displayId "i13504_Sequence1" ; + sbol:elements "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" ; + sbol:encoding EDAM:format_1207 ; + sbol:hasNamespace ; + sbol:name "Sequence1" . + + + a sbol:Range ; + sbol:displayId "Range2" ; + sbol:end "80" ; + sbol:hasSequence :i13504_Sequence1 ; + sbol:start "2" . + +:i13504 a sbol:Component ; + sbol:displayId "i13504" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:hasSequence :i13504_Sequence1 ; + sbol:type SBO:0000251 . + +:B0015 a sbol:Component ; + sbol:description "B0015 double terminator" ; + sbol:displayId "B0015" ; + sbol:hasNamespace ; + sbol:hasSequence :B0015_Sequence1 ; + sbol:name "terminator" ; + sbol:role SO:0000141 ; + sbol:type SBO:0000251 . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:hasLocation ; + sbol:instanceOf :B0015 ; + sbol:orientation SO:0001030 ; + sbol:sourceLocation . + + + a sbol:Range ; + sbol:displayId "Range1" ; + sbol:end "80" ; + sbol:hasSequence :i13504_Sequence1 ; + sbol:start "1" . diff --git a/libSBOLj3/output/entity_additional/subcomponent/subcomponent_ordered.nt b/libSBOLj3/output/entity_additional/subcomponent/subcomponent_ordered.nt new file mode 100644 index 0000000..cfb3c46 --- /dev/null +++ b/libSBOLj3/output/entity_additional/subcomponent/subcomponent_ordered.nt @@ -0,0 +1,44 @@ + "B0015 double terminator" . + "B0015" . + . + . + "terminator" . + . + . + . + "terminator sequence" . + "B0015_Sequence1" . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + . + . + "Sequence1" . + . + "Range1" . + "80" . + . + "1" . + . + "Range2" . + "80" . + . + "2" . + . + "SubComponent1" . + . + . + . + . + . + "i13504" . + . + . + . + . + . + "null sequence" . + "i13504_Sequence1" . + "ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc" . + . + . + "Sequence1" . + . diff --git a/libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld b/libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld new file mode 100644 index 0000000..b728ff6 --- /dev/null +++ b/libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld @@ -0,0 +1,85 @@ +{ + "@graph" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504", + "@type" : "sbol:Component", + "displayId" : "i13504", + "hasNamespace" : "https://synbiohub.org/public/igem", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_system", + "@type" : "sbol:Component", + "displayId" : "i13504_system", + "hasFeature" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "hasNamespace" : "https://synbiohub.org/public/igem", + "name" : "i13504 system", + "role" : "SBO:0000289", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "instanceOf" : "https://synbiohub.org/public/igem/i13504" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1", + "@type" : "sbol:Component", + "displayId" : "interlab16device1", + "hasFeature" : [ "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" ], + "hasNamespace" : "https://synbiohub.org/public/igem", + "type" : "SBO:0000251" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", + "@type" : "sbol:ComponentReference", + "displayId" : "ComponentReference1", + "inChildOf" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "refersTo" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "@type" : "sbol:SubComponent", + "displayId" : "SubComponent1", + "instanceOf" : "https://synbiohub.org/public/igem/i13504_system" + } ], + "@context" : { + "hasNamespace" : { + "@id" : "http://sbols.org/v3#hasNamespace", + "@type" : "@id" + }, + "type" : { + "@id" : "http://sbols.org/v3#type", + "@type" : "@id" + }, + "displayId" : { + "@id" : "http://sbols.org/v3#displayId" + }, + "hasFeature" : { + "@id" : "http://sbols.org/v3#hasFeature", + "@type" : "@id" + }, + "inChildOf" : { + "@id" : "http://sbols.org/v3#inChildOf", + "@type" : "@id" + }, + "refersTo" : { + "@id" : "http://sbols.org/v3#refersTo", + "@type" : "@id" + }, + "instanceOf" : { + "@id" : "http://sbols.org/v3#instanceOf", + "@type" : "@id" + }, + "role" : { + "@id" : "http://sbols.org/v3#role", + "@type" : "@id" + }, + "name" : { + "@id" : "http://sbols.org/v3#name" + }, + "SBO" : "https://identifiers.org/SBO:", + "CHEBI" : "https://identifiers.org/CHEBI:", + "GO" : "https://identifiers.org/GO:", + "sbol" : "http://sbols.org/v3#", + "EDAM" : "https://identifiers.org/edam:", + "SO" : "https://identifiers.org/SO:", + "prov" : "http://www.w3.org/ns/prov#", + "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/" + } +} diff --git a/libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld_expanded b/libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld_expanded new file mode 100644 index 0000000..2649c50 --- /dev/null +++ b/libSBOLj3/output/entity_additonal/componentreference/componentreference.jsonld_expanded @@ -0,0 +1,81 @@ +[ { + "@id" : "https://synbiohub.org/public/igem/i13504", + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_system", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } ], + "http://sbols.org/v3#role" : [ { + "@id" : "https://identifiers.org/SBO:0000289" + } ], + "http://sbols.org/v3#name" : [ { + "@value" : "i13504 system" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "i13504_system" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1", + "http://sbols.org/v3#hasFeature" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + }, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } ], + "http://sbols.org/v3#hasNamespace" : [ { + "@id" : "https://synbiohub.org/public/igem" + } ], + "http://sbols.org/v3#type" : [ { + "@id" : "https://identifiers.org/SBO:0000251" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "interlab16device1" + } ], + "@type" : [ "http://sbols.org/v3#Component" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1", + "http://sbols.org/v3#inChildOf" : [ { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } ], + "http://sbols.org/v3#refersTo" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "ComponentReference1" + } ], + "@type" : [ "http://sbols.org/v3#ComponentReference" ] +}, { + "@id" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1", + "http://sbols.org/v3#instanceOf" : [ { + "@id" : "https://synbiohub.org/public/igem/i13504_system" + } ], + "http://sbols.org/v3#displayId" : [ { + "@value" : "SubComponent1" + } ], + "@type" : [ "http://sbols.org/v3#SubComponent" ] +} ] diff --git a/libSBOLj3/output/entity_additonal/componentreference/componentreference.nt b/libSBOLj3/output/entity_additonal/componentreference/componentreference.nt new file mode 100644 index 0000000..3b82c9f --- /dev/null +++ b/libSBOLj3/output/entity_additonal/componentreference/componentreference.nt @@ -0,0 +1,27 @@ + . + . + "i13504" . + . + . + . + . + . + "interlab16device1" . + . + . + . + "ComponentReference1" . + . + . + "SubComponent1" . + . + . + "SubComponent1" . + . + . + . + "i13504 system" . + . + . + "i13504_system" . + . diff --git a/libSBOLj3/output/entity_additonal/componentreference/componentreference.rdf b/libSBOLj3/output/entity_additonal/componentreference/componentreference.rdf new file mode 100644 index 0000000..c2de452 --- /dev/null +++ b/libSBOLj3/output/entity_additonal/componentreference/componentreference.rdf @@ -0,0 +1,51 @@ + + + + + + + + SubComponent1 + + + + i13504 system + + + i13504_system + + + + + i13504 + + + + + + + + SubComponent1 + + + + ComponentReference1 + + + + + + interlab16device1 + + diff --git a/libSBOLj3/output/entity_additonal/componentreference/componentreference.rj b/libSBOLj3/output/entity_additonal/componentreference/componentreference.rj new file mode 100644 index 0000000..cb633b2 --- /dev/null +++ b/libSBOLj3/output/entity_additonal/componentreference/componentreference.rj @@ -0,0 +1,153 @@ +{ + "https://synbiohub.org/public/igem/i13504_system" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504_system" + } + ] , + "http://sbols.org/v3#role" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000289" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } + ] , + "http://sbols.org/v3#name" : [ { + "type" : "literal" , + "value" : "i13504 system" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "i13504" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "interlab16device1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#Component" + } + ] , + "http://sbols.org/v3#hasNamespace" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem" + } + ] , + "http://sbols.org/v3#hasFeature" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } + , { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" + } + ] , + "http://sbols.org/v3#type" : [ { + "type" : "uri" , + "value" : "https://identifiers.org/SBO:0000251" + } + ] + } + , + "https://synbiohub.org/public/igem/interlab16device1/ComponentReference1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "ComponentReference1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#ComponentReference" + } + ] , + "http://sbols.org/v3#inChildOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/interlab16device1/SubComponent1" + } + ] , + "http://sbols.org/v3#refersTo" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504_system/SubComponent1" + } + ] + } + , + "https://synbiohub.org/public/igem/i13504_system/SubComponent1" : { + "http://sbols.org/v3#displayId" : [ { + "type" : "literal" , + "value" : "SubComponent1" + } + ] , + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "type" : "uri" , + "value" : "http://sbols.org/v3#SubComponent" + } + ] , + "http://sbols.org/v3#instanceOf" : [ { + "type" : "uri" , + "value" : "https://synbiohub.org/public/igem/i13504" + } + ] + } +} diff --git a/libSBOLj3/output/entity_additonal/componentreference/componentreference.ttl b/libSBOLj3/output/entity_additonal/componentreference/componentreference.ttl new file mode 100644 index 0000000..1b448df --- /dev/null +++ b/libSBOLj3/output/entity_additonal/componentreference/componentreference.ttl @@ -0,0 +1,45 @@ +@base . +@prefix : . +@prefix CHEBI: . +@prefix EDAM: . +@prefix GO: . +@prefix SBO: . +@prefix SO: . +@prefix om: . +@prefix prov: . +@prefix sbol: . + +:i13504 a sbol:Component ; + sbol:displayId "i13504" ; + sbol:hasNamespace ; + sbol:type SBO:0000251 . + +:interlab16device1 a sbol:Component ; + sbol:displayId "interlab16device1" ; + sbol:hasFeature , ; + sbol:hasNamespace ; + sbol:type SBO:0000251 . + + + a sbol:ComponentReference ; + sbol:displayId "ComponentReference1" ; + sbol:inChildOf ; + sbol:refersTo . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:instanceOf :i13504_system . + + + a sbol:SubComponent ; + sbol:displayId "SubComponent1" ; + sbol:instanceOf :i13504 . + +:i13504_system a sbol:Component ; + sbol:displayId "i13504_system" ; + sbol:hasFeature ; + sbol:hasNamespace ; + sbol:name "i13504 system" ; + sbol:role SBO:0000289 ; + sbol:type SBO:0000251 . diff --git a/libSBOLj3/output/entity_additonal/componentreference/componentreference_ordered.nt b/libSBOLj3/output/entity_additonal/componentreference/componentreference_ordered.nt new file mode 100644 index 0000000..b1ba183 --- /dev/null +++ b/libSBOLj3/output/entity_additonal/componentreference/componentreference_ordered.nt @@ -0,0 +1,27 @@ + "i13504" . + . + . + . + "SubComponent1" . + . + . + "i13504_system" . + . + . + "i13504 system" . + . + . + . + "ComponentReference1" . + . + . + . + "SubComponent1" . + . + . + "interlab16device1" . + . + . + . + . + . diff --git a/libSBOLj3/output/invalid/displayid/displayid.ttl b/libSBOLj3/output/invalid/displayid/displayid.ttl index 1b704e8..543bba5 100644 --- a/libSBOLj3/output/invalid/displayid/displayid.ttl +++ b/libSBOLj3/output/invalid/displayid/displayid.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :rbs a sbol:Component ; sbol:description "RBS (Elowitz 1999)" ; diff --git a/libSBOLj3/output/measurement_entity/measurement/measurement.ttl b/libSBOLj3/output/measurement_entity/measurement/measurement.ttl index 1dd00c8..be470a7 100644 --- a/libSBOLj3/output/measurement_entity/measurement/measurement.ttl +++ b/libSBOLj3/output/measurement_entity/measurement/measurement.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . a sbol:Identified , om:Measure ; diff --git a/libSBOLj3/output/measurement_entity/measurement_using_units_From_OM/measurement_using_units_From_OM.ttl b/libSBOLj3/output/measurement_entity/measurement_using_units_From_OM/measurement_using_units_From_OM.ttl index 6d56434..11ef9ab 100644 --- a/libSBOLj3/output/measurement_entity/measurement_using_units_From_OM/measurement_using_units_From_OM.ttl +++ b/libSBOLj3/output/measurement_entity/measurement_using_units_From_OM/measurement_using_units_From_OM.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :M9_Glucose_CAA a sbol:Component ; sbol:description "M9 Glucose CAA growth media" ; diff --git a/libSBOLj3/output/multicellular/multicellular.ttl b/libSBOLj3/output/multicellular/multicellular.ttl index 949d8f8..e046709 100644 --- a/libSBOLj3/output/multicellular/multicellular.ttl +++ b/libSBOLj3/output/multicellular/multicellular.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :rbs_luxR a sbol:Component ; sbol:description "RBS" ; diff --git a/libSBOLj3/output/multicellular_simple/multicellular_simple.ttl b/libSBOLj3/output/multicellular_simple/multicellular_simple.ttl index 3b3ff89..e54c589 100644 --- a/libSBOLj3/output/multicellular_simple/multicellular_simple.ttl +++ b/libSBOLj3/output/multicellular_simple/multicellular_simple.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . a sbol:SubComponent ; diff --git a/libSBOLj3/output/provenance_entity/activity/activity.jsonld b/libSBOLj3/output/provenance_entity/activity/activity.jsonld index fe48c2e..30be3e7 100644 --- a/libSBOLj3/output/provenance_entity/activity/activity.jsonld +++ b/libSBOLj3/output/provenance_entity/activity/activity.jsonld @@ -30,10 +30,10 @@ "hasNamespace" : "https://sbolstandard.org/examples", "name" : "Codon optimization activity", "type" : "sbol:design", - "endedAtTime" : "2020-08-30T15:50:10.221Z", + "endedAtTime" : "2020-08-30T10:42:52.292Z", "qualifiedAssociation" : "https://sbolstandard.org/examples/codon_optimization_activity/Association1", "qualifiedUsage" : [ "https://sbolstandard.org/examples/codon_optimization_activity/Usage2", "https://sbolstandard.org/examples/codon_optimization_activity/Usage1" ], - "startedAtTime" : "2019-07-29T15:50:10.221Z" + "startedAtTime" : "2019-07-29T10:42:52.292Z" }, { "@id" : "https://sbolstandard.org/examples/codon_optimization_activity/Association1", "@type" : [ "sbol:Identified", "prov:Association" ], @@ -118,15 +118,15 @@ "@id" : "http://www.w3.org/ns/prov#entity", "@type" : "@id" }, - "endedAtTime" : { - "@id" : "http://www.w3.org/ns/prov#endedAtTime" + "startedAtTime" : { + "@id" : "http://www.w3.org/ns/prov#startedAtTime" }, "qualifiedUsage" : { "@id" : "http://www.w3.org/ns/prov#qualifiedUsage", "@type" : "@id" }, - "startedAtTime" : { - "@id" : "http://www.w3.org/ns/prov#startedAtTime" + "endedAtTime" : { + "@id" : "http://www.w3.org/ns/prov#endedAtTime" }, "qualifiedAssociation" : { "@id" : "http://www.w3.org/ns/prov#qualifiedAssociation", diff --git a/libSBOLj3/output/provenance_entity/activity/activity.jsonld_expanded b/libSBOLj3/output/provenance_entity/activity/activity.jsonld_expanded index 033c79e..a116595 100644 --- a/libSBOLj3/output/provenance_entity/activity/activity.jsonld_expanded +++ b/libSBOLj3/output/provenance_entity/activity/activity.jsonld_expanded @@ -54,6 +54,9 @@ "http://sbols.org/v3#type" : [ { "@id" : "http://sbols.org/v3#design" } ], + "http://www.w3.org/ns/prov#startedAtTime" : [ { + "@value" : "2019-07-29T10:42:52.292Z" + } ], "@type" : [ "http://sbols.org/v3#TopLevel", "http://www.w3.org/ns/prov#Activity" ], "http://sbols.org/v3#name" : [ { "@value" : "Codon optimization activity" @@ -61,9 +64,6 @@ "http://sbols.org/v3#description" : [ { "@value" : "An activity that is used to optimise codons" } ], - "http://www.w3.org/ns/prov#endedAtTime" : [ { - "@value" : "2020-08-30T15:50:10.221Z" - } ], "http://www.w3.org/ns/prov#qualifiedUsage" : [ { "@id" : "https://sbolstandard.org/examples/codon_optimization_activity/Usage2" }, { @@ -72,8 +72,8 @@ "http://sbols.org/v3#displayId" : [ { "@value" : "codon_optimization_activity" } ], - "http://www.w3.org/ns/prov#startedAtTime" : [ { - "@value" : "2019-07-29T15:50:10.221Z" + "http://www.w3.org/ns/prov#endedAtTime" : [ { + "@value" : "2020-08-30T10:42:52.292Z" } ], "http://www.w3.org/ns/prov#qualifiedAssociation" : [ { "@id" : "https://sbolstandard.org/examples/codon_optimization_activity/Association1" diff --git a/libSBOLj3/output/provenance_entity/activity/activity.nt b/libSBOLj3/output/provenance_entity/activity/activity.nt index 935ced8..2a85abd 100644 --- a/libSBOLj3/output/provenance_entity/activity/activity.nt +++ b/libSBOLj3/output/provenance_entity/activity/activity.nt @@ -49,14 +49,14 @@ "CodonOptimisationProtocol" . . . + "2019-07-29T10:42:52.292Z" . . "Codon optimization activity" . "An activity that is used to optimise codons" . - "2020-08-30T15:50:10.221Z" . . . "codon_optimization_activity" . - "2019-07-29T15:50:10.221Z" . + "2020-08-30T10:42:52.292Z" . . . . diff --git a/libSBOLj3/output/provenance_entity/activity/activity.rdf b/libSBOLj3/output/provenance_entity/activity/activity.rdf index d55fb92..6d59753 100644 --- a/libSBOLj3/output/provenance_entity/activity/activity.rdf +++ b/libSBOLj3/output/provenance_entity/activity/activity.rdf @@ -55,9 +55,9 @@ + 2019-07-29T10:42:52.292Z Codon optimization activity An activity that is used to optimise codons - 2020-08-30T15:50:10.221Z @@ -68,7 +68,7 @@ codon_optimization_activity - 2019-07-29T15:50:10.221Z + 2020-08-30T10:42:52.292Z diff --git a/libSBOLj3/output/provenance_entity/activity/activity.rj b/libSBOLj3/output/provenance_entity/activity/activity.rj index b5281eb..68850e1 100644 --- a/libSBOLj3/output/provenance_entity/activity/activity.rj +++ b/libSBOLj3/output/provenance_entity/activity/activity.rj @@ -146,7 +146,12 @@ ] , "http://www.w3.org/ns/prov#endedAtTime" : [ { "type" : "literal" , - "value" : "2020-08-30T15:50:10.221Z" + "value" : "2020-08-30T10:42:52.292Z" + } + ] , + "http://www.w3.org/ns/prov#startedAtTime" : [ { + "type" : "literal" , + "value" : "2019-07-29T10:42:52.292Z" } ] , "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { @@ -158,11 +163,6 @@ "value" : "http://www.w3.org/ns/prov#Activity" } ] , - "http://www.w3.org/ns/prov#startedAtTime" : [ { - "type" : "literal" , - "value" : "2019-07-29T15:50:10.221Z" - } - ] , "http://sbols.org/v3#hasNamespace" : [ { "type" : "uri" , "value" : "https://sbolstandard.org/examples" diff --git a/libSBOLj3/output/provenance_entity/activity/activity.ttl b/libSBOLj3/output/provenance_entity/activity/activity.ttl index 6da037e..f4d99b4 100644 --- a/libSBOLj3/output/provenance_entity/activity/activity.ttl +++ b/libSBOLj3/output/provenance_entity/activity/activity.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :toggle_switch_optimised a sbol:Component ; @@ -75,7 +75,7 @@ sbol:hasNamespace ; sbol:name "Codon optimization activity" ; sbol:type sbol:design ; - prov:endedAtTime "2020-08-30T15:50:10.221Z" ; + prov:endedAtTime "2020-08-30T10:42:52.292Z" ; prov:qualifiedAssociation ; prov:qualifiedUsage , ; - prov:startedAtTime "2019-07-29T15:50:10.221Z" . + prov:startedAtTime "2019-07-29T10:42:52.292Z" . diff --git a/libSBOLj3/output/provenance_entity/activity/activity_ordered.nt b/libSBOLj3/output/provenance_entity/activity/activity_ordered.nt index bcdd71f..17c7045 100644 --- a/libSBOLj3/output/provenance_entity/activity/activity_ordered.nt +++ b/libSBOLj3/output/provenance_entity/activity/activity_ordered.nt @@ -41,11 +41,11 @@ . . . - "2020-08-30T15:50:10.221Z" . + "2020-08-30T10:42:52.292Z" . . . . - "2019-07-29T15:50:10.221Z" . + "2019-07-29T10:42:52.292Z" . "Toggle Switch genetic circuit" . "toggle_switch" . . diff --git a/libSBOLj3/output/provenance_entity/agent/agent.ttl b/libSBOLj3/output/provenance_entity/agent/agent.ttl index b826643..42fdbaa 100644 --- a/libSBOLj3/output/provenance_entity/agent/agent.ttl +++ b/libSBOLj3/output/provenance_entity/agent/agent.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :toggle_switch a sbol:Component ; sbol:description "Toggle Switch genetic circuit" ; diff --git a/libSBOLj3/output/provenance_entity/plan/plan.ttl b/libSBOLj3/output/provenance_entity/plan/plan.ttl index dcfa2fa..5f085fa 100644 --- a/libSBOLj3/output/provenance_entity/plan/plan.ttl +++ b/libSBOLj3/output/provenance_entity/plan/plan.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :CodonOptimisationProtocol a sbol:TopLevel , prov:Plan ; diff --git a/libSBOLj3/output/toggle_switch/toggle_switch.ttl b/libSBOLj3/output/toggle_switch/toggle_switch.ttl index 8dd4e92..ac729cb 100644 --- a/libSBOLj3/output/toggle_switch/toggle_switch.ttl +++ b/libSBOLj3/output/toggle_switch/toggle_switch.ttl @@ -1,13 +1,13 @@ @base . @prefix : . -@prefix SBO: . @prefix CHEBI: . -@prefix GO: . -@prefix sbol: . @prefix EDAM: . +@prefix GO: . +@prefix SBO: . @prefix SO: . -@prefix prov: . @prefix om: . +@prefix prov: . +@prefix sbol: . :lacI a sbol:Component ; sbol:description "lacI coding sequence" ; diff --git a/libSBOLj3/pom.xml b/libSBOLj3/pom.xml index 57b827e..e40d19e 100644 --- a/libSBOLj3/pom.xml +++ b/libSBOLj3/pom.xml @@ -5,7 +5,7 @@ org.sbolstandard libSBOLj3 jar - 1.3-SNAPSHOT + 1.4-SNAPSHOT libSBOLj3 https://github.com/goksel/libSBOLj3 @@ -22,24 +22,24 @@ org.apache.jena jena-base - 3.17.0 + 4.4.0 org.apache.jena jena-core - 4.2.0 + 4.4.0 org.apache.jena jena - 3.17.0 + 4.4.0 pom org.apache.jena jena-arq - 3.17.0 + 4.4.0 @@ -47,12 +47,29 @@ commons-io 2.7 - + + jakarta.validation + jakarta.validation-api + 3.0.1 + + + org.hibernate.validator + hibernate-validator + 7.0.4.Final + + + org.glassfish + jakarta.el + 4.0.1 + + + org.hibernate.validator + hibernate-validator-cdi + 7.0.4.Final + - - org.apache.maven.plugins maven-shade-plugin @@ -95,10 +112,10 @@ - - UTF-8 - 16 - 16 - 16 - + + UTF-8 + 16 + 16 + 16 + diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/api/SBOLAPI.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/api/SBOLAPI.java index 7299251..4e3b9c5 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/api/SBOLAPI.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/api/SBOLAPI.java @@ -395,6 +395,23 @@ public static Sequence createSequence(SBOLDocument doc, Component component, Enc component.setSequences(Arrays.asList(seq.getUri())); return seq; } + + public static Sequence addSequence(SBOLDocument doc, Component component, Encoding encoding, String elements) throws SBOLGraphException + { + String localName=createLocalName(DataModel.Sequence.uri, component.getSequences()); + Sequence seq=createSequence(doc, URI.create(component.getUri().toString() + "_" + localName), localName, component.getName() + " sequence", elements, encoding); + List sequences=component.getSequences(); + if (sequences==null) + { + component.setSequences(Arrays.asList(seq.getUri())); + } + else + { + sequences.add(seq.getUri()); + component.setSequences(sequences); + } + return seq; + } public static Component createComponent(SBOLDocument doc, URI uri, URI type, String name, String description, URI role) throws SBOLGraphException diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Attachment.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Attachment.java index 4976bc7..0dfa88c 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Attachment.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Attachment.java @@ -1,18 +1,31 @@ package org.sbolstandard.core3.entity; import java.net.URI; +import java.util.OptionalLong; +import java.util.Set; import org.apache.jena.rdf.model.Resource; +import org.hibernate.validator.internal.util.logging.Messages; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.Message; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.PositiveOrZero; +import jakarta.validation.executable.ExecutableValidator; + public class Attachment extends TopLevel{ - private URI source=null; + /*private URI source=null; private URI format=null; - private long size=Long.MIN_VALUE; + private OptionalLong size=OptionalLong.empty(); private String hash; - private String hashAlgorithm; + private String hashAlgorithm;*/ protected Attachment(org.apache.jena.rdf.model.Model model,URI uri) throws SBOLGraphException @@ -25,75 +38,115 @@ protected Attachment(Resource resource) throws SBOLGraphException super(resource); } + //@NotNull(message = "Attachment.source cannot be null") + @NotNull(message = "{ATTACHMENT_SOURCE_NOT_NULL}") public URI getSource() throws SBOLGraphException { - if (source==null) + /*if (source==null) { - source=RDFUtil.getPropertyAsURI(this.resource, DataModel.Model.source); + source=IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Model.source); } - return source; + return source;*/ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Model.source); } - public void setSource(URI source) { - this.source = source; + public void setSource(@NotNull (message="{ATTACHMENT_SOURCE_NOT_NULL}") URI source) throws SBOLGraphException { + //this.source = source; + /*try { + + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + Object[] parameterValues = { source }; + Set> violations = executableValidator.validateParameters( + this, + Attachment.class.getMethod( "setSource", URI.class), + parameterValues + ); + if (violations.size()>0) + { + throw new Error ("source is null - gmgm"); + } + } + catch (Exception e) + { + throw new Error(e); + }*/ + PropertyValidator.getValidator().validate(this, "setSource", new Object[] {source}, URI.class); RDFUtil.setProperty(resource, DataModel.Model.source, source); } - public URI getFormat() { - if (format==null) + public URI getFormat() throws SBOLGraphException { + /*if (format==null) { - format=RDFUtil.getPropertyAsURI(this.resource, DataModel.Attachment.format); + format=IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Attachment.format); } - return format; + return format;*/ + + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Attachment.format); } public void setFormat(URI format) { - this.format = format; + //this.format = format; RDFUtil.setProperty(resource, DataModel.Attachment.format, format); } - public long getSize() { - if (size==Long.MIN_VALUE) + @PositiveOrZero(message="{ATTACHMENT_SIZE_POSITIVE_OR_ZERO}") + public OptionalLong getSize() throws SBOLGraphException{ + /*if (size.isEmpty()) { - String value=RDFUtil.getPropertyAsString(this.resource, DataModel.Attachment.size); + String value=IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Attachment.size); if (value!=null) { - size=Long.parseLong(value); + size=OptionalLong.of(Long.parseLong(value)); } } + return size;*/ + OptionalLong size=OptionalLong.empty(); + String value=IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Attachment.size); + if (value!=null) + { + size= OptionalLong.of(Long.parseLong(value)); + } return size; } - public void setSize(long size) { - this.size = size; - RDFUtil.setProperty(resource, DataModel.Attachment.size, String.valueOf(size)); + public void setSize(@PositiveOrZero(message="{ATTACHMENT_SIZE_POSITIVE_OR_ZERO}") OptionalLong sizeValue) throws SBOLGraphException { + //this.size = sizeValue; + String stringValue=null; + if (sizeValue.isPresent()) + { + stringValue= String.valueOf(sizeValue.getAsLong()); + } + PropertyValidator.getValidator().validate(this, "setSize", new Object[] {sizeValue}, OptionalLong.class); + RDFUtil.setProperty(resource, DataModel.Attachment.size, stringValue); } - public String getHash() { - if (hash==null) + public String getHash() throws SBOLGraphException { + /*if (hash==null) { - hash=RDFUtil.getPropertyAsString(this.resource, DataModel.Attachment.hash); + hash=IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Attachment.hash); } - return hash; - + return hash;*/ + return IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Attachment.hash); } public void setHash(String hash) { - this.hash = hash; + //this.hash = hash; RDFUtil.setProperty(resource, DataModel.Attachment.hash, String.valueOf(hash)); - } - public String getHashAlgorithm() { - if (hashAlgorithm==null) + public String getHashAlgorithm() throws SBOLGraphException { + /*if (hashAlgorithm==null) { - hashAlgorithm=RDFUtil.getPropertyAsString(this.resource, DataModel.Attachment.hashAlgorithm); + hashAlgorithm=IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Attachment.hashAlgorithm); } - return hashAlgorithm; + return hashAlgorithm;*/ + return IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Attachment.hashAlgorithm); + } public void setHashAlgorithm(String hashAlgorithm) { - this.hashAlgorithm = hashAlgorithm; + //this.hashAlgorithm = hashAlgorithm; RDFUtil.setProperty(resource, DataModel.Attachment.hashAlgorithm, String.valueOf(hashAlgorithm)); } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Collection.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Collection.java index b14c0fd..94999b3 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Collection.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Collection.java @@ -9,7 +9,7 @@ import org.sbolstandard.core3.vocabulary.DataModel; public class Collection extends TopLevel{ - private List members=null; + //private List members=null; protected Collection(Model model,URI uri) throws SBOLGraphException { @@ -21,16 +21,11 @@ protected Collection(Resource resource) throws SBOLGraphException super(resource); } - public List getTopLevels() throws SBOLGraphException { - if (members==null) - { - members=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Collection.member); - } - return members; + public List getMembers() throws SBOLGraphException { + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Collection.member); } - public void setTopLevels(List members) { - this.members = members; + public void setMembers(List members) { RDFUtil.setProperty(resource, DataModel.Collection.member, members); } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/CombinatorialDerivation.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/CombinatorialDerivation.java index e3f580d..3f5313c 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/CombinatorialDerivation.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/CombinatorialDerivation.java @@ -9,12 +9,19 @@ import org.sbolstandard.core3.api.SBOLAPI; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; +import org.sbolstandard.core3.validation.SBOLValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import org.sbolstandard.core3.vocabulary.VariableFeatureCardinality; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; public class CombinatorialDerivation extends TopLevel{ - private URI template=null; + /*private URI template=null; private URI strategy=null; - private List variableFeatures=new ArrayList(); + private List variableFeatures=new ArrayList();*/ protected CombinatorialDerivation(Model model,URI uri) throws SBOLGraphException { @@ -26,58 +33,48 @@ protected CombinatorialDerivation(Resource resource) throws SBOLGraphException super(resource); } + @NotNull(message = "{COMBINATORIALDERIVATION_TEMPLATE_NOT_NULL}") public URI getTemplate() throws SBOLGraphException { - if (template==null) - { - template=RDFUtil.getPropertyAsURI(this.resource, DataModel.CombinatorialDerivation.template); - } - return template; + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.CombinatorialDerivation.template); } - public void setTemplate(URI template) { - this.template = template; + public void setTemplate(@NotNull(message = "{COMBINATORIALDERIVATION_TEMPLATE_NOT_NULL}") URI template) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setTemplate", new Object[] {template}, URI.class); RDFUtil.setProperty(resource, DataModel.CombinatorialDerivation.template, template); } - public URI getStrategy() { - if (strategy==null) - { - strategy=RDFUtil.getPropertyAsURI(this.resource, DataModel.CombinatorialDerivation.strategy); - } - return strategy; + public URI getStrategy() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.CombinatorialDerivation.strategy); } public void setStrategy(URI strategy) { - this.strategy = strategy; RDFUtil.setProperty(resource, DataModel.CombinatorialDerivation.strategy, strategy); } - + @Valid public List getVariableFeatures() throws SBOLGraphException { - this.variableFeatures=addToList(this.variableFeatures, DataModel.CombinatorialDerivation.variableFeature, VariableFeature.class, DataModel.VariableComponent.uri); - return this.variableFeatures; + return addToList(DataModel.CombinatorialDerivation.variableFeature, VariableFeature.class, DataModel.VariableComponent.uri); } - public VariableFeature createVariableFeature(URI uri, URI cardinality, URI subComponent) throws SBOLGraphException + public VariableFeature createVariableFeature(URI uri, VariableFeatureCardinality cardinality, URI subComponent) throws SBOLGraphException { VariableFeature variableComponent= new VariableFeature(this.resource.getModel(), uri); variableComponent.setCardinality(cardinality); variableComponent.setFeature(subComponent); - this.variableFeatures=addToList (this.variableFeatures, variableComponent, DataModel.CombinatorialDerivation.variableFeature); + addToList(variableComponent, DataModel.CombinatorialDerivation.variableFeature); return variableComponent; } - private VariableFeature createVariableFeature(String displayId, URI cardinality, URI subComponent) throws SBOLGraphException + private VariableFeature createVariableFeature(String displayId, VariableFeatureCardinality cardinality, URI subComponent) throws SBOLGraphException { return createVariableFeature(SBOLAPI.append(this.getUri(), displayId), cardinality, subComponent); } - public VariableFeature createVariableComponent(URI cardinality, URI subComponent) throws SBOLGraphException + public VariableFeature createVariableFeature(VariableFeatureCardinality cardinality, URI subComponent) throws SBOLGraphException { String displayId=SBOLAPI.createLocalName(DataModel.VariableComponent.uri, getVariableFeatures()); return createVariableFeature(displayId, cardinality, subComponent); } - @Override public URI getResourceType() { diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Component.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Component.java index 44ded10..c9291a5 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Component.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Component.java @@ -11,12 +11,17 @@ import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.util.SBOLUtil; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.Encoding; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public class Component extends TopLevel { - private List roles=null; + /*private List roles=null; private List sequences=null; private List types=null; private List features=null; @@ -28,14 +33,13 @@ public class Component extends TopLevel { private List interactions=null; private List constraints=null; private Interface componentInterface=null; - private List models=null; + private List models=null;*/ //private Set interactions2=null; protected Component(Model model, URI uri) throws SBOLGraphException { super(model, uri); - } protected Component(Resource resource) throws SBOLGraphException @@ -43,45 +47,31 @@ protected Component(Resource resource) throws SBOLGraphException super(resource); } - + @Valid + @NotEmpty(message = "{COMPONENT_TYPES_NOT_EMPTY}") public List getTypes() { - if (types==null) - { - types=RDFUtil.getPropertiesAsURIs(this.resource,DataModel.type); - } - return types; + return RDFUtil.getPropertiesAsURIs(this.resource,DataModel.type); } - public void setTypes(List types) { - this.types = types; + public void setTypes(@NotEmpty(message = "{COMPONENT_TYPES_NOT_EMPTY}")List types) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setTypes", new Object[] {types}, List.class); RDFUtil.setProperty(resource, DataModel.type, types); } - public List getRoles() { - if (roles==null) - { - roles=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.role); - } - return roles; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.role); } public void setRoles(List roles) { - this.roles = roles; RDFUtil.setProperty(resource, DataModel.role, roles); } public List getSequences() { - if (sequences==null) - { - sequences=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Component.sequence); - } - return sequences; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Component.sequence); } public void setSequences(List sequences) { - this.sequences = sequences; RDFUtil.setProperty(resource, DataModel.Component.sequence, sequences); } @@ -111,22 +101,27 @@ private Feature addToFeatures(Feature feature) { } */ - public List getFeatures() throws SBOLGraphException{ - if (features==null) + private void addToList(List listA, List listB) + { + if (listB!=null && listB.size()>0) { - features = new ArrayList(); - features.addAll(this.getSubComponents()); - features.addAll(this.getComponentReferences()); - features.addAll(this.getLocalSubComponents()); - features.addAll(this.getExternallyDefineds()); - features.addAll(this.getSequenceFeatures()); + listA.addAll(listB); } + } + + public List getFeatures() throws SBOLGraphException{ + List features=new ArrayList(); + addToList(features, getSubComponents()); + addToList(features, getComponentReferences()); + addToList(features, getLocalSubComponents()); + addToList(features, getExternallyDefineds()); + addToList(features, getSequenceFeatures()); return features; } + @Valid public List getSubComponents() throws SBOLGraphException { - this.subComponents=addToList(this.subComponents, DataModel.Component.feature, SubComponent.class, DataModel.SubComponent.uri); - return this.subComponents; + return addToList(DataModel.Component.feature, SubComponent.class, DataModel.SubComponent.uri); /* if (subComponents==null) { @@ -144,7 +139,7 @@ public SubComponent createSubComponent(URI uri, URI isInstanceOf) throws SBOLGra { SubComponent feature = new SubComponent(this.resource.getModel(), uri); feature.setIsInstanceOf(isInstanceOf); - this.subComponents=addToList(this.subComponents, feature, DataModel.Component.feature); + addToList(feature, DataModel.Component.feature); return feature; } @@ -159,17 +154,16 @@ public SubComponent createSubComponent(URI isInstanceOf) throws SBOLGraphExcepti return createSubComponent(displayId, isInstanceOf); } - //Component References + @Valid public List getComponentReferences() throws SBOLGraphException { - this.componentReferences=addToList(this.componentReferences, DataModel.Component.feature, ComponentReference.class, DataModel.ComponentReference.uri); - return this.componentReferences; + return addToList(DataModel.Component.feature, ComponentReference.class, DataModel.ComponentReference.uri); } public ComponentReference createComponentReference(URI uri, URI feature, URI inChildOf) throws SBOLGraphException { ComponentReference componentReference= new ComponentReference(this.resource.getModel(), uri); - componentReference.setFeature(feature); + componentReference.setRefersTo(feature); componentReference.setInChildOf(inChildOf); - this.componentReferences=addToList(this.componentReferences, componentReference, DataModel.Component.feature); + addToList(componentReference, DataModel.Component.feature); return componentReference; } @@ -191,16 +185,16 @@ public ComponentReference createComponentReference(Feature feature, SubComponent } //Local sub components + @Valid public List getLocalSubComponents() throws SBOLGraphException { - this.localSubComponents=addToList(this.localSubComponents, DataModel.Component.feature, LocalSubComponent.class, DataModel.LocalSubComponent.uri); - return this.localSubComponents; + return addToList(DataModel.Component.feature, LocalSubComponent.class, DataModel.LocalSubComponent.uri); } public LocalSubComponent createLocalSubComponent(URI uri, List types) throws SBOLGraphException { LocalSubComponent localSubComponent= new LocalSubComponent(this.resource.getModel(), uri); localSubComponent.setTypes(types); - this.localSubComponents=addToList(this.localSubComponents, localSubComponent, DataModel.Component.feature); + addToList(localSubComponent, DataModel.Component.feature); return localSubComponent; } @@ -216,9 +210,9 @@ public LocalSubComponent createLocalSubComponent(List types) throws SBOLGra } //Externally Defined + @Valid public List getExternallyDefineds() throws SBOLGraphException { - this.externallyDefineds=addToList(this.externallyDefineds, DataModel.Component.feature, ExternallyDefined.class, DataModel.ExternalyDefined.uri); - return this.externallyDefineds; + return addToList(DataModel.Component.feature, ExternallyDefined.class, DataModel.ExternalyDefined.uri); } public ExternallyDefined createExternallyDefined(URI uri, List types, URI definition) throws SBOLGraphException @@ -226,7 +220,7 @@ public ExternallyDefined createExternallyDefined(URI uri, List types, URI d ExternallyDefined externallyDefined= new ExternallyDefined(this.resource.getModel(), uri); externallyDefined.setTypes(types); externallyDefined.setDefinition(definition); - this.externallyDefineds=addToList(this.externallyDefineds, externallyDefined, DataModel.Component.feature); + addToList(externallyDefined, DataModel.Component.feature); return externallyDefined; } @@ -242,9 +236,9 @@ public ExternallyDefined createExternallyDefined(List types, URI definition } //Sequence features + @Valid public List getSequenceFeatures() throws SBOLGraphException { - this.sequenceFatures=addToList(this.sequenceFatures, DataModel.Component.feature, SequenceFeature.class, DataModel.SequenceFeature.uri); - return this.sequenceFatures; + return addToList(DataModel.Component.feature, SequenceFeature.class, DataModel.SequenceFeature.uri); } public SequenceFeature createSequenceFeature(URI uri, List locations) throws SBOLGraphException { @@ -293,7 +287,7 @@ private SequenceFeature createSequenceFeature2(URI uri, List locations public Interaction createInteraction(URI uri, List types) throws SBOLGraphException { Interaction interaction= new Interaction(this.resource.getModel(), uri); interaction.setTypes(types); - this.interactions=addToList(this.interactions, interaction, DataModel.Component.interaction); + addToList(interaction, DataModel.Component.interaction); return interaction; } @@ -306,9 +300,9 @@ public Interaction createInteraction(List types) throws SBOLGraphException return createInteraction(displayId, types); } + @Valid public List getInteractions() throws SBOLGraphException { - this.interactions=addToList(this.interactions, DataModel.Component.interaction, Interaction.class); - return this.interactions; + return addToList(DataModel.Component.interaction, Interaction.class); } //Constraint @@ -317,7 +311,7 @@ public Constraint createConstraint(URI uri, URI restriction, URI subject, URI ob constraint.setRestriction(restriction); constraint.setSubject(subject); constraint.setObject(object); - this.constraints=addToList(this.constraints, constraint, DataModel.Component.constraint); + addToList(constraint, DataModel.Component.constraint); return constraint; } @@ -330,16 +324,17 @@ public Constraint createConstraint(URI restriction, URI subject, URI object) thr return createConstraint(displayId, restriction, subject, object); } + @Valid public List getConstraints() throws SBOLGraphException { - this.constraints=addToList(this.constraints, DataModel.Component.constraint, Constraint.class); - return this.constraints; + return addToList(DataModel.Component.constraint, Constraint.class); } //Interface public Interface createInterface(URI uri) throws SBOLGraphException { - if (this.componentInterface==null) + Interface componentInterface =getInterface(); + if (componentInterface==null) { - this.componentInterface = new Interface(this.resource.getModel(), uri); + componentInterface = new Interface(this.resource.getModel(), uri); RDFUtil.setProperty(resource, DataModel.Component.hasInterface, uri); } return componentInterface; @@ -351,34 +346,21 @@ public Interface createInterface() throws SBOLGraphException { public Interface getInterface() throws SBOLGraphException { - if (this.componentInterface==null) - { - this.componentInterface=contsructIdentified(DataModel.Component.hasInterface, Interface.class); - } - return this.componentInterface; + return contsructIdentified(DataModel.Component.hasInterface, Interface.class); } public List getModels() { - if (models==null) - { - models=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Component.model); - } - return models; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Component.model); } public void setModels(List models) { - this.models = models; RDFUtil.setProperty(resource, DataModel.Component.model, models); } - public URI getResourceType() { return DataModel.Component.uri; } - - - } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ComponentReference.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ComponentReference.java index 5e2b40c..f57655d 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ComponentReference.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ComponentReference.java @@ -6,13 +6,16 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.constraints.NotNull; + public class ComponentReference extends Feature{ - private URI feature=null; - private URI inChildOf=null; + /*private URI feature=null; + private URI inChildOf=null;*/ - protected ComponentReference(Model model,URI uri) throws SBOLGraphException { super(model, uri); @@ -23,39 +26,28 @@ protected ComponentReference(Resource resource) throws SBOLGraphException super(resource); } - - public URI getFeature() { - if (this.feature==null) - { - this.feature=RDFUtil.getPropertyAsURI(this.resource, DataModel.ComponentReference.feature); - } - return this.feature; + @NotNull(message = "{COMBINATORIALREFERENCE_REFERSTO_NOT_NULL}") + public URI getRefersTo() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.ComponentReference.refersTo); } - public void setFeature(URI feature) { - this.feature = feature; - RDFUtil.setProperty(this.resource, DataModel.ComponentReference.feature, this.feature); + public void setRefersTo(@NotNull(message = "{COMBINATORIALREFERENCE_REFERSTO_NOT_NULL}") URI feature) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setRefersTo", new Object[] {feature}, URI.class); + RDFUtil.setProperty(this.resource, DataModel.ComponentReference.refersTo, feature); } - - public URI getInChildOf() { - if (this.inChildOf==null) - { - this.inChildOf=RDFUtil.getPropertyAsURI(this.resource, DataModel.ComponentReference.inChildOf); - } - return this.inChildOf; + @NotNull(message = "{COMBINATORIALREFERENCE_INCHILDOF_NOT_NULL}") + public URI getInChildOf() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.ComponentReference.inChildOf); } - public void setInChildOf(URI inChildOf) { - this.inChildOf = inChildOf; - RDFUtil.setProperty(this.resource, DataModel.ComponentReference.inChildOf, this.inChildOf); + public void setInChildOf(@NotNull(message = "{COMBINATORIALREFERENCE_INCHILDOF_NOT_NULL}") URI inChildOf) throws SBOLGraphException{ + PropertyValidator.getValidator().validate(this, "setInChildOf", new Object[] {inChildOf}, URI.class); + RDFUtil.setProperty(this.resource, DataModel.ComponentReference.inChildOf, inChildOf); } - @Override public URI getResourceType() { return DataModel.ComponentReference.uri; } - - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Constraint.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Constraint.java index f1cf43b..f4a966d 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Constraint.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Constraint.java @@ -5,12 +5,16 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.constraints.NotNull; + public class Constraint extends Identified{ - private URI restriction=null; + /*private URI restriction=null; private URI subject=null; - private URI object=null; + private URI object=null;*/ protected Constraint(Model model,URI uri) throws SBOLGraphException { @@ -22,51 +26,38 @@ protected Constraint(Resource resource) throws SBOLGraphException super(resource); } + @NotNull(message = "{CONSTRAINT_RESTRICTION_NOT_NULL}") public URI getRestriction() throws SBOLGraphException { - if (restriction==null) - { - restriction=RDFUtil.getPropertyAsURI(this.resource, DataModel.Constraint.restriction); - } - return restriction; + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Constraint.restriction); } - public void setRestriction(URI restriction) { - this.restriction = restriction; + public void setRestriction(@NotNull(message = "{CONSTRAINT_RESTRICTION_NOT_NULL}") URI restriction) throws SBOLGraphException{ + PropertyValidator.getValidator().validate(this, "setRestriction", new Object[] {restriction}, URI.class); RDFUtil.setProperty(resource, DataModel.Constraint.restriction, restriction); } - - public URI getSubject() { - if (subject==null) - { - subject=RDFUtil.getPropertyAsURI(this.resource, DataModel.Constraint.subject); - } - return subject; + @NotNull(message = "{CONSTRAINT_SUBJECT_NOT_NULL}") + public URI getSubject() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Constraint.subject); } - public void setSubject(URI subject) { - this.subject = subject; + public void setSubject(@NotNull(message = "{CONSTRAINT_SUBJECT_NOT_NULL}") URI subject) throws SBOLGraphException{ + PropertyValidator.getValidator().validate(this, "setSubject", new Object[] {subject}, URI.class); RDFUtil.setProperty(resource, DataModel.Constraint.subject, subject); } - public URI getObject() { - if (object==null) - { - object=RDFUtil.getPropertyAsURI(this.resource, DataModel.Constraint.object); - } - return object; + @NotNull(message = "{CONSTRAINT_OBJECT_NOT_NULL}") + public URI getObject() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Constraint.object); } - public void setObject(URI object) { - this.object = object; + public void setObject(@NotNull(message = "{CONSTRAINT_OBJECT_NOT_NULL}") URI object) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setObject", new Object[] {object}, URI.class); RDFUtil.setProperty(resource, DataModel.Constraint.object, object); } - @Override public URI getResourceType() { return DataModel.Constraint.uri; } - - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledIdentified.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledIdentified.java index 010dec3..48b45dc 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledIdentified.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledIdentified.java @@ -20,10 +20,8 @@ protected ControlledIdentified(Resource resource) throws SBOLGraphException super(resource); } - @Override public URI getResourceType() { return DataModel.Identified.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledTopLevel.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledTopLevel.java index f06598f..d928180 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledTopLevel.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ControlledTopLevel.java @@ -20,10 +20,8 @@ protected ControlledTopLevel(Resource resource) throws SBOLGraphException super(resource); } - @Override public URI getResourceType() { return DataModel.TopLevel.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Cut.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Cut.java index 1036791..f030210 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Cut.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Cut.java @@ -1,17 +1,22 @@ package org.sbolstandard.core3.entity; import java.net.URI; +import java.util.Optional; +import java.util.OptionalInt; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; -public class Cut extends Location { +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.PositiveOrZero; - private int at=Integer.MIN_VALUE; - +public class Cut extends Location { + //private int at=Integer.MIN_VALUE; protected Cut(Model model, URI uri) throws SBOLGraphException { super(model, uri); @@ -22,32 +27,18 @@ protected Cut(Resource resource) throws SBOLGraphException super(resource); } - - - - - public int getAt() { - if (at==Integer.MIN_VALUE) - { - String value=RDFUtil.getPropertyAsString(this.resource, DataModel.Cut.at); - if (value!=null) - { - at=Integer.valueOf(value); - } - } - return at; + @NotNull(message = "{CUT_AT_NOT_NULL}") + public Optional<@NotNull(message = "{CUT_AT_NOT_NULL}") @PositiveOrZero(message="{CUT_AT_POSITIVE_OR_ZERO}") Integer> getAt() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsOptionalInteger(this.resource, DataModel.Cut.at); } - public void setAt(int at) { - this.at = at; - RDFUtil.setProperty(this.resource, DataModel.Cut.at, String.valueOf(this.at)); + public void setAt(Optional<@NotNull(message = "{CUT_AT_NOT_NULL}") @PositiveOrZero(message="{CUT_AT_POSITIVE_OR_ZERO}")Integer> at) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setAt", new Object[] {at}, Optional.class); + IdentityValidator.getValidator().setPropertyAsOptional(this.resource, DataModel.Cut.at, at); } - public URI getResourceType() { return DataModel.Cut.uri; } - - } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/EntireSequence.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/EntireSequence.java index 53f84f6..7a2d24a 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/EntireSequence.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/EntireSequence.java @@ -9,8 +9,6 @@ public class EntireSequence extends Location { - - protected EntireSequence(Model model, URI uri) throws SBOLGraphException { super(model, uri); } @@ -20,11 +18,8 @@ protected EntireSequence(Resource resource) throws SBOLGraphException super(resource); } - public URI getResourceType() { return DataModel.EntireSequenceLocation.uri; } - - } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Experiment.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Experiment.java index 862b2af..34f43bb 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Experiment.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Experiment.java @@ -18,10 +18,8 @@ protected Experiment(Resource resource) throws SBOLGraphException super(resource); } - @Override public URI getResourceType() { return DataModel.Experiment.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExperimentalData.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExperimentalData.java index aa68035..5e32515 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExperimentalData.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExperimentalData.java @@ -17,11 +17,9 @@ protected ExperimentalData(Resource resource) throws SBOLGraphException { super(resource); } - @Override public URI getResourceType() { return DataModel.ExperimentalData.uri; - } - + } } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExternallyDefined.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExternallyDefined.java index c689ce9..6a97a71 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExternallyDefined.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/ExternallyDefined.java @@ -8,11 +8,17 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public class ExternallyDefined extends Feature{ - private List types=new ArrayList(); - private URI definition=null; + /*private List types=new ArrayList(); + private URI definition=null;*/ protected ExternallyDefined(Model model,URI uri) throws SBOLGraphException { @@ -24,39 +30,30 @@ protected ExternallyDefined(Resource resource) throws SBOLGraphException super(resource); } - + @Valid + @NotEmpty(message = "{EXTERNALLYDEFINED_TYPES_NOT_EMPTY}") public List getTypes() { - if (types==null) - { - types=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.type); - } - return types; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.type); } - public void setTypes(List types) { - this.types = types; + public void setTypes(@NotEmpty(message = "{EXTERNALLYDEFINED_TYPES_NOT_EMPTY}") List types) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setTypes", new Object[] {types}, List.class); RDFUtil.setProperty(resource, DataModel.type, types); } - - public URI getDefinition() { - if (this.definition==null) - { - this.definition=RDFUtil.getPropertyAsURI(this.resource, DataModel.ExternalyDefined.definition); - } - return this.definition; + @NotNull(message = "{EXTERNALLYDEFINED_DEFINITION_NOT_NULL}") + public URI getDefinition() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.ExternalyDefined.definition); } - public void setDefinition(URI definition) { - this.definition = definition; - RDFUtil.setProperty(this.resource, DataModel.ExternalyDefined.definition, this.definition); + public void setDefinition(@NotNull(message = "{EXTERNALLYDEFINED_DEFINITION_NOT_NULL}") URI definition) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setDefinition", new Object[] {definition}, URI.class); + RDFUtil.setProperty(this.resource, DataModel.ExternalyDefined.definition, definition); } - @Override public URI getResourceType() { return DataModel.ExternalyDefined.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Feature.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Feature.java index 5a861f9..f13ea17 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Feature.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Feature.java @@ -7,13 +7,13 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.Orientation; public abstract class Feature extends Identified{ - private List roles=null; - private Orientation orientation=null; - + /*private List roles=null; + private Orientation orientation=null;*/ protected Feature(Model model,URI uri) throws SBOLGraphException { @@ -26,34 +26,29 @@ protected Feature(Resource resource) throws SBOLGraphException } public List getRoles() { - if (roles==null) - { - roles=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.role); - } - return roles; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.role); } public void setRoles(List roles) { - this.roles = roles; RDFUtil.setProperty(resource, DataModel.role, roles); } - public Orientation getOrientation() { - if (orientation==null) - { - URI value=RDFUtil.getPropertyAsURI(this.resource, DataModel.orientation); - if (value!=null) - { - orientation=Orientation.get(value); - } + public Orientation getOrientation() throws SBOLGraphException { + Orientation orientation=null; + + URI value=IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.orientation); + if (value!=null){ + orientation=Orientation.get(value); } return orientation; } public void setOrientation(Orientation orientation) { - this.orientation = orientation; - RDFUtil.setProperty(this.resource, DataModel.orientation, this.orientation.getUri()); + URI orientationURI=null; + if (orientation!=null) + { + orientationURI=orientation.getUri(); + } + RDFUtil.setProperty(this.resource, DataModel.orientation, orientationURI); } - - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Identified.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Identified.java index de1ed80..1021ff4 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Identified.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Identified.java @@ -4,6 +4,8 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; import org.apache.commons.lang3.StringUtils; import org.apache.jena.rdf.model.Model; @@ -12,34 +14,40 @@ import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; import org.apache.jena.rdf.model.StmtIterator; +import org.hibernate.validator.constraints.ParameterScriptAssert; import org.sbolstandard.core3.api.SBOLAPI; import org.sbolstandard.core3.entity.measure.Measure; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.util.SBOLUtil; import org.sbolstandard.core3.util.URINameSpace; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Pattern; + public abstract class Identified { protected Resource resource=null; - private String displayId; + /*private String displayId; private String name; private String description; private List wasDerivedFrom; private List wasGeneratedBy; private List measures; //private List metadataList; - private URI uri; + private URI uri;*/ protected Identified() {} protected Identified(Model model, URI uri) throws SBOLGraphException { - this.uri=uri; - this.resource=RDFUtil.createResource(model, this.uri,this.getResourceType()); + //this.uri=uri; + this.resource=RDFUtil.createResource(model, uri,this.getResourceType()); inferDisplayId(uri); } @@ -52,9 +60,9 @@ protected Identified(Model model, URI uri) throws SBOLGraphException protected Identified(Resource resource) throws SBOLGraphException { - this.uri=URI.create(resource.getURI()); + //this.uri=URI.create(resource.getURI()); this.resource=resource; - inferDisplayId(this.uri); + inferDisplayId(URI.create(resource.getURI())); } /*public Identified (String displayId) @@ -63,88 +71,61 @@ protected Identified(Resource resource) throws SBOLGraphException this.resource=ResourceFactory.createResource(); }*/ - public String getDisplayId() { - if (displayId==null) - { - displayId=RDFUtil.getPropertyAsString(this.resource, DataModel.Identified.displayId); - } - return displayId; + @Pattern(regexp = "^[a-zA-Z_]+[a-zA-Z0-9_]*$", message = "{IDENTIFIED_DISPLAYID}") + public String getDisplayId() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Identified.displayId); } - public void setDisplayId(String displayId) { - this.displayId = displayId; + public void setDisplayId(@Pattern(regexp = "^[a-zA-Z_]+[a-zA-Z0-9_]*$", message = "{IDENTIFIED_DISPLAYID}") String displayId) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setDisplayId", new Object[] {displayId}, String.class); RDFUtil.setProperty(resource, DataModel.Identified.displayId, displayId); } - public String getName() { - if (name==null) - { - name=RDFUtil.getPropertyAsString(this.resource, DataModel.Identified.name); - } - return name; + public String getName() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Identified.name); } - public void setName(String name) { - if (name!=null){ - this.name = name; - RDFUtil.setProperty(resource, DataModel.Identified.name, name); - } + + public void setName(String name) throws SBOLGraphException { + RDFUtil.setProperty(resource, DataModel.Identified.name, name); + } - public String getDescription() { - if (description==null) - { - description=RDFUtil.getPropertyAsString(this.resource, DataModel.Identified.description); - } - return description; + + public String getDescription() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Identified.description); } - public void setDescription(String description) { - if (description!=null) - { - this.description = description; - RDFUtil.setProperty(resource, DataModel.Identified.description, description); - } - + + public void setDescription(String description) throws SBOLGraphException { + RDFUtil.setProperty(resource, DataModel.Identified.description, description); } + public List getWasDerivedFrom() { - if (wasDerivedFrom==null) - { - wasDerivedFrom=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Identified.wasDerivedFrom); - } - return wasDerivedFrom; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Identified.wasDerivedFrom); } - public void setWasDerivedFrom(List wasDerivedFrom) { - this.wasDerivedFrom = wasDerivedFrom; - RDFUtil.setProperty(resource, DataModel.Identified.wasDerivedFrom, this.wasDerivedFrom); + public void setWasDerivedFrom(@Valid List wasDerivedFrom) { + RDFUtil.setProperty(resource, DataModel.Identified.wasDerivedFrom, wasDerivedFrom); } public List getWasGeneratedBy() { - if (wasGeneratedBy==null) - { - wasGeneratedBy=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Identified.wasGeneratedBy); - } - return wasGeneratedBy; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Identified.wasGeneratedBy); } public void setWasGeneratedBy(List wasGeneratedBy) { - this.wasGeneratedBy = wasGeneratedBy; - RDFUtil.setProperty(resource, DataModel.Identified.wasGeneratedBy, this.wasGeneratedBy); - + RDFUtil.setProperty(resource, DataModel.Identified.wasGeneratedBy, wasGeneratedBy); } + @Valid public List getMeasures()throws SBOLGraphException { - this.measures=addToList(this.measures, DataModel.Identified.measure, Measure.class, MeasureDataModel.Measure.uri); - return measures; + return addToList(DataModel.Identified.measure, Measure.class, MeasureDataModel.Measure.uri); } - - public Measure createMeasure(URI uri, float value, URI unit) throws SBOLGraphException { Measure measure = new Measure(this.resource.getModel(), uri) {}; - measure.setValue(value); + measure.setValue(Optional.of(value)); measure.setUnit(unit); - this.measures=addToList(this.measures, measure, DataModel.Identified.measure); + addToList(measure, DataModel.Identified.measure); return measure; } @@ -176,7 +157,7 @@ public Metadata createMetadata(String displayId, URI dataType, URI property) thr } public URI getUri() { - return uri; + return URI.create(this.resource.getURI()); } abstract public URI getResourceType(); @@ -207,7 +188,22 @@ protected Identified createIdentified(Resource res, Class * @return * @throws SBOLGraphException */ - protected List addToList(List items, URI property, Class identifiedClass) throws SBOLGraphException + protected List addToList(URI property, Class identifiedClass) throws SBOLGraphException + { + List items=null; + + List resources=RDFUtil.getResourcesWithProperty(this.resource, property); + if (resources!=null && resources.size()>0){ + items=new ArrayList(); + for (Resource res:resources){ + Identified identified=createIdentified(res, identifiedClass); + items.add((T)identified); + } + } + return items; + } + + /*protected List addToList(List items, URI property, Class identifiedClass) throws SBOLGraphException { if (items==null) { @@ -224,7 +220,7 @@ protected List addToList(List items, URI property, } return items; - } + }*/ protected T contsructIdentified(URI property, Class identifiedClass) throws SBOLGraphException { @@ -253,7 +249,13 @@ protected T contsructIdentified(URI property, Class i * @param property * @return */ - protected List addToList(List items, Identified identified, URI property) + protected void addToList(Identified identified, URI property) + { + RDFUtil.addProperty(this.resource,property, identified.getUri()); + } + + + /*protected List addToList(List items, Identified identified, URI property) { RDFUtil.addProperty(this.resource,property, identified.getUri()); @@ -263,10 +265,11 @@ protected List addToList(List items, Identified ide } items.add((T)identified); return items; - } + }*/ + - protected List addToList(List items, URI property, Class identifiedClass, URI identifiedResourceType) throws SBOLGraphException + /*protected List addToList(List items, URI property, Class identifiedClass, URI identifiedResourceType) throws SBOLGraphException { if (items==null) { @@ -283,6 +286,21 @@ protected List addToList(List items, URI property, } return items; + }*/ + + protected List addToList(URI property, Class identifiedClass, URI identifiedResourceType) throws SBOLGraphException + { + List items=null; + + List resources=RDFUtil.getResourcesWithProperty(this.resource, property, identifiedResourceType); + if (resources!=null && resources.size()>0){ + items=new ArrayList(); + for (Resource res:resources){ + Identified identified=createIdentified(res, identifiedClass); + items.add((T)identified); + } + } + return items; } public void addAnnotion(URI property, String value) @@ -372,7 +390,7 @@ private boolean hasSBOLType (List types){ } private void inferDisplayId(URI uri) throws SBOLGraphException { - displayId = getDisplayId(); + String displayId = getDisplayId(); if (StringUtils.isEmpty(displayId)) { String result = null; String uriString = uri.toString(); diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Implementation.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Implementation.java index e73b412..15546e9 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Implementation.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Implementation.java @@ -5,10 +5,11 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; import org.sbolstandard.core3.vocabulary.DataModel; public class Implementation extends TopLevel{ - private URI component=null; + //private URI component=null; protected Implementation(Model model,URI uri) throws SBOLGraphException { @@ -21,15 +22,10 @@ protected Implementation(Resource resource) throws SBOLGraphException } public URI getComponent() throws SBOLGraphException { - if (component==null) - { - component=RDFUtil.getPropertyAsURI(this.resource, DataModel.Implementation.built); - } - return component; + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Implementation.built); } public void setComponent(URI component) { - this.component = component; RDFUtil.setProperty(resource, DataModel.Implementation.built, component); } @@ -37,5 +33,4 @@ public void setComponent(URI component) { public URI getResourceType() { return DataModel.Implementation.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interaction.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interaction.java index 55a8a3f..981c2b2 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interaction.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interaction.java @@ -7,11 +7,16 @@ import org.sbolstandard.core3.api.SBOLAPI; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public class Interaction extends Identified{ - private List types=null; - private List participations=null; + /*private List types=null; + private List participations=null;*/ protected Interaction(Model model,URI uri) throws SBOLGraphException { @@ -22,34 +27,28 @@ protected Interaction(Resource resource) throws SBOLGraphException { super(resource); } - + @NotEmpty(message = "{INTERACTION_TYPES_NOT_EMPTY}") public List getTypes() { - if (types==null) - { - types=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.type); - } - return types; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.type); } - public void setTypes(List types) { - this.types = types; + public void setTypes(@NotEmpty(message = "{INTERACTION_TYPES_NOT_EMPTY}") List types) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setTypes", new Object[] {types}, List.class); RDFUtil.setProperty(resource, DataModel.type, types); } - + @Valid public List getParticipations() throws SBOLGraphException { - this.participations=addToList(this.participations, DataModel.Interaction.participation, Participation.class); - return this.participations; + return addToList(DataModel.Interaction.participation, Participation.class); } - public Participation createParticipation(URI uri, List roles, URI feature) throws SBOLGraphException { Participation participation=new Participation(this.resource.getModel(),uri); participation.setRoles(roles); participation.setParticipant(feature); - this.participations=addToList(this.participations, participation, DataModel.Interaction.participation); + addToList(participation, DataModel.Interaction.participation); return participation; } @@ -64,11 +63,9 @@ public Participation createParticipation(List roles, URI feature) throws SB return createParticipation(displayId, roles, feature); } - @Override public URI getResourceType() { return DataModel.Interaction.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interface.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interface.java index 986a7c5..21cab82 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interface.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Interface.java @@ -9,9 +9,9 @@ import org.sbolstandard.core3.vocabulary.DataModel; public class Interface extends Identified{ - private List inputs=null; + /*private List inputs=null; private List outputs=null; - private List nonDirectionals=null; + private List nonDirectionals=null;*/ protected Interface(Model model,URI uri) throws SBOLGraphException { @@ -22,45 +22,29 @@ protected Interface(Resource resource) throws SBOLGraphException { super(resource); } - public List getInputs() { - if (inputs==null) - { - inputs=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Interface.input); - } - return inputs; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Interface.input); } public void setInputs(List inputs) { - this.inputs = inputs; RDFUtil.setProperty(resource, DataModel.Interface.input, inputs); } public List getOutputs() { - if (outputs==null) - { - outputs=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Interface.output); - } - return outputs; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Interface.output); } public void setOutputs(List outputs) { - this.outputs = outputs; RDFUtil.setProperty(resource, DataModel.Interface.output, outputs); } public List getNonDirectionals() { - if (this.nonDirectionals==null) - { - nonDirectionals=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Interface.nondirectional); - } - return nonDirectionals; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.Interface.nondirectional); } public void setNonDirectionals(List nonDirectionals) { - this.nonDirectionals = nonDirectionals; RDFUtil.setProperty(resource, DataModel.Interface.nondirectional, nonDirectionals); } @@ -68,5 +52,4 @@ public void setNonDirectionals(List nonDirectionals) { public URI getResourceType() { return DataModel.Interface.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/LocalSubComponent.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/LocalSubComponent.java index 29a34b2..281cadc 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/LocalSubComponent.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/LocalSubComponent.java @@ -10,11 +10,16 @@ import org.sbolstandard.core3.entity.Location.LocationFactory; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public class LocalSubComponent extends Feature{ - private List types=new ArrayList(); - private List locations=null; + /*private List types=new ArrayList(); + private List locations=null;*/ protected LocalSubComponent(Model model,URI uri) throws SBOLGraphException { @@ -26,27 +31,27 @@ protected LocalSubComponent(Resource resource) throws SBOLGraphException super(resource); } - + @Valid + @NotEmpty(message = "{LOCALSUBCOMPONENT_TYPES_NOT_EMPTY}") public List getTypes() { - if (types==null) - { - types=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.type); - } - return types; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.type); } - public void setTypes(List types) { - this.types = types; + public void setTypes(@NotEmpty(message = "{LOCALSUBCOMPONENT_TYPES_NOT_EMPTY}") List types) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setTypes", new Object[] {types}, List.class); RDFUtil.setProperty(resource, DataModel.type, types); } - public List getLocations() throws SBOLGraphException { - if (locations==null) + List locations=null; { List resources=RDFUtil.getResourcesWithProperty (resource, DataModel.SubComponent.location); for (Resource res:resources) { + if (locations==null) + { + locations=new ArrayList(); + } Location location= LocationFactory.create(res); locations.add(location); } @@ -57,7 +62,7 @@ public List getLocations() throws SBOLGraphException { public Location createLocation(LocationBuilder builder ) throws SBOLGraphException { Location location=builder.build(this.resource.getModel(),this.getUri()); - this.locations=addToList(this.locations, location, DataModel.SubComponent.location); + addToList(location, DataModel.SubComponent.location); return location; } @@ -65,6 +70,4 @@ public Location createLocation(LocationBuilder builder ) throws SBOLGraphExcepti public URI getResourceType() { return DataModel.LocalSubComponent.uri; } - - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Location.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Location.java index f623599..e3cdbce 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Location.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Location.java @@ -1,18 +1,25 @@ package org.sbolstandard.core3.entity; import java.net.URI; +import java.util.Optional; +import java.util.OptionalInt; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.Orientation; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + public abstract class Location extends Identified { - private Orientation orientation; + /*private Orientation orientation; private int order=Integer.MIN_VALUE; - protected URI sequence; + protected URI sequence;*/ protected Location(Model model,URI uri) throws SBOLGraphException { @@ -29,53 +36,52 @@ protected Location(Resource resource) throws SBOLGraphException super(displayId); }*/ - public Orientation getOrientation() { - if (orientation==null) - { - URI value=RDFUtil.getPropertyAsURI(this.resource, DataModel.orientation); - if (value!=null) - { - orientation=Orientation.get(value); - } + public Orientation getOrientation() throws SBOLGraphException{ + Orientation orientation=null; + URI value=IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.orientation); + if (value!=null){ + orientation=Orientation.get(value); } return orientation; } public void setOrientation(Orientation orientation) { - this.orientation = orientation; - RDFUtil.setProperty(this.resource, DataModel.orientation, this.orientation.getUri()); + URI orientationURI=null; + if (orientation!=null) + { + orientationURI=orientation.getUri(); + } + RDFUtil.setProperty(this.resource, DataModel.orientation, orientationURI); } - public int getOrder() { - if (order==Integer.MIN_VALUE) - { - String value=RDFUtil.getPropertyAsString(this.resource, DataModel.Location.order); - if (value!=null) - { - order=Integer.valueOf(value); - } + public OptionalInt getOrder() throws SBOLGraphException { + OptionalInt order=OptionalInt.empty(); + String value=IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Location.order); + if (value!=null){ + order=OptionalInt.of(Integer.valueOf(value)); } return order; } - public void setOrder(int order) { - this.order = order; - RDFUtil.setProperty(this.resource, DataModel.Location.order, String.valueOf(this.order)); - } - - - public URI getSequence() { - if (sequence==null) + public void setOrder(OptionalInt order) { + String stringValue=null; + if (order.isPresent()) { - sequence=RDFUtil.getPropertyAsURI(this.resource, DataModel.Location.sequence); + stringValue= String.valueOf(order.getAsInt()); } - return sequence; + RDFUtil.setProperty(this.resource, DataModel.Location.order, stringValue); + } + + @Valid + @NotNull(message = "{LOCATION_SEQUENCE_NOT_NULL}") + public URI getSequence() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Location.sequence); } - public void setSequence(URI sequence) { - this.sequence = sequence; - RDFUtil.setProperty(this.resource, DataModel.Location.sequence, this.sequence); + public void setSequence(@NotNull(message = "{LOCATION_SEQUENCE_NOT_NULL}") URI sequence) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setSequence", new Object[] {sequence}, URI.class); + RDFUtil.setProperty(this.resource, DataModel.Location.sequence, sequence); } public URI getResourceType() @@ -91,9 +97,17 @@ public static Location create(Resource resource) throws SBOLGraphException { return new Cut(resource); } + else if (RDFUtil.hasType(resource.getModel(), resource, DataModel.Range.uri)) + { + return new Range(resource); + } + else if (RDFUtil.hasType(resource.getModel(), resource, DataModel.EntireSequenceLocation.uri)) + { + return new EntireSequence(resource); + } else { - return null; + throw new SBOLGraphException ("Could not initialise the location entity. URI:" + resource.getURI()); } } } @@ -145,7 +159,7 @@ public Cut build(Model model, URI uri) throws SBOLGraphException { Cut location= new Cut(model, uri); location.setSequence(sequence); - location.setAt(at); + location.setAt(Optional.of(at)); return location; } @@ -176,8 +190,8 @@ public Range build(Model model, URI uri) throws SBOLGraphException { Range location= new Range(model, uri); location.setSequence(sequence); - location.setStart(start); - location.setEnd(end); + location.setStart(Optional.of(start)); + location.setEnd(Optional.of(end)); return location; } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Model.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Model.java index 820d2c4..2bce09f 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Model.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Model.java @@ -1,16 +1,21 @@ package org.sbolstandard.core3.entity; import java.net.URI; +import java.util.List; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.constraints.NotNull; + public class Model extends TopLevel{ - private URI source=null; + /*private URI source=null; private URI framework=null; - private URI language=null; + private URI language=null;*/ protected Model(org.apache.jena.rdf.model.Model model,URI uri) throws SBOLGraphException { @@ -22,43 +27,33 @@ protected Model(Resource resource) throws SBOLGraphException super(resource); } + @NotNull(message = "{MODEL_SOURCE_NOT_NULL}") public URI getSource() throws SBOLGraphException { - if (source==null) - { - source=RDFUtil.getPropertyAsURI(this.resource, DataModel.Model.source); - } - return source; + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Model.source); } - public void setSource(URI source) { - this.source = source; + public void setSource(@NotNull(message = "{MODEL_SOURCE_NOT_NULL}") URI source) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setSource", new Object[] {source}, URI.class); RDFUtil.setProperty(resource, DataModel.Model.source, source); } - - public URI getFramework() { - if (framework==null) - { - framework=RDFUtil.getPropertyAsURI(this.resource, DataModel.Model.framework); - } - return framework; + @NotNull(message = "{MODEL_FRAMEWORK_NOT_NULL}") + public URI getFramework() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Model.framework); } - public void setFramework(URI framework) { - this.framework = framework; + public void setFramework(@NotNull(message = "{MODEL_FRAMEWORK_NOT_NULL}") URI framework) throws SBOLGraphException{ + PropertyValidator.getValidator().validate(this, "setFramework", new Object[] {framework}, URI.class); RDFUtil.setProperty(resource, DataModel.Model.framework, framework); } - public URI getLanguage() { - if (language==null) - { - language=RDFUtil.getPropertyAsURI(this.resource, DataModel.Model.language); - } - return language; + @NotNull(message = "{MODEL_LANGUAGE_NOT_NULL}") + public URI getLanguage() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Model.language); } - public void setLanguage(URI language) { - this.language = language; + public void setLanguage(@NotNull(message = "{MODEL_LANGUAGE_NOT_NULL}") URI language) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setLanguage", new Object[] {language}, URI.class); RDFUtil.setProperty(resource, DataModel.Model.language, language); } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Participation.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Participation.java index 177aa92..a416b44 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Participation.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Participation.java @@ -6,14 +6,18 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public class Participation extends Identified{ - private List roles=null; + /*private List roles=null; private URI participant=null; - private URI higherOrderParticipant=null; + private URI higherOrderParticipant=null;*/ - protected Participation(Model model,URI uri) throws SBOLGraphException { super(model, uri); @@ -24,53 +28,35 @@ protected Participation(Resource resource) throws SBOLGraphException super(resource); } + @NotEmpty(message = "{PARTICIPANT_ROLES_NOT_EMPTY}") public List getRoles() { - if (roles==null) - { - roles=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.role); - } - return roles; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.role); } - public void setRoles(List roles) { - this.roles = roles; + public void setRoles(@NotEmpty(message = "{PARTICIPANT_ROLES_NOT_EMPTY}") List roles) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setRoles", new Object[] {roles}, List.class); RDFUtil.setProperty(resource, DataModel.role, roles); } - public URI getParticipant() throws SBOLGraphException { - if (participant==null) - { - participant=RDFUtil.getPropertyAsURI(this.resource, DataModel.Participation.participant); - } - return participant; + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Participation.participant); } public void setParticipant(URI participant) { - this.participant = participant; RDFUtil.setProperty(resource, DataModel.Participation.participant, participant); } public URI getHigherOrderParticipant() throws SBOLGraphException { - if (higherOrderParticipant==null) - { - higherOrderParticipant=RDFUtil.getPropertyAsURI(this.resource, DataModel.Participation.higherOrderParticipant); - } - return participant; + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Participation.higherOrderParticipant); } public void setHigherOrderParticipant(URI higherOrderParticipant) { - this.higherOrderParticipant = higherOrderParticipant; RDFUtil.setProperty(resource, DataModel.Participation.higherOrderParticipant, higherOrderParticipant); } - - - @Override public URI getResourceType() { return DataModel.Participation.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Range.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Range.java index 93ae9d2..d330bd6 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Range.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Range.java @@ -1,17 +1,25 @@ package org.sbolstandard.core3.entity; import java.net.URI; +import java.util.Optional; +import java.util.OptionalInt; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; +import jakarta.validation.constraints.PositiveOrZero; + public class Range extends Location { - private int start=Integer.MIN_VALUE; - private int end=Integer.MIN_VALUE; + /*private int start=Integer.MIN_VALUE; + private int end=Integer.MIN_VALUE;*/ protected Range(Model model, URI uri) throws SBOLGraphException { @@ -28,43 +36,28 @@ protected Range(Resource resource) throws SBOLGraphException super(displayId); }*/ - public int getStart() { - if (start==Integer.MIN_VALUE) - { - String value=RDFUtil.getPropertyAsString(this.resource, DataModel.Range.start); - if (value!=null) - { - start=Integer.valueOf(value); - } - } - return start; + @NotNull(message = "{RANGE_START_NOT_NULL}") + public Optional<@NotNull(message = "{RANGE_START_NOT_NULL}") @Positive(message="{RANGE_START_POSITIVE_OR_ZERO}") Integer> getStart() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsOptionalInteger(this.resource, DataModel.Range.start); } - public void setStart(int start) { - this.start = start; - RDFUtil.setProperty(this.resource, DataModel.Range.start, String.valueOf(this.start)); + public void setStart(@NotNull(message = "{RANGE_START_NOT_NULL}") Optional<@NotNull(message = "{RANGE_START_NOT_NULL}") @Positive(message="{RANGE_START_POSITIVE_OR_ZERO}") Integer> start) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setStart", new Object[] {start}, Optional.class); + IdentityValidator.getValidator().setPropertyAsOptional(this.resource, DataModel.Range.start, start); } - public int getEnd() { - if (end==Integer.MIN_VALUE) - { - String value=RDFUtil.getPropertyAsString(this.resource, DataModel.Range.end); - if (value!=null) - { - end=Integer.valueOf(value); - } - } - return end; + @NotNull(message = "{RANGE_END_NOT_NULL}") + public Optional<@NotNull(message = "{RANGE_END_NOT_NULL}") @Positive(message="{RANGE_END_POSITIVE_OR_ZERO}")Integer> getEnd() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsOptionalInteger(this.resource, DataModel.Range.end); } - public void setEnd(int end) { - this.end = end; - RDFUtil.setProperty(this.resource, DataModel.Range.end, String.valueOf(this.end)); + public void setEnd(@NotNull(message = "{RANGE_END_NOT_NULL}") Optional< @NotNull(message = "{RANGE_END_NOT_NULL}") @Positive(message="{RANGE_START_POSITIVE_OR_ZERO}") Integer> end) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setEnd", new Object[] {end}, Optional.class); + IdentityValidator.getValidator().setPropertyAsOptional(this.resource, DataModel.Range.end, end); } public URI getResourceType() { return DataModel.Range.uri; } - } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SBOLDocument.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SBOLDocument.java index 36b1ed0..03c0865 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SBOLDocument.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SBOLDocument.java @@ -6,6 +6,8 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; import java.util.Map.Entry; import java.util.Set; @@ -35,9 +37,13 @@ import org.sbolstandard.core3.vocabulary.MeasureDataModel; import org.sbolstandard.core3.vocabulary.ProvenanceDataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + public class SBOLDocument { protected Model model = null; - + /*@NotNull (message="SBOLDocument.test cannot be null") + private URI test=null;*/ private List components; private List sequences; private List combinatorialDerivations; @@ -122,6 +128,7 @@ public void setBaseURI(URI base) RDFUtil.setBaseURI(this.model, base); } + @Valid public List getComponents() throws SBOLGraphException { this.components=addToList(model, this.components, DataModel.Component.uri,Component.class); return components; @@ -239,6 +246,7 @@ public Sequence createSequence(String displayId) throws SBOLGraphException { } } + @Valid public List getCombinatorialDerivations() throws SBOLGraphException { this.combinatorialDerivations=addToList(model, this.combinatorialDerivations, DataModel.CombinatorialDerivation.uri,CombinatorialDerivation.class); return combinatorialDerivations; @@ -310,7 +318,8 @@ public ExperimentalData createExperimentalData(String displayId) throws SBOLGrap throw new SBOLGraphException("Display ids can be used to construct entities only if the base URI property of the document is set. Displayid:" + displayId); } } - + + @Valid public List getModels() throws SBOLGraphException { this.models=addToList(model, this.models, DataModel.Model.uri,org.sbolstandard.core3.entity.Model.class); return models; @@ -382,7 +391,8 @@ public Experiment createExperiment(String displayId) throws SBOLGraphException { throw new SBOLGraphException("Display ids can be used to construct entities only if the base URI property of the document is set. Displayid:" + displayId); } } - + + @Valid public List getAttachments() throws SBOLGraphException { this.attachments=addToList(model, this.attachments, DataModel.Attachment.uri,Attachment.class); return attachments; @@ -475,15 +485,16 @@ public Activity createActivity(String displayId) throws SBOLGraphException { } } + @Valid public List getActivities() throws SBOLGraphException { this.activities=addToList(model, this.activities, ProvenanceDataModel.Activity.uri,Activity.class); return activities; } - private void initialisePrefix(Prefix prefix, String symbol, String name, float factor){ + private void initialisePrefix(Prefix prefix, String symbol, String name, float factor) throws SBOLGraphException{ prefix.setSymbol(symbol); prefix.setLabel(name); - prefix.setFactor(factor); + prefix.setFactor(Optional.of(factor)); } public SIPrefix createSIPrefix(URI namespace, URI uri, String symbol, String name, float factor) throws SBOLGraphException { @@ -505,6 +516,7 @@ public SIPrefix createSIPrefix(String displayId, String symbol, String name, flo } } + @Valid public List getSIPrefixes() throws SBOLGraphException { this.siPrefixes=addToList(model, this.siPrefixes, MeasureDataModel.SIPrefix.uri,SIPrefix.class); return siPrefixes; @@ -530,7 +542,7 @@ public BinaryPrefix createBinaryPrefix(String displayId, String symbol, String n } } - + @Valid public List getBinaryPrefixes() throws SBOLGraphException { this.binaryPrefixes=addToList(model, this.binaryPrefixes, MeasureDataModel.BinaryPrefix.uri,BinaryPrefix.class); return binaryPrefixes; @@ -585,6 +597,7 @@ public UnitMultiplication createUnitMultiplication(String displayId, String symb } } + @Valid public List getUnitMultiplications() throws SBOLGraphException { this.unitMultiplications=addToList(model, this.unitMultiplications, MeasureDataModel.UnitMultiplication.uri,UnitMultiplication.class); return unitMultiplications; @@ -602,7 +615,6 @@ public UnitDivision createUnitDivision(URI namespace, URI uri, String symbol, St return unit; } - public UnitDivision createUnitDivision(String displayId, String symbol, String name, URI numerator, URI denominator) throws SBOLGraphException { if (this.getBaseURI()!=null) { @@ -614,6 +626,7 @@ public UnitDivision createUnitDivision(String displayId, String symbol, String n } } + @Valid public List getUnitDivisions() throws SBOLGraphException { this.unitDivisions=addToList(model, this.unitDivisions, MeasureDataModel.UnitDivision.uri,UnitDivision.class); return unitDivisions; @@ -626,7 +639,7 @@ public UnitExponentiation createUnitExponentiation(URI namespace, URI uri, Strin unit.setSymbol(symbol); unit.setLabel(name); unit.setBase(baseUnit); - unit.setExponent(exponent); + unit.setExponent(Optional.of(exponent)); addToInMemoryList(unit, unitExponentiations); return unit; } @@ -642,12 +655,12 @@ public UnitExponentiation createUnitExponentiation(String displayId, String symb } } + @Valid public List getUnitExponentiations() throws SBOLGraphException { this.unitExponentiations=addToList(model, this.unitExponentiations, MeasureDataModel.UnitExponentiation.uri,UnitExponentiation.class); return unitExponentiations; } - public PrefixedUnit createPrexiedUnit(URI namespace, URI uri, String symbol, String name, URI unitURI, URI prefix) throws SBOLGraphException { PrefixedUnit unit = new PrefixedUnit(this.model, uri) {}; @@ -671,6 +684,7 @@ public PrefixedUnit createPrexiedUnit(String displayId, String symbol, String na } } + @Valid public List getPrefixedUnits() throws SBOLGraphException { this.prefixedUnits=addToList(model, this.prefixedUnits, MeasureDataModel.PrefixedUnit.uri,PrefixedUnit.class); return prefixedUnits; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Sequence.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Sequence.java index 33fd166..1ce7b49 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Sequence.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/Sequence.java @@ -6,12 +6,13 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.Encoding; public class Sequence extends TopLevel { - private String elements; - private Encoding encoding; + /*private String elements; + private Encoding encoding;*/ protected Sequence(Model model,URI uri) throws SBOLGraphException { @@ -23,34 +24,25 @@ protected Sequence(Resource resource) throws SBOLGraphException super(resource); } - public String getElements() { - if (elements==null) - { - elements=RDFUtil.getPropertyAsString(this.resource, DataModel.Sequence.elements); - } - return elements; + public String getElements() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsString(this.resource, DataModel.Sequence.elements); } public void setElements(String elements) { - this.elements = elements; - RDFUtil.setProperty(this.resource, DataModel.Sequence.elements, this.elements); + RDFUtil.setProperty(this.resource, DataModel.Sequence.elements, elements); } - public Encoding getEncoding() { - if (encoding==null) - { - URI encodingValue=RDFUtil.getPropertyAsURI(this.resource, DataModel.Sequence.encoding); - if (encodingValue!=null) - { - encoding=Encoding.get(encodingValue); - } + public Encoding getEncoding() throws SBOLGraphException { + Encoding encoding=null; + URI encodingValue=IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.Sequence.encoding); + if (encodingValue!=null){ + encoding=Encoding.get(encodingValue); } return encoding; } public void setEncoding(Encoding encoding) { - this.encoding = encoding; - RDFUtil.setProperty(this.resource, DataModel.Sequence.encoding, this.encoding.getUri()); + RDFUtil.setProperty(this.resource, DataModel.Sequence.encoding, encoding.getUri()); } public URI getResourceType() diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SequenceFeature.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SequenceFeature.java index 3153f9f..d97d522 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SequenceFeature.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SequenceFeature.java @@ -1,6 +1,7 @@ package org.sbolstandard.core3.entity; import java.net.URI; +import java.util.ArrayList; import java.util.List; import org.apache.jena.rdf.model.Model; @@ -14,8 +15,12 @@ import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public class SequenceFeature extends Feature{ - private List locations=null; + /*private List locations=null;*/ protected SequenceFeature(Model model,URI uri) throws SBOLGraphException { @@ -27,29 +32,43 @@ protected SequenceFeature(Resource resource) throws SBOLGraphException super(resource); } - public List getLocations() throws SBOLGraphException { - /*this.locations=addToList(this.locations, DataModel.SubComponent.location, Location.class, DataModel.Location.uri); - return locations;*/ - if (locations==null) + private void addToList(List listA, List listB) + { + if (listB!=null && listB.size()>0) { - List resources=RDFUtil.getResourcesWithProperty (resource, DataModel.SubComponent.location); - if (resources!=null) - { - for (Resource res:resources) - { - Location location= LocationFactory.create(res); - locations.add(location); - } - } + listA.addAll(listB); } - return locations; + } + + @NotEmpty(message = "{SEQUENCEFEATURE_LOCATIONS_NOT_EMPTY}") + public List getLocations() throws SBOLGraphException { + List locations=new ArrayList(); + addToList(locations,getCutLocations()); + addToList(locations,this.getRangeLocations()); + addToList(locations,getEntireSequenceLocations()); + return locations; + } + + @Valid + public List getCutLocations() throws SBOLGraphException { + return addToList(DataModel.SubComponent.location, Cut.class, DataModel.Cut.uri); + } + + @Valid + public List getRangeLocations() throws SBOLGraphException { + return addToList(DataModel.SubComponent.location, Range.class, DataModel.Range.uri); + } + + @Valid + public List getEntireSequenceLocations() throws SBOLGraphException { + return addToList(DataModel.SubComponent.location, EntireSequence.class, DataModel.EntireSequenceLocation.uri); } - public Location createLocation(LocationBuilder builder ) throws SBOLGraphException + public Location createLocation(LocationBuilder builder) throws SBOLGraphException { URI locationUri=SBOLAPI.createLocalUri(this,builder.getLocationTypeUri(),getLocations(),builder.getLocationClass()); Location location=builder.build(this.resource.getModel(),locationUri); - this.locations=addToList(this.locations, location, DataModel.SubComponent.location); + addToList(location, DataModel.SubComponent.location); return location; } @@ -65,7 +84,7 @@ private Location createLocation2(Location locationData) throws SBOLGraphExceptio location.resource.addProperty(stmt.getPredicate(), stmt.getObject()); } - this.locations=addToList(this.locations, location, DataModel.SubComponent.location); + addToList(location, DataModel.SubComponent.location); return location; } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SubComponent.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SubComponent.java index c430aee..36cfc8e 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SubComponent.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/SubComponent.java @@ -11,13 +11,18 @@ import org.sbolstandard.core3.entity.Location.LocationFactory; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + public class SubComponent extends Feature{ - private URI roleIntegration=null; + /*private URI roleIntegration=null; private URI isInstanceOf=null; private List locations=null; - private List sourceLocations=null; + private List sourceLocations=null;*/ protected SubComponent(Model model,URI uri) throws SBOLGraphException @@ -30,112 +35,83 @@ protected SubComponent(Resource resource) throws SBOLGraphException super(resource); } - - public URI getRoleIntegration() { - if (roleIntegration==null) - { - roleIntegration=RDFUtil.getPropertyAsURI(this.resource, DataModel.SubComponent.roleIntegration); - } - return roleIntegration; + public URI getRoleIntegration() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.SubComponent.roleIntegration); } public void setRoleIntegration(URI roleIntegration) { - this.roleIntegration = roleIntegration; - RDFUtil.setProperty(this.resource, DataModel.SubComponent.roleIntegration, this.roleIntegration); + RDFUtil.setProperty(this.resource, DataModel.SubComponent.roleIntegration, roleIntegration); } - - public URI getIsInstanceOf() { - if (isInstanceOf==null) - { - isInstanceOf=RDFUtil.getPropertyAsURI(this.resource, DataModel.SubComponent.instanceOf); - } - return isInstanceOf; + @NotNull(message = "{SUBCOMPONENT_ISINSTANCEOF_NOT_NULL}") + public URI getIsInstanceOf() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.SubComponent.instanceOf); } - public void setIsInstanceOf(URI isInstanceOf) { - this.isInstanceOf = isInstanceOf; - RDFUtil.setProperty(this.resource, DataModel.SubComponent.instanceOf, this.isInstanceOf); + public void setIsInstanceOf(@NotNull(message = "{SUBCOMPONENT_ISINSTANCEOF_NOT_NULL}") URI isInstanceOf) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setIsInstanceOf", new Object[] {isInstanceOf}, URI.class); + RDFUtil.setProperty(this.resource, DataModel.SubComponent.instanceOf, isInstanceOf); } - + @Valid public List getLocations() throws SBOLGraphException { - if (locations==null) - { - List resources=RDFUtil.getResourcesWithProperty (resource, DataModel.SubComponent.location); - if (resources!=null) - { - for (Resource res:resources) - { - Location location= LocationFactory.create(res); - locations.add(location); + return getLocations(DataModel.SubComponent.location); + } + + private List getLocations(URI property) throws SBOLGraphException + { + List locations=null; + List resources=RDFUtil.getResourcesWithProperty (resource, property); + if (resources!=null){ + for (Resource res:resources){ + if (locations==null){ + locations=new ArrayList(); } + Location location= LocationFactory.create(res); + locations.add(location); } } return locations; } - - public Location createLocation(LocationBuilder builder ) throws SBOLGraphException + public Location createLocation(LocationBuilder builder) throws SBOLGraphException { - //URI locationUri=SBOLAPI.createLocalUri(this,DataModel.Location.uri,getLocations()); - List allLocations=new ArrayList(); - if (getLocations()!=null) - { - allLocations.addAll(getLocations()); - } - if (sourceLocations!=null) - { - allLocations.addAll(getSourceLocations()); - } + return createLocation(builder, DataModel.SubComponent.location); + } + + private Location createLocation(LocationBuilder builder, URI property) throws SBOLGraphException + { + List allLocations=getAllLocations(); URI locationUri=SBOLAPI.createLocalUri(this,builder.getLocationTypeUri(),allLocations,builder.getLocationClass()); Location location=builder.build(this.resource.getModel(), locationUri); - this.locations=addToList(this.locations, location, DataModel.SubComponent.location); + addToList(location, property); return location; } - + @Valid public List getSourceLocations() throws SBOLGraphException { - if (sourceLocations==null) - { - List resources=RDFUtil.getResourcesWithProperty (resource, DataModel.SubComponent.sourceLocation); - if (resources!=null) - { - for (Resource res:resources) - { - Location location= LocationFactory.create(res); - sourceLocations.add(location); - } - } - - } - return sourceLocations; + return getLocations(DataModel.SubComponent.sourceLocation); } - - public Location createSourceLocation(LocationBuilder builder ) throws SBOLGraphException + private List getAllLocations() throws SBOLGraphException { - //URI locationUri=SBOLAPI.createLocalUri(this,DataModel.Location.uri,getSourceLocations()); List allLocations=new ArrayList(); - if (getLocations()!=null) + List locations=getLocations(); + List sourceLocations=getSourceLocations(); + if (locations!=null) { - allLocations.addAll(getLocations()); + allLocations.addAll(locations); } if (sourceLocations!=null) { - allLocations.addAll(getSourceLocations()); - } - URI locationUri=SBOLAPI.createLocalUri(this,builder.getLocationTypeUri(),allLocations,builder.getLocationClass()); - - Location sourceLocation=builder.build(this.resource.getModel(),locationUri); - RDFUtil.setProperty(resource, DataModel.SubComponent.sourceLocation, sourceLocation.getUri()); - - if (sourceLocations==null) - { - sourceLocations=new ArrayList(); - sourceLocations.add(sourceLocation); + allLocations.addAll(sourceLocations); } - return sourceLocation; + return allLocations; + } + + public Location createSourceLocation(LocationBuilder builder ) throws SBOLGraphException + { + return createLocation(builder, DataModel.SubComponent.sourceLocation); } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/TopLevel.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/TopLevel.java index 0bd13b4..d489d74 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/TopLevel.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/TopLevel.java @@ -1,23 +1,23 @@ package org.sbolstandard.core3.entity; -import java.net.MalformedURLException; import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; import java.util.List; - import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.util.SBOLUtil; -import org.sbolstandard.core3.util.URINameSpace; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + public abstract class TopLevel extends Identified { - private List attachments=null; - private URI namespace=null; + /*private List attachments=null; + private URI namespace=null;*/ protected TopLevel(Model model, URI uri) throws SBOLGraphException @@ -35,37 +35,38 @@ protected TopLevel (Resource resource) throws SBOLGraphException } public List getAttachments() { - if (attachments==null) - { - attachments=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.TopLevel.attachment); - } - return attachments; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.TopLevel.attachment); } public void setAttachments(List attachments) { - this.attachments = attachments; RDFUtil.setProperty(resource, DataModel.TopLevel.attachment, attachments); } - public URI getNamespace() { - if (namespace==null) - { - namespace=RDFUtil.getPropertyAsURI(this.resource, DataModel.TopLevel.namespace); - } - return namespace; + @NotNull(message = "{TOPLEVEL_NAMESPACE_NOT_NULL}") + public URI getNamespace() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.TopLevel.namespace); } - public void setNamespace(URI namespace) { - String uriString=namespace.toString(); - if (SBOLUtil.isURL(uriString)) + public void setNamespace(@NotNull(message = "{TOPLEVEL_NAMESPACE_NOT_NULL}") URI namespace) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setNamespace", new Object[] {namespace}, URI.class); + /*if (namespace==null) { - if (uriString.endsWith("/") || uriString.endsWith("#")) + throw new SBOLGraphException("Namespace cannot be null. URI:" + this.resource.getURI()); + }*/ + URI newURI=null; + if (namespace!=null){ + String uriString= namespace.toString(); + + if (SBOLUtil.isURL(uriString)) { - uriString=uriString.substring(0, uriString.length()-1); + if (uriString.endsWith("/") || uriString.endsWith("#")) + { + uriString=uriString.substring(0, uriString.length()-1); + } } + newURI=URI.create(uriString); } - this.namespace = URI.create(uriString); - RDFUtil.setProperty(resource, DataModel.TopLevel.namespace, this.namespace); + RDFUtil.setProperty(resource, DataModel.TopLevel.namespace, newURI); } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/VariableFeature.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/VariableFeature.java index c6f1791..3f47da8 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/VariableFeature.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/VariableFeature.java @@ -8,15 +8,21 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; +import org.sbolstandard.core3.vocabulary.Orientation; +import org.sbolstandard.core3.vocabulary.VariableFeatureCardinality; + +import jakarta.validation.constraints.NotNull; public class VariableFeature extends Identified{ - private URI cardinality=null; + /*private URI cardinality=null; private URI feature=null; private List variants=new ArrayList(); private List variantCollections=new ArrayList(); private List variantDerivations=new ArrayList(); - private List variantMeasures=new ArrayList(); + private List variantMeasures=new ArrayList();*/ protected VariableFeature(Model model,URI uri) throws SBOLGraphException @@ -29,86 +35,69 @@ protected VariableFeature(Resource resource) throws SBOLGraphException super(resource); } - public URI getCardinality() throws SBOLGraphException { - if (cardinality==null) + @NotNull(message = "{VARIABLEFEATURE_CARDINALITY_NOT_NULL}") + public VariableFeatureCardinality getCardinality() throws SBOLGraphException { + VariableFeatureCardinality cardinality=null; + URI value= IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.VariableComponent.cardinality); + if (value!=null) { - cardinality=RDFUtil.getPropertyAsURI(this.resource, DataModel.VariableComponent.cardinality); + cardinality=VariableFeatureCardinality.get(value); } return cardinality; } - public void setCardinality(URI cardinality) { - this.cardinality = cardinality; - RDFUtil.setProperty(resource, DataModel.VariableComponent.cardinality, cardinality); + public void setCardinality(@NotNull(message = "{VARIABLEFEATURE_CARDINALITY_NOT_NULL}") VariableFeatureCardinality cardinality) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setCardinality", new Object[] {cardinality}, VariableFeatureCardinality.class); + URI uri=null; + if (cardinality!=null) + { + uri=cardinality.getUri(); + } + RDFUtil.setProperty(resource, DataModel.VariableComponent.cardinality, uri); } + @NotNull(message = "{VARIABLEFEATURE_FEATURE_NOT_NULL}") public URI getFeature() throws SBOLGraphException { - if (feature==null) - { - feature=RDFUtil.getPropertyAsURI(this.resource, DataModel.VariableComponent.variable); - } - return feature; + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, DataModel.VariableComponent.variable); } - public void setFeature(URI variant) { - this.feature = variant; - RDFUtil.setProperty(resource, DataModel.VariableComponent.variable, variant); + public void setFeature(@NotNull(message = "{VARIABLEFEATURE_FEATURE_NOT_NULL}") URI feature) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setFeature", new Object[] {feature}, URI.class); + RDFUtil.setProperty(resource, DataModel.VariableComponent.variable, feature); } public List getVariants() { - if (variants==null) - { - variants=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variant); - } - return variants; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variant); } public void setVariants(List variants) { - this.variants = variants; RDFUtil.setProperty(resource, DataModel.VariableComponent.variant, variants); } public List getVariantCollections() { - if (variantCollections==null) - { - variantCollections=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variantCollection); - } - return variantCollections; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variantCollection); } public void setVariantCollections(List variantCollections) { - this.variantCollections = variantCollections; RDFUtil.setProperty(resource, DataModel.VariableComponent.variantCollection, variantCollections); } public List getVariantDerivations() { - if (variantDerivations==null) - { - variantDerivations=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variantDerivation); - } - return variantDerivations; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variantDerivation); } public void setVariantDerivations(List variantDerivations) { - this.variantDerivations = variantDerivations; RDFUtil.setProperty(resource, DataModel.VariableComponent.variantDerivation, variantDerivations); } - public List getVariantMeasures() { - if (this.variantMeasures==null) - { - variantMeasures=RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variantMeasure); - } - return variantMeasures; + return RDFUtil.getPropertiesAsURIs(this.resource, DataModel.VariableComponent.variantMeasure); } public void setVariantMeasures(List variantMeasures) { - this.variantMeasures = variantMeasures; RDFUtil.setProperty(resource, DataModel.VariableComponent.variantMeasure, variantMeasures); } - @Override public URI getResourceType() { return DataModel.VariableComponent.uri; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/BinaryPrefix.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/BinaryPrefix.java index 5ef5d9d..ed4ce0b 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/BinaryPrefix.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/BinaryPrefix.java @@ -18,7 +18,6 @@ protected BinaryPrefix(Resource resource) throws SBOLGraphException super(resource); } - @Override public URI getResourceType() { return MeasureDataModel.BinaryPrefix.uri; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/CompoundUnit.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/CompoundUnit.java index ba7c5e2..37d8988 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/CompoundUnit.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/CompoundUnit.java @@ -8,7 +8,6 @@ public abstract class CompoundUnit extends Unit{ - protected CompoundUnit(Model model,URI uri) throws SBOLGraphException { super(model, uri); diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Measure.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Measure.java index 1d17a06..4e858d1 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Measure.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Measure.java @@ -2,19 +2,29 @@ import java.net.URI; import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.entity.ControlledIdentified; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public class Measure extends ControlledIdentified{ - private float value=Float.NaN; + /*private float value=Float.NaN; private List types; - private URI unit; + private URI unit;*/ protected Measure(Model model,URI uri) throws SBOLGraphException { @@ -26,10 +36,12 @@ protected Measure(Resource resource) throws SBOLGraphException super(resource); } - public void setValue(float value) { - this.value = value; - String valueString=String.valueOf(value); - RDFUtil.setProperty(resource, MeasureDataModel.Measure.value, valueString); + //The first NotNull: value is not null, the second NotNull: Not empty. + public void setValue(@NotNull (message = "{MEASURE_VALUE_NOT_NULL}") Optional<@NotNull (message = "{MEASURE_VALUE_NOT_NULL}") Float> value) throws SBOLGraphException{ + //String valueString=String.valueOf(value); + //RDFUtil.setProperty(resource, MeasureDataModel.Measure.value, valueString); + PropertyValidator.getValidator().validate(this, "setValue", new Object[] {value}, Optional.class); + IdentityValidator.getValidator().setPropertyAsOptional(this.resource, MeasureDataModel.Measure.value, value); } /*public XSDFloat getFactor() throws SBOLGraphException { @@ -52,53 +64,59 @@ public void setValue(float value) { } */ - public float getValue() throws SBOLGraphException { - if (Float.isNaN(this.value)) - { - String valueString=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.Measure.value); - if (valueString!=null) + /*public float getValue() throws SBOLGraphException { + float value=Float.NaN; + String valueString=IdentityValidator.getValidator().getPropertyAsString(this.resource, MeasureDataModel.Measure.value); + if (valueString!=null){ + try{ + value= Float.parseFloat(valueString); + } + catch (Exception e) { - try - { - value= Float.parseFloat(valueString); - } - catch (Exception e) - { - throw new SBOLGraphException("Cannot read the value. Property:" + MeasureDataModel.Measure.value + " Uri:+ " + this.getUri(), e); - } + throw new SBOLGraphException("Cannot read the value. Property:" + MeasureDataModel.Measure.value + " Uri:+ " + this.getUri(), e); } } return value; + }*/ + + //@Valid + //@NotNull(message = "Measure.value cannot be null") + @NotNull (message = "{MEASURE_VALUE_NOT_NULL}") + public Optional<@NotNull (message = "{MEASURE_VALUE_NOT_NULL}") Float> getValue() throws SBOLGraphException { + Optional value= IdentityValidator.getValidator().getPropertyAsOptionalFloat(this.resource, MeasureDataModel.Measure.value); + return value; } + /* + private Optional test; + @NotNull(message = "Measure.test cannot be null") + public Optional<@NotNull Integer> getTest() throws SBOLGraphException { + return test; + } - public URI getUnit() { - if (unit==null) - { - unit=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.Measure.unit); - } - return unit; + public void setTest(Optional value) + { + this.test=value; + } + */ + @NotNull(message = "{MEASURE_UNIT_NOT_NULL}") + public URI getUnit() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.Measure.unit); } - public void setUnit(URI unit) { - this.unit = unit; + public void setUnit(@NotNull(message = "{MEASURE_UNIT_NOT_NULL}") URI unit) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setUnit", new Object[] {unit}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.Measure.unit, unit); } public List getTypes() { - if (types==null) - { - types=RDFUtil.getPropertiesAsURIs(this.resource,DataModel.type); - } - return types; + return RDFUtil.getPropertiesAsURIs(this.resource,DataModel.type); } public void setTypes(List types) { - this.types = types; RDFUtil.setProperty(resource, DataModel.type, types); } - @Override public URI getResourceType() { return MeasureDataModel.Measure.uri; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Prefix.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Prefix.java index 8100943..d211330 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Prefix.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Prefix.java @@ -1,16 +1,20 @@ package org.sbolstandard.core3.entity.measure; import java.net.URI; +import java.util.Optional; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; -import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.constraints.NotNull; + public abstract class Prefix extends Unit{ - private float factor=Float.NaN; - + //private float factor=Float.NaN; protected Prefix(Model model,URI uri) throws SBOLGraphException { super(model, uri); @@ -20,40 +24,19 @@ protected Prefix(Resource resource) throws SBOLGraphException { super(resource); } - - - - public void setFactor(float factor) { - this.factor = factor; - String factorString=String.valueOf(factor); - RDFUtil.setProperty(resource, MeasureDataModel.Prefix.factor, factorString); - //RDFUtil.setProperty(resource, MeasureDataModel.Prefix.factor, factor); - + + public void setFactor(@NotNull (message = "{PREFIX_FACTOR_NOT_NULL}") Optional<@NotNull (message = "{PREFIX_FACTOR_NOT_NULL}") Float> factor) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setFactor", new Object[] {factor}, Optional.class); + IdentityValidator.getValidator().setPropertyAsOptional(this.resource, MeasureDataModel.Prefix.factor, factor); } - public float getFactor() throws SBOLGraphException { - if (Float.isNaN(this.factor)) - { - String factorString=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.Prefix.factor); - if (factorString!=null) - { - try - { - factor= Float.parseFloat(factorString); - //(XSDFloat) XSDDatatype.XSDfloat.parse(factorString); - } - catch (Exception e) - { - throw new SBOLGraphException("Cannot read the factor value. Property:" + MeasureDataModel.Prefix.factor + " Uri:+ " + this.getUri(), e); - } - } - } - return factor; + @NotNull (message = "{PREFIX_FACTOR_NOT_NULL}") + public Optional<@NotNull (message = "{PREFIX_FACTOR_NOT_NULL}") Float> getFactor() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsOptionalFloat(this.resource, MeasureDataModel.Prefix.factor); } @Override public URI getResourceType() { return MeasureDataModel.Prefix.uri; - } - + } } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/PrefixedUnit.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/PrefixedUnit.java index 7a84c21..5f6d1b7 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/PrefixedUnit.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/PrefixedUnit.java @@ -1,17 +1,22 @@ package org.sbolstandard.core3.entity.measure; import java.net.URI; +import java.util.Optional; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.constraints.NotNull; + public class PrefixedUnit extends Unit{ - private URI prefix; - private URI unit; - + /*private URI prefix; + private URI unit;*/ protected PrefixedUnit(Model model,URI uri) throws SBOLGraphException { @@ -23,30 +28,23 @@ protected PrefixedUnit(Resource resource) throws SBOLGraphException super(resource); } - public URI getPrefix() { - if (prefix==null) - { - prefix=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.PrefixedUnit.prefix); - } - return prefix; + @NotNull(message = "{PREFIXEDUNIT_PREFIX_NOT_NULL}") + public URI getPrefix() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.PrefixedUnit.prefix); } - public void setPrefix(URI subject) { - this.prefix = subject; + public void setPrefix(@NotNull(message = "{PREFIXEDUNIT_PREFIX_NOT_NULL}") URI prefix) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setPrefix", new Object[] {prefix}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.PrefixedUnit.prefix, prefix); } - - public URI getUnit() { - if (unit==null) - { - unit=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.PrefixedUnit.unit); - } - return unit; + @NotNull(message = "{PREFIXEDUNIT_UNIT_NOT_NULL}") + public URI getUnit() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.PrefixedUnit.unit); } - public void setUnit(URI unit) { - this.unit = unit; + public void setUnit(@NotNull(message = "{PREFIXEDUNIT_UNIT_NOT_NULL}") URI unit) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setUnit", new Object[] {unit}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.PrefixedUnit.unit, unit); } @@ -54,5 +52,4 @@ public void setUnit(URI unit) { public URI getResourceType() { return MeasureDataModel.PrefixedUnit.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/SingularUnit.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/SingularUnit.java index 35276e8..1ccba5a 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/SingularUnit.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/SingularUnit.java @@ -1,16 +1,19 @@ package org.sbolstandard.core3.entity.measure; import java.net.URI; +import java.util.Optional; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; import org.sbolstandard.core3.vocabulary.MeasureDataModel; public class SingularUnit extends Unit{ - private float factor=Float.NaN; - private URI unit; + //private float factor=Float.NaN; + //private URI unit; protected SingularUnit(Model model,URI uri) throws SBOLGraphException { @@ -22,50 +25,24 @@ protected SingularUnit(Resource resource) throws SBOLGraphException super(resource); } - public void setFactor(float factor) { - this.factor = factor; - String factorString=String.valueOf(factor); - RDFUtil.setProperty(resource, MeasureDataModel.SingularUnit.factor, factorString); - //RDFUtil.setProperty(resource, MeasureDataModel.Prefix.factor, factor); + public void setFactor(Optionalfactor) throws SBOLGraphException { + IdentityValidator.getValidator().setPropertyAsOptional(this.resource, MeasureDataModel.SingularUnit.factor, factor); } - public float getFactor() throws SBOLGraphException { - if (Float.isNaN(this.factor)) - { - String factorString=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.SingularUnit.factor); - if (factorString!=null) - { - try - { - factor= Float.parseFloat(factorString); - //(XSDFloat) XSDDatatype.XSDfloat.parse(factorString); - } - catch (Exception e) - { - throw new SBOLGraphException("Cannot read the factor value. Property:" + MeasureDataModel.SingularUnit.factor + " Uri:+ " + this.getUri(), e); - } - } - } - return factor; + public Optional getFactor() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsOptionalFloat(this.resource, MeasureDataModel.SingularUnit.factor); } - public URI getUnit() { - if (unit==null) - { - unit=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.SingularUnit.unit); - } - return unit; + public URI getUnit() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.SingularUnit.unit); } public void setUnit(URI unit) { - this.unit = unit; RDFUtil.setProperty(resource, MeasureDataModel.SingularUnit.unit, unit); } - @Override public URI getResourceType() { return MeasureDataModel.SingularUnit.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Unit.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Unit.java index e214443..647bd4b 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Unit.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/Unit.java @@ -7,17 +7,22 @@ import org.sbolstandard.core3.entity.ControlledTopLevel; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; + public abstract class Unit extends ControlledTopLevel{ - private String symbol; + /*private String symbol; private List alternativeSymbols; private String label; private List alternativeLabels; private String comment; - private String longComment; + private String longComment;*/ protected Unit(Model model,URI uri) throws SBOLGraphException { @@ -29,111 +34,86 @@ protected Unit(Resource resource) throws SBOLGraphException super(resource); } - public String getSymbol() { - if (symbol==null) - { - symbol=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.Unit.symbol); - } - return symbol; + @NotEmpty(message = "{UNIT_SYMBOL_NOT_EMPTY}") + public String getSymbol() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsString(this.resource, MeasureDataModel.Unit.symbol); } - public void setSymbol(String symbol) { - this.symbol = symbol; + public void setSymbol(@NotEmpty(message = "{UNIT_SYMBOL_NOT_EMPTY}") String symbol) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setSymbol", new Object[] {symbol}, String.class); RDFUtil.setProperty(resource, MeasureDataModel.Unit.symbol, symbol); } public List getAlternativeSymbols() { - if (alternativeSymbols==null) - { - alternativeSymbols=RDFUtil.getPropertiesAsStrings(this.resource, MeasureDataModel.Unit.alternativeSymbol); - } - return alternativeSymbols; + return RDFUtil.getPropertiesAsStrings(this.resource, MeasureDataModel.Unit.alternativeSymbol); } public void setAlternativeSymbols(List alternativeSymbols) { - this.alternativeSymbols = alternativeSymbols; RDFUtil.setPropertyAsStrings(resource, MeasureDataModel.Unit.alternativeSymbol, alternativeSymbols); } - - public String getLabel() { - if (label==null) - { - label=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.Unit.label); - } - return label; + @NotEmpty(message = "{UNIT_LABEL_NOT_EMPTY}") + public String getLabel() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsString(this.resource, MeasureDataModel.Unit.label); } - public void setLabel(String label) { - this.label = label; + public void setLabel(@NotEmpty(message = "{UNIT_LABEL_NOT_EMPTY}") String label) throws SBOLGraphException{ + PropertyValidator.getValidator().validate(this, "setLabel", new Object[] {label}, String.class); RDFUtil.setProperty(resource, MeasureDataModel.Unit.label, label); - if (!label.equals(getName())) - { + + if (label!=null && !label.isEmpty() && !label.equals(getName())){ setName(label); } } public List getAlternativeLabels() { - if (alternativeLabels==null) - { - alternativeLabels=RDFUtil.getPropertiesAsStrings(this.resource, MeasureDataModel.Unit.alternativeLabel); - } - return alternativeLabels; + return RDFUtil.getPropertiesAsStrings(this.resource, MeasureDataModel.Unit.alternativeLabel); } public void setAlternativeLabels(List alternativeLabels) { - this.alternativeLabels = alternativeLabels; RDFUtil.setPropertyAsStrings(resource, MeasureDataModel.Unit.alternativeLabel, alternativeLabels); } @Override - public void setName(String name) + public void setName(String name) throws SBOLGraphException { super.setName(name); - if (!name.equals(getLabel())) + + if (name!=null && !name.equals(getLabel())) { setLabel(name); } } @Override - public void setDescription(String description) + public void setDescription(String description) throws SBOLGraphException { super.setDescription(description); - if (!description.equals(getComment())) + + if (description!=null && !description.equals(getComment())) { setComment(description); } } - public String getComment() { - if (comment==null) - { - comment=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.Unit.comment); - } - return comment; + public String getComment() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsString(this.resource, MeasureDataModel.Unit.comment); } - public void setComment(String comment) { - this.comment = comment; + public void setComment(String comment) throws SBOLGraphException { RDFUtil.setProperty(resource, MeasureDataModel.Unit.comment, comment); - if (!comment.equals(getDescription())) + if (comment!=null && !comment.equals(getDescription())) { setDescription(comment); } } - public String getLongComment() { - if (longComment==null) - { - longComment=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.Unit.longComment); - } - return longComment; + public String getLongComment() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsString(this.resource, MeasureDataModel.Unit.longComment); } public void setLongComment(String longComment) { - this.longComment = longComment; RDFUtil.setProperty(resource, MeasureDataModel.Unit.longComment, longComment); } @@ -141,5 +121,4 @@ public void setLongComment(String longComment) { public URI getResourceType() { return MeasureDataModel.Unit.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitDivision.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitDivision.java index 0a2b090..525934a 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitDivision.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitDivision.java @@ -5,13 +5,15 @@ import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.constraints.NotNull; + public class UnitDivision extends CompoundUnit{ - - private URI numerator; - private URI denominator; - + /*private URI numerator; + private URI denominator;*/ protected UnitDivision(Model model,URI uri) throws SBOLGraphException { @@ -23,36 +25,28 @@ protected UnitDivision(Resource resource) throws SBOLGraphException super(resource); } - public URI getNumerator() { - if (numerator==null) - { - numerator=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.UnitDivision.numerator); - } - return numerator; + @NotNull(message = "{UNITDIVISION_NUMERATOR_NOT_NULL}") + public URI getNumerator() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.UnitDivision.numerator); } - public void setNumerator(URI numerator) { - this.numerator = numerator; + public void setNumerator(@NotNull(message = "{UNITDIVISION_NUMERATOR_NOT_NULL}") URI numerator) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setNumerator", new Object[] {numerator}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.UnitDivision.numerator, numerator); } - public URI getDenominator() { - if (denominator==null) - { - denominator=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.UnitDivision.denominator); - } - return denominator; + @NotNull(message = "{UNITDIVISION_DENOMINATOR__NOT_NULL}") + public URI getDenominator() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.UnitDivision.denominator); } - public void setDenominator(URI denominator) { - this.denominator = denominator; + public void setDenominator(@NotNull(message = "{UNITDIVISION_DENOMINATOR__NOT_NULL}") URI denominator) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setDenominator", new Object[] {denominator}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.UnitDivision.denominator, denominator); } - @Override public URI getResourceType() { return MeasureDataModel.UnitDivision.uri; - } - + } } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitExponentiation.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitExponentiation.java index 20ed012..bfc3583 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitExponentiation.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitExponentiation.java @@ -1,17 +1,24 @@ package org.sbolstandard.core3.entity.measure; import java.net.URI; +import java.util.Optional; +import java.util.OptionalInt; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; +import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.constraints.NotNull; + public class UnitExponentiation extends CompoundUnit{ - private URI base; - private int exponent=Integer.MIN_VALUE; + /*private URI base; + private int exponent=Integer.MIN_VALUE;*/ protected UnitExponentiation(Model model,URI uri) throws SBOLGraphException @@ -24,37 +31,26 @@ protected UnitExponentiation(Resource resource) throws SBOLGraphException super(resource); } - public URI getBase() { - if (base==null) - { - base=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.UnitExponentiation.base); - } - return base; + @NotNull(message = "{UNITEXPONENTIATION_BASE_NOT_NULL}") + public URI getBase() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.UnitExponentiation.base); } - public void setBase(URI base) { - this.base = base; + public void setBase(@NotNull(message = "{UNITEXPONENTIATION_BASE_NOT_NULL}") URI base) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setBase", new Object[] {base}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.UnitExponentiation.base, base); } - public int getExponent() { - if (exponent==Integer.MIN_VALUE) - { - String value=RDFUtil.getPropertyAsString(this.resource, MeasureDataModel.UnitExponentiation.exponent); - if (value!=null) - { - exponent=Integer.valueOf(value); - } - } - return exponent; + @NotNull(message = "{UNITEXPONENTIATION_EXPONENT_NOT_EMPTY}") + public Optional<@NotNull(message = "{UNITEXPONENTIATION_EXPONENT_NOT_EMPTY}") Integer> getExponent() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsOptionalInteger(this.resource, MeasureDataModel.UnitExponentiation.exponent); } - public void setExponent(int exponent) { - this.exponent = exponent; - RDFUtil.setProperty(resource, MeasureDataModel.UnitExponentiation.exponent, String.valueOf(exponent)); + public void setExponent(@NotNull(message = "{UNITEXPONENTIATION_EXPONENT_NOT_EMPTY}") Optional<@NotNull(message = "{UNITEXPONENTIATION_EXPONENT_NOT_EMPTY}") Integer> exponent) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setExponent", new Object[] {exponent}, Optional.class); + IdentityValidator.getValidator().setPropertyAsOptional(this.resource, MeasureDataModel.UnitExponentiation.exponent, exponent); } - - + @Override public URI getResourceType() { return MeasureDataModel.UnitExponentiation.uri; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitMultiplication.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitMultiplication.java index c748fd4..dc6b355 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitMultiplication.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/measure/UnitMultiplication.java @@ -1,18 +1,21 @@ package org.sbolstandard.core3.entity.measure; import java.net.URI; +import java.util.Optional; + import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Resource; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.MeasureDataModel; +import jakarta.validation.constraints.NotNull; + public class UnitMultiplication extends CompoundUnit{ - - private URI term1; - private URI term2; - - + /*private URI term1; + private URI term2;*/ protected UnitMultiplication(Model model,URI uri) throws SBOLGraphException { super(model, uri); @@ -23,36 +26,28 @@ protected UnitMultiplication(Resource resource) throws SBOLGraphException super(resource); } - public URI getTerm1() { - if (term1==null) - { - term1=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.UnitMultiplication.term1); - } - return term1; + @NotNull(message = "{UNITMULTIPLICATION_TERM1_NOT_NULL}") + public URI getTerm1() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.UnitMultiplication.term1); } - public void setTerm1(URI term1) { - this.term1 = term1; + public void setTerm1(@NotNull(message = "UNITMULTIPLICATION_TERM1_NOT_NULL}") URI term1) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setTerm1", new Object[] {term1}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.UnitMultiplication.term1, term1); } - public URI getTerm2() { - if (term2==null) - { - term2=RDFUtil.getPropertyAsURI(this.resource, MeasureDataModel.UnitMultiplication.term2); - } - return term2; + @NotNull(message = "UNITMULTIPLICATION_TERM2_NOT_NULL}") + public URI getTerm2() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, MeasureDataModel.UnitMultiplication.term2); } - public void setTerm2(URI term2) { - this.term2 = term2; + public void setTerm2(@NotNull(message = "UNITMULTIPLICATION_TERM2_NOT_NULL}") URI term2) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setTerm2", new Object[] {term2}, URI.class); RDFUtil.setProperty(resource, MeasureDataModel.UnitMultiplication.term2, term2); } - @Override public URI getResourceType() { return MeasureDataModel.UnitMultiplication.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Activity.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Activity.java index f4bd64c..83e1fdf 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Activity.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Activity.java @@ -11,15 +11,18 @@ import org.sbolstandard.core3.entity.ControlledTopLevel; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; import org.sbolstandard.core3.vocabulary.ProvenanceDataModel; +import jakarta.validation.Valid; + public class Activity extends ControlledTopLevel{ - private XSDDateTime startedAtTime=null; + /*private XSDDateTime startedAtTime=null; private XSDDateTime endedAtTime=null; private List types=null; private List usages=null; private List associations=null; - private List wasInformedBys=null; + private List wasInformedBys=null;*/ protected Activity(Model model,URI uri) throws SBOLGraphException { @@ -32,19 +35,15 @@ protected Activity(Resource resource) throws SBOLGraphException } public XSDDateTime getStartedAtTime() throws SBOLGraphException { - if (startedAtTime==null) - { - String startedAtTimeString=RDFUtil.getPropertyAsString(this.resource, ProvenanceDataModel.Activity.startedAtTime); - if (startedAtTimeString!=null) - { - try - { - startedAtTime= (XSDDateTime) XSDDateType.XSDdateTime.parse(startedAtTimeString); - } - catch (Exception e) - { - throw new SBOLGraphException("Cannot read the datetime value. Property:" + ProvenanceDataModel.Activity.startedAtTime + " Uri:+ " + this.getUri(), e); - } + XSDDateTime startedAtTime=null; + + String startedAtTimeString=IdentityValidator.getValidator().getPropertyAsString(this.resource, ProvenanceDataModel.Activity.startedAtTime); + if (startedAtTimeString!=null){ + try{ + startedAtTime= (XSDDateTime) XSDDateType.XSDdateTime.parse(startedAtTimeString); + } + catch (Exception e){ + throw new SBOLGraphException("Cannot read the datetime value. Property:" + ProvenanceDataModel.Activity.startedAtTime + " Uri:+ " + this.getUri(), e); } } return startedAtTime; @@ -53,28 +52,21 @@ public XSDDateTime getStartedAtTime() throws SBOLGraphException { public void setStartedAtTime(XSDDateTime dateTime) { if (dateTime!=null) { - this.startedAtTime = dateTime; String timestring=dateTime.toString(); RDFUtil.setProperty(resource, ProvenanceDataModel.Activity.startedAtTime, timestring); } } - - public XSDDateTime getEndedAtTime() throws SBOLGraphException { - if (endedAtTime==null) - { - String timeString=RDFUtil.getPropertyAsString(this.resource, ProvenanceDataModel.Activity.endedAtTime); - if (timeString!=null) - { - try - { - endedAtTime= (XSDDateTime) XSDDateType.XSDdateTime.parse(timeString); - } - catch (Exception e) - { - throw new SBOLGraphException("Cannot read the datetime value. Property:" + ProvenanceDataModel.Activity.endedAtTime + " Uri:+ " + this.getUri(), e); - } + XSDDateTime endedAtTime=null; + + String timeString=IdentityValidator.getValidator().getPropertyAsString(this.resource, ProvenanceDataModel.Activity.endedAtTime); + if (timeString!=null){ + try{ + endedAtTime= (XSDDateTime) XSDDateType.XSDdateTime.parse(timeString); + } + catch (Exception e){ + throw new SBOLGraphException("Cannot read the datetime value. Property:" + ProvenanceDataModel.Activity.endedAtTime + " Uri:+ " + this.getUri(), e); } } return endedAtTime; @@ -82,50 +74,37 @@ public XSDDateTime getEndedAtTime() throws SBOLGraphException { public void setEndedAtTime(XSDDateTime dateTime) { if (dateTime!=null) { - this.endedAtTime = dateTime; String timestring=dateTime.toString(); RDFUtil.setProperty(resource, ProvenanceDataModel.Activity.endedAtTime, timestring); } } - - + public List getTypes() { - if (types==null) - { - types=RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Activity.type); - } - return types; + return RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Activity.type); } public void setTypes(List types) { - this.types = types; RDFUtil.setProperty(resource, ProvenanceDataModel.Activity.type, types); } public List getWasInformedBys() { - if (wasInformedBys==null) - { - wasInformedBys=RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Activity.wasInformedBy); - } - return wasInformedBys; + return RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Activity.wasInformedBy); } public void setWasInformedBys(List wasInformedBys) { - this.wasInformedBys = wasInformedBys; RDFUtil.setProperty(resource, ProvenanceDataModel.Activity.wasInformedBy, wasInformedBys); } - + @Valid public List getUsages() throws SBOLGraphException { - this.usages=addToList(this.usages, ProvenanceDataModel.Activity.qualifiedUsage, Usage.class, ProvenanceDataModel.Usage.uri); - return this.usages; + return addToList(ProvenanceDataModel.Activity.qualifiedUsage, Usage.class, ProvenanceDataModel.Usage.uri); } public Usage createUsage(URI uri, URI entity) throws SBOLGraphException { Usage usage= new Usage(this.resource.getModel(), uri); usage.setEntity(entity); - this.usages=addToList (this.usages, usage, ProvenanceDataModel.Activity.qualifiedUsage); + addToList (usage, ProvenanceDataModel.Activity.qualifiedUsage); return usage; } @@ -135,16 +114,16 @@ public Usage createUsage(URI entity) throws SBOLGraphException return createUsage(childUri, entity); } + @Valid public List getAssociations() throws SBOLGraphException { - this.associations=addToList(this.associations, ProvenanceDataModel.Activity.qualifiedAssociation, Association.class, ProvenanceDataModel.Association.uri); - return this.associations; + return addToList(ProvenanceDataModel.Activity.qualifiedAssociation, Association.class, ProvenanceDataModel.Association.uri); } public Association createAssociation(URI uri, URI agent) throws SBOLGraphException { Association association= new Association(this.resource.getModel(), uri); association.setAgent(agent); - this.associations=addToList (this.associations, association, ProvenanceDataModel.Activity.qualifiedAssociation); + addToList (association, ProvenanceDataModel.Activity.qualifiedAssociation); return association; } @@ -158,5 +137,4 @@ public Association createAssociation(URI agent) throws SBOLGraphException public URI getResourceType() { return ProvenanceDataModel.Activity.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Agent.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Agent.java index b83399f..817c7c8 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Agent.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Agent.java @@ -19,7 +19,6 @@ protected Agent(Resource resource) throws SBOLGraphException super(resource); } - @Override public URI getResourceType() { return ProvenanceDataModel.Agent.uri; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Association.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Association.java index 4f856c0..88ca32d 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Association.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Association.java @@ -8,15 +8,17 @@ import org.sbolstandard.core3.entity.ControlledIdentified; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.ProvenanceDataModel; +import jakarta.validation.constraints.NotNull; + public class Association extends ControlledIdentified{ - private List roles=null; + /*private List roles=null; private URI plan=null; - private URI agent=null; - - + private URI agent=null;*/ protected Association(Model model,URI uri) throws SBOLGraphException { super(model, uri); @@ -28,48 +30,33 @@ protected Association(Resource resource) throws SBOLGraphException } public List getRoles() { - if (roles==null) - { - roles=RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Association.role); - } - return roles; + return RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Association.role); } public void setRoles(List roles) { - this.roles = roles; RDFUtil.setProperty(resource, ProvenanceDataModel.Association.role, roles); } - public URI getPlan() { - if (plan==null) - { - plan=RDFUtil.getPropertyAsURI(this.resource, ProvenanceDataModel.Association.plan); - } - return plan; + public URI getPlan() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, ProvenanceDataModel.Association.plan); } public void setPlan(URI plan) { - this.plan = plan; RDFUtil.setProperty(resource, ProvenanceDataModel.Association.plan, plan); } - public URI getAgent() { - if (agent==null) - { - agent=RDFUtil.getPropertyAsURI(this.resource, ProvenanceDataModel.Association.agent); - } - return agent; + @NotNull(message = "{ASSOCIATION_AGENT_NOT_NULL}") + public URI getAgent() throws SBOLGraphException{ + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, ProvenanceDataModel.Association.agent); } - public void setAgent(URI agent) { - this.agent = agent; + public void setAgent(@NotNull(message = "{ASSOCIATION_AGENT_NOT_NULL}") URI agent) throws SBOLGraphException{ + PropertyValidator.getValidator().validate(this, "setAgent", new Object[] {agent}, URI.class); RDFUtil.setProperty(resource, ProvenanceDataModel.Association.agent, agent); } - @Override public URI getResourceType() { return ProvenanceDataModel.Association.uri; } - } \ No newline at end of file diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Plan.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Plan.java index ed62c1a..44e2ec3 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Plan.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Plan.java @@ -19,7 +19,6 @@ protected Plan(Resource resource) throws SBOLGraphException super(resource); } - @Override public URI getResourceType() { return ProvenanceDataModel.Plan.uri; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Usage.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Usage.java index b1fa7d7..db5ef15 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Usage.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/entity/provenance/Usage.java @@ -7,13 +7,16 @@ import org.sbolstandard.core3.entity.ControlledIdentified; import org.sbolstandard.core3.util.RDFUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.validation.PropertyValidator; import org.sbolstandard.core3.vocabulary.ProvenanceDataModel; +import jakarta.validation.constraints.NotNull; + public class Usage extends ControlledIdentified{ - private URI entity=null; - private List roles=null; + /*private URI entity=null; + private List roles=null;*/ - protected Usage(Model model,URI uri) throws SBOLGraphException { super(model, uri); @@ -24,33 +27,24 @@ protected Usage(Resource resource) throws SBOLGraphException super(resource); } - public URI getEntity() { - if (entity==null) - { - entity=RDFUtil.getPropertyAsURI(this.resource, ProvenanceDataModel.Usage.entity); - } - return entity; + @NotNull(message = "{USAGE_ENTITY_NOT_NULL}") + public URI getEntity() throws SBOLGraphException { + return IdentityValidator.getValidator().getPropertyAsURI(this.resource, ProvenanceDataModel.Usage.entity); } - public void setEntity(URI entity) { - this.entity = entity; + public void setEntity(@NotNull(message = "{USAGE_ENTITY_NOT_NULL}") URI entity) throws SBOLGraphException { + PropertyValidator.getValidator().validate(this, "setEntity", new Object[] {entity}, URI.class); RDFUtil.setProperty(resource, ProvenanceDataModel.Usage.entity, entity); } public List getRoles() { - if (roles==null) - { - roles=RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Usage.role); - } - return roles; + return RDFUtil.getPropertiesAsURIs(this.resource, ProvenanceDataModel.Usage.role); } public void setRoles(List roles) { - this.roles = roles; RDFUtil.setProperty(resource, ProvenanceDataModel.Usage.role, roles); } - @Override public URI getResourceType() { return ProvenanceDataModel.Usage.uri; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/io/SBOLIO.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/io/SBOLIO.java index 7c4ca58..1fdb4d9 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/io/SBOLIO.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/io/SBOLIO.java @@ -13,40 +13,72 @@ import org.apache.jena.rdf.model.Resource; import org.apache.jena.riot.RDFFormat; import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; import org.sbolstandard.core3.util.RDFUtil; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.SBOLValidator; public class SBOLIO{ - public static String write(SBOLDocument doc, SBOLFormat format) throws IOException + public static String write(SBOLDocument doc, SBOLFormat format) throws IOException, SBOLGraphException { return write(doc, format.getFormat()); } - public static String write(SBOLDocument doc, RDFFormat format) throws IOException + private static boolean isValid(SBOLDocument doc) throws SBOLGraphException { - String output=RDFUtil.write(doc.getRDFModel(), format, getTopLevelResources(doc)); + boolean isValid=true; + if (Configuration.getConfiguration().getPropertyValidationType()==PropertyValidationType.ValidateBeforeSavingSBOLDocuments) + { + isValid=SBOLValidator.getValidator().isValid(doc); + } + return isValid; + } + + private static void assertValid(SBOLDocument doc) throws SBOLGraphException + { + if (Configuration.getConfiguration().validateAfterReadingSBOLDocuments()) + { + SBOLValidator.getValidator().isValid(doc); + } + } + + public static String write(SBOLDocument doc, RDFFormat format) throws IOException, SBOLGraphException + { + String output=null; + if (isValid(doc)) + { + output=RDFUtil.write(doc.getRDFModel(), format, getTopLevelResources(doc)); + } return output; } - public static void write(SBOLDocument doc, File file, SBOLFormat format) throws FileNotFoundException, IOException + public static void write(SBOLDocument doc, File file, SBOLFormat format) throws FileNotFoundException, IOException, SBOLGraphException { write(doc, file, format.getFormat()); } - public static void write(SBOLDocument doc, File file, RDFFormat format) throws FileNotFoundException, IOException + public static void write(SBOLDocument doc, File file, RDFFormat format) throws FileNotFoundException, IOException, SBOLGraphException { - RDFUtil.write(doc.getRDFModel(), file, format, getTopLevelResources(doc)); + if (isValid(doc)) + { + RDFUtil.write(doc.getRDFModel(), file, format, getTopLevelResources(doc)); + } } - public static void write(SBOLDocument doc, OutputStream stream, SBOLFormat format) throws FileNotFoundException, IOException + public static void write(SBOLDocument doc, OutputStream stream, SBOLFormat format) throws FileNotFoundException, IOException, SBOLGraphException { write(doc, stream, format.getFormat()); } - public static void write(SBOLDocument doc, OutputStream stream, RDFFormat format) throws FileNotFoundException, IOException + public static void write(SBOLDocument doc, OutputStream stream, RDFFormat format) throws FileNotFoundException, IOException, SBOLGraphException { - RDFUtil.write(doc.getRDFModel(), stream, format, getTopLevelResources(doc)); + if (isValid(doc)) + { + RDFUtil.write(doc.getRDFModel(), stream, format, getTopLevelResources(doc)); + } } /*private static Resource[] getTopLevelResources() @@ -99,41 +131,45 @@ public static SBOLDocument readOld(File file, String format) throws FileNotFound return doc; }*/ - public static SBOLDocument read(File file, SBOLFormat format) throws FileNotFoundException + public static SBOLDocument read(File file, SBOLFormat format) throws FileNotFoundException, SBOLGraphException { return read(file, format.getFormat()); } - public static SBOLDocument read(File file, RDFFormat format) throws FileNotFoundException + public static SBOLDocument read(File file, RDFFormat format) throws FileNotFoundException, SBOLGraphException { Model model = RDFUtil.read(file,format) ; SBOLDocument doc=new SBOLDocument(model); + assertValid(doc); return doc; } - public static SBOLDocument read(File file) throws FileNotFoundException + public static SBOLDocument read(File file) throws FileNotFoundException, SBOLGraphException { Model model = RDFUtil.read(file) ; SBOLDocument doc=new SBOLDocument(model); + assertValid(doc); return doc; } - public static SBOLDocument read(URI uri, SBOLFormat format) throws FileNotFoundException + public static SBOLDocument read(URI uri, SBOLFormat format) throws FileNotFoundException, SBOLGraphException { return read(uri, format.getFormat()); } - public static SBOLDocument read(URI uri, RDFFormat format) throws FileNotFoundException + public static SBOLDocument read(URI uri, RDFFormat format) throws FileNotFoundException, SBOLGraphException { Model model = RDFUtil.read(uri,format) ; SBOLDocument doc=new SBOLDocument(model); + assertValid(doc); return doc; } - public static SBOLDocument read(URI uri) throws FileNotFoundException + public static SBOLDocument read(URI uri) throws FileNotFoundException, SBOLGraphException { Model model = RDFUtil.read(uri) ; SBOLDocument doc=new SBOLDocument(model); + assertValid(doc); return doc; } @@ -144,15 +180,16 @@ public static SBOLDocument read(URI uri) throws FileNotFoundException return doc; }*/ - public static SBOLDocument read(String input, SBOLFormat format) throws FileNotFoundException + public static SBOLDocument read(String input, SBOLFormat format) throws FileNotFoundException, SBOLGraphException { return read(input, format.getFormat()); } - public static SBOLDocument read(String input, RDFFormat format) throws FileNotFoundException + public static SBOLDocument read(String input, RDFFormat format) throws FileNotFoundException, SBOLGraphException { Model model = RDFUtil.read(input, format) ; SBOLDocument doc=new SBOLDocument(model); + assertValid(doc); return doc; } @@ -163,19 +200,19 @@ public static SBOLDocument read(String input, RDFFormat format) throws FileNotFo return doc; }*/ - public static SBOLDocument read(InputStream stream, SBOLFormat format) throws FileNotFoundException + public static SBOLDocument read(InputStream stream, SBOLFormat format) throws FileNotFoundException, SBOLGraphException { return read(stream, format.getFormat()); } - public static SBOLDocument read(InputStream stream, RDFFormat format) throws FileNotFoundException + public static SBOLDocument read(InputStream stream, RDFFormat format) throws FileNotFoundException, SBOLGraphException { Model model = RDFUtil.read(stream, format) ; SBOLDocument doc=new SBOLDocument(model); + assertValid(doc); return doc; } - /*private static Object createChildEntity(Object parent, String childEntityType, String uri) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { String methodName="create" + childEntityType; @@ -209,9 +246,5 @@ public static SBOLDocument read(String sbolData, String format) throws Exception return populateSBOLDocument(model); }*/ - - - - } diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/util/Configuration.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/util/Configuration.java new file mode 100644 index 0000000..62d37f2 --- /dev/null +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/util/Configuration.java @@ -0,0 +1,65 @@ +package org.sbolstandard.core3.util; + + +public class Configuration { + private static Configuration configuration = null; + + private boolean enforceOneToOneRelationships=true; + private PropertyValidationType validationActionTypeToSave=PropertyValidationType.ValidateAfterSettingProperties; + private boolean validateAfterReadingSBOLDocuments=true; + + + + public PropertyValidationType getPropertyValidationType() { + return validationActionTypeToSave; + } + + /*** + * Set this parameter to enforce validating SBOL graphs before writing to the disk. + * @param validationActionTypeToSave + */ + public void setPropertyValidationType(PropertyValidationType validationActionTypeToSave) { + this.validationActionTypeToSave = validationActionTypeToSave; + } + + public boolean validateAfterReadingSBOLDocuments() { + return validateAfterReadingSBOLDocuments; + } + + public void setValidateAfterReadingSBOLDocuments(boolean validateAfterReadingSBOLDocuments) { + this.validateAfterReadingSBOLDocuments = validateAfterReadingSBOLDocuments; + } + + public boolean enforceOneToOneRelationships() { + return this.enforceOneToOneRelationships; + } + + /*** + * When set to true, it will enforce one-to-one relationships for SBOL graphs that are generated by other tools. For performance reasons, + * if the graphs are created by libSBOLj, then this property can be set to false. + * @param enforceOneToOneRelationships + */ + public void setEnforceOneToOneRelationships(boolean enforceOneToOneRelationships) { + this.enforceOneToOneRelationships = enforceOneToOneRelationships; + } + + private Configuration() + { + + } + + public static Configuration getConfiguration() + { + if (configuration == null) + { + configuration=new Configuration(); + } + return configuration; + } + + public enum PropertyValidationType{ + ValidateBeforeSavingSBOLDocuments, + ValidateAfterSettingProperties, + NoValidation + } +} diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/util/RDFUtil.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/util/RDFUtil.java index f5c4ef8..b1a556f 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/util/RDFUtil.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/util/RDFUtil.java @@ -12,6 +12,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.OptionalInt; + import org.apache.jena.datatypes.xsd.impl.XSDFloat; import org.apache.jena.query.Query; import org.apache.jena.query.QueryExecution; @@ -38,6 +40,8 @@ import org.apache.jena.riot.SysRIOT; import org.apache.jena.sparql.util.Context; import org.apache.jena.vocabulary.RDF; +import org.sbolstandard.core3.validation.IdentityValidator; +import org.sbolstandard.core3.vocabulary.DataModel; //IO: https://jena.apache.org/documentation/io/rdf-input.html //https://jena.apache.org/tutorials/rdf_api.html#ch-Writing-RDF @@ -97,9 +101,10 @@ public static void addType(Resource resource, URI type) private static void removeIfExists(Resource resource, Property p) { - StmtIterator stmt =resource.listProperties(p); - if (stmt!=null && stmt.hasNext()) + StmtIterator stmtIt =resource.listProperties(p); + if (stmtIt!=null && stmtIt.hasNext()) { + Statement stmt=stmtIt.next(); resource.getModel().remove(stmt); } } @@ -108,7 +113,10 @@ public static void setProperty(Resource resource, URI property, String value) { Property p=resource.getModel().createProperty(property.toString()); removeIfExists(resource,p); - resource.addProperty(p, value); + if (value!=null) + { + resource.addProperty(p, value); + } } public static void setProperty(Resource resource, URI property, float value) @@ -124,19 +132,20 @@ public static void setProperty(Resource resource, URI property, URI value) { Property p=resource.getModel().createProperty(property.toString()); removeIfExists(resource,p); - Resource resourceValue = resource.getModel().createResource(value.toString()); - resource.addProperty(p, resourceValue); + if (value!=null) + { + Resource resourceValue = resource.getModel().createResource(value.toString()); + resource.addProperty(p, resourceValue); + } } public static void setProperty(Resource resource, URI property, List values) { - if (values!=null && values.size()>0) - { - Property p=resource.getModel().createProperty(property.toString()); - removeIfExists(resource,p); - for (URI uri:values) - { + Property p=resource.getModel().createProperty(property.toString()); + removeIfExists(resource,p); + if (values!=null && values.size()>0){ + for (URI uri:values){ addProperty (resource, property, uri); } } @@ -144,13 +153,10 @@ public static void setProperty(Resource resource, URI property, List values public static void setPropertyAsStrings(Resource resource, URI property, List values) { - if (values!=null && values.size()>0) - { - Property p=resource.getModel().createProperty(property.toString()); - removeIfExists(resource,p); - - for (String value:values) - { + Property p=resource.getModel().createProperty(property.toString()); + removeIfExists(resource,p); + if (values!=null && values.size()>0){ + for (String value:values){ addProperty (resource, property, value); } } @@ -253,7 +259,7 @@ public static List getResourcesWithProperty(Resource resource,URI prop return resources; } - private static Object getLiteralValue(Resource resource, URI propertyURI) + /* private static Object getLiteralValue(Resource resource, URI propertyURI) { Object value=null; Property property=resource.getModel().getProperty(propertyURI.toString()); @@ -262,9 +268,9 @@ private static Object getLiteralValue(Resource resource, URI propertyURI) value=stmt.getObject().asLiteral().getValue(); } return value; - } + }*/ - public static Long getPropertyAsLong(Resource resource, URI propertyURI) { + /*public static Long getPropertyAsLong(Resource resource, URI propertyURI) { long result=Long.MIN_VALUE; Object value=getLiteralValue(resource, propertyURI); if (value!=null) @@ -272,7 +278,7 @@ public static Long getPropertyAsLong(Resource resource, URI propertyURI) { result=(long) value; } return result; - } + }*/ public static String getPropertyAsString(Resource resource, URI propertyURI) { Property property=resource.getModel().getProperty(propertyURI.toString()); @@ -307,8 +313,6 @@ public static URI getPropertyAsURI(Resource resource, URI propertyURI) { return result; } - - /** * Gets the property values for a given property and a resource. * @param model Model to search the property for diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/IdentityValidator.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/IdentityValidator.java new file mode 100644 index 0000000..557b3f1 --- /dev/null +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/IdentityValidator.java @@ -0,0 +1,257 @@ +package org.sbolstandard.core3.validation; + + +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; +import java.util.Set; + +import org.apache.commons.lang3.StringUtils; +import org.apache.jena.rdf.model.Resource; +import org.sbolstandard.core3.entity.Identified; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.RDFUtil; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.vocabulary.DataModel; +import org.sbolstandard.core3.vocabulary.MeasureDataModel; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; + +public class IdentityValidator { + private static IdentityValidator idendityValidator = null; + protected Validator validator; + + private IdentityValidator() + { + } + + public static IdentityValidator getValidator() throws SBOLGraphException + { + if (idendityValidator == null) + { + try + { + idendityValidator=new IdentityValidator(); + ValidatorFactory factory = Validation.byDefaultProvider() + .configure() + //.addValueExtractor(new ...ValueExtractor()) + .buildValidatorFactory(); + idendityValidator.validator = factory.getValidator(); + } + catch (Exception exception) + { + throw new SBOLGraphException("Could not initialize the validator", exception); + } + } + return idendityValidator; + } + + public List validate(Identified identified) + { + Set> violations = validator.validate(identified); + List messages=new ArrayList(); + for (ConstraintViolation violation : violations) { + List fragments=new ArrayList(); + fragments.add(violation.getMessage()); + fragments.add(String.format("Property: %s",violation.getPropertyPath().toString())); + if (violation.getLeafBean()!=null && violation.getLeafBean() instanceof Identified ){ + Identified identifiedLeaf= (Identified) violation.getLeafBean(); + fragments.add(String.format("Entity URI: %s",identifiedLeaf.getUri().toString())); + fragments.add(String.format("Entity type: %s",identifiedLeaf.getClass())); + } + /*if (violation.getRootBean()!=null && violation.getRootBean() instanceof Identified ){ + Identified identifiedRoot= (Identified) violation.getLeafBean(); + fragments.add(String.format("Parent entity URI: %s",identifiedRoot.getUri().toString())); + fragments.add(String.format("Parent entity type: %s",identifiedRoot.getClass())); + }*/ + if (violation.getInvalidValue()!=null){ + fragments.add("Value:" + violation.getInvalidValue().toString()); + } + String message=StringUtils.join(fragments, "," + System.lineSeparator() + "\t"); + messages.add(message); + } + return messages; + } + + public List validate2(Identified identified) + { + Set> violations = validator.validate(identified); + List messages=new ArrayList(); + for (ConstraintViolation violation : violations) { + String propertyMessage=String.format("Property: %s",violation.getPropertyPath().toString()); + String entityMessage =String.format("Entity Type: %s",violation.getRootBeanClass().getName()); + String uriMessage=""; + if (violation.getRootBeanClass()!=null) + { + URI uri=((Identified) violation.getRootBean()).getUri(); + uriMessage =String.format("Entity: %s",uri.toString()); + } + String message=String.format("%s, %s, %s, %s", violation.getMessage(), entityMessage, propertyMessage, uriMessage); + messages.add(message); + } + return messages; + } + + public URI getPropertyAsURI(Resource resource, URI property) throws SBOLGraphException + { + URI result=null; + if (Configuration.getConfiguration().enforceOneToOneRelationships()) + { + List uris=RDFUtil.getPropertiesAsURIs(resource, property); + if (uris!=null && uris.size()>0) + { + if (uris.size()>1) + { + String message=String.format("Multiple values are included for property %s. Entity URI:%s", property.toString(), resource.getURI()); + throw new SBOLGraphException(message); + } + else + { + result=uris.get(0); + } + } + } + else + { + result=RDFUtil.getPropertyAsURI(resource, property); + } + return result; + } + + public String getPropertyAsString(Resource resource, URI property) throws SBOLGraphException + { + String result=null; + if (Configuration.getConfiguration().enforceOneToOneRelationships()) + { + List uris=RDFUtil.getPropertiesAsStrings(resource, property); + if (uris!=null && uris.size()>0) + { + if (uris.size()>1) + { + String message=String.format("Multiple values are included for property %s. URI:%s", property.toString(), resource.getURI()); + throw new SBOLGraphException(message); + } + else + { + result=uris.get(0); + } + } + } + else + { + result=RDFUtil.getPropertyAsString(resource, property); + } + return result; + + } + + /*public OptionalInt getPropertyAsOptionalInt(Resource resource, URI property) throws SBOLGraphException + { + OptionalInt result=OptionalInt.empty(); + String value=IdentityValidator.getValidator().getPropertyAsString(resource, property); + if (value!=null){ + result=OptionalInt.of(Integer.valueOf(value)); + } + return result; + }*/ + + public Optional getPropertyAsOptionalInteger(Resource resource, URI property) throws SBOLGraphException + { + Optional result=Optional.empty(); + String value=IdentityValidator.getValidator().getPropertyAsString(resource, property); + if (value!=null){ + result=Optional.of(Integer.valueOf(value)); + } + return result; + } + + + + /*public void setPropertyAsOptionalInt(Resource resource, URI property, OptionalInt value) + { + String stringValue=null; + if (value!=null && value.isPresent()) + { + stringValue= String.valueOf(value.getAsInt()); + } + RDFUtil.setProperty(resource, property, stringValue); + }*/ + + public Optional getPropertyAsOptionalFloat(Resource resource, URI property) throws SBOLGraphException + { + Optional result=Optional.empty(); + String value=IdentityValidator.getValidator().getPropertyAsString(resource, property); + if (value!=null){ + try + { + result=Optional.of(Float.parseFloat(value)); + } + catch (Exception e) + { + throw new SBOLGraphException("Cannot read the value. Property:" + MeasureDataModel.Measure.value + " Uri:+ " + resource.getURI(), e); + } + } + return result; + } + + /*public void setPropertyAsOptionalFloat(Resource resource, URI property, Optional value) + { + String stringValue=null; + if (value!=null && value.isPresent()) + { + stringValue= String.valueOf(value.get()); + } + RDFUtil.setProperty(resource, property, stringValue); + }*/ + + public void setPropertyAsOptional(Resource resource, URI property, Optional value) + { + String stringValue=null; + if (value!=null && value.isPresent()) + { + stringValue= String.valueOf(value.get()); + } + RDFUtil.setProperty(resource, property, stringValue); + } + + + /*public Optional getPropertyAsOptional(Resource resource, URI property) throws SBOLGraphException + { + Optional result=Optional.empty(); + String value=IdentityValidator.getValidator().getPropertyAsString(resource, property); + if (value!=null){ + result=Optional.of(value); + } + return result; + } + + public void setPropertyAsOptional(Resource resource, URI property, Optional value) + { + String stringValue=null; + if (value.isPresent()) + { + stringValue= String.valueOf(value.get()); + } + RDFUtil.setProperty(resource, property, stringValue); + }*/ + + /* + public String getRequiredPropertyAsString(Resource resource, URI property) throws SBOLGraphException + { + String value=getPropertyAsString(resource, property); + if (value==null) + { + throw new SBOLGraphException("Cannot read the value. Property:" + property+ " Uri:+ " + resource.getURI()); + + } + return value; + + }*/ + +} diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/Message.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/Message.java new file mode 100644 index 0000000..eea215d --- /dev/null +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/Message.java @@ -0,0 +1,31 @@ +package org.sbolstandard.core3.validation; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +public class Message { +//public final static String ATTACHMENT_SOURCE_NOT_NULL="Attachment.source cannot be null - setSource"; +public final static String test = null;// get("ATTACHMENT_SOURCE_NOT_NULL"); +public final static String ATTACHMENT_SOURCE_NOT_NULL=test;//get("ATTACHMENT_SOURCE_NOT_NULL"); +//private static Properties prop=null; +private static Properties prop=new Properties();// + + + private Message() + { + try { + InputStream input = new FileInputStream("validation/messages"); + prop = new Properties(); + prop.load(input); + } + catch (IOException ex) { + throw new Error(ex); + } + } + public static String get(String messageID) + { + return prop.getProperty(messageID); + } +} diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/PropertyValidator.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/PropertyValidator.java new file mode 100644 index 0000000..e2ef2f4 --- /dev/null +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/PropertyValidator.java @@ -0,0 +1,87 @@ +package org.sbolstandard.core3.validation; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import org.apache.commons.lang3.StringUtils; +import org.sbolstandard.core3.entity.Identified; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.util.SBOLGraphException; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.ValidatorFactory; +import jakarta.validation.executable.ExecutableValidator; + +public class PropertyValidator { + private static PropertyValidator propertyValidator = null; + protected ExecutableValidator validator; + + private PropertyValidator() + { + } + + public static PropertyValidator getValidator() throws SBOLGraphException + { + if (propertyValidator == null) + { + try + { + propertyValidator=new PropertyValidator(); + ValidatorFactory factory = Validation.byDefaultProvider() + .configure() + .buildValidatorFactory(); + propertyValidator.validator = factory.getValidator().forExecutables(); + } + catch (Exception exception) + { + throw new SBOLGraphException("Could not initialize the property validator", exception); + } + } + return propertyValidator; + } + + public void validate(Identified identified, String methodName, Object[] parameterValues, Class... parameterTypes) throws SBOLGraphException + { + if (Configuration.getConfiguration().getPropertyValidationType()==PropertyValidationType.ValidateAfterSettingProperties) + { + Method method; + try { + method = identified.getClass().getMethod(methodName, parameterTypes); + } + catch (NoSuchMethodException | SecurityException e) { + throw new SBOLGraphException(e.getMessage(),e); + } + + Set> violations = validator.validateParameters(identified, method,parameterValues); + if (violations!=null && violations.size()>0){ + List messages=new ArrayList(); + for (ConstraintViolation violation : violations) { + List fragments=new ArrayList(); + fragments.add(violation.getMessage()); + fragments.add(String.format("Property: %s",violation.getPropertyPath().toString())); + if (violation.getLeafBean()!=null && violation.getLeafBean() instanceof Identified ){ + Identified identifiedLeaf= (Identified) violation.getLeafBean(); + fragments.add(String.format("Entity URI: %s",identifiedLeaf.getUri().toString())); + fragments.add(String.format("Entity type: %s",identifiedLeaf.getClass())); + } + /*if (violation.getRootBean()!=null && violation.getRootBean() instanceof Identified ){ + Identified identifiedRoot= (Identified) violation.getRootBean(); + fragments.add(String.format("Parent entity URI: %s",identifiedRoot.getUri().toString())); + fragments.add(String.format("Parent entity type: %s",identifiedRoot.getClass())); + }*/ + if (violation.getInvalidValue()!=null){ + fragments.add("Value:" + violation.getInvalidValue().toString()); + } + String message=StringUtils.join(fragments, ",\r\n\t"); + messages.add(message); + } + + String errorMessage= StringUtils.join(messages, ",\r\n\t"); + throw new SBOLGraphException(errorMessage); + } + } + } + +} diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLComparator.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLComparator.java index fa2935a..00c488a 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLComparator.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLComparator.java @@ -3,6 +3,9 @@ import java.net.URI; import java.util.Collections; import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; + import org.apache.jena.datatypes.xsd.XSDDateTime; import org.sbolstandard.core3.entity.Attachment; import org.sbolstandard.core3.entity.Collection; @@ -168,7 +171,7 @@ private static StringBuilder assertEqualEntity(List en return output; } - private static StringBuilder assertEqualEntity(Identified identified1, Identified identified2) throws SBOLGraphException + public static StringBuilder assertEqualEntity(Identified identified1, Identified identified2) throws SBOLGraphException { StringBuilder output=null; if (identified1!=null && identified2==null) @@ -373,7 +376,7 @@ private static StringBuilder assertEqualAttachment(Attachment entity1, Attachmen output = add(output, assertEqual(entity1, entity2, entity1.getHash(),entity2.getHash(), DataModel.Attachment.hash)); output = add(output, assertEqual(entity1, entity2, entity1.getHashAlgorithm(),entity2.getHashAlgorithm(), DataModel.Attachment.hashAlgorithm)); output = add(output, assertEqual(entity1, entity2, entity1.getSource(),entity2.getSource(), DataModel.Attachment.source)); - output = add(output, assertEqual(entity1, entity2, entity1.getSize(),entity2.getSize(), DataModel.Attachment.size)); + output = add(output, assertEqual(entity1, entity2, entity1.getSize().toString(),entity2.getSize().toString(), DataModel.Attachment.size)); } return output; } @@ -404,7 +407,7 @@ private static StringBuilder assertEqualPrefix(Prefix entity1, Prefix entity2) if (entity1!=null) { output = add(output, assertEqualUnit(entity1, entity2)); - output = add(output, assertEqual(entity1, entity2, entity1.getFactor(),entity2.getFactor(), MeasureDataModel.Prefix.factor)); + output = add(output, assertEqual(entity1, entity2, entity1.getFactor().toString(),entity2.getFactor().toString(), MeasureDataModel.Prefix.factor)); } return output; } @@ -432,7 +435,7 @@ private static StringBuilder assertEqualCollection(Collection entity1, Collectio if (entity1!=null) { output = add(output, assertEqual(entity1, entity2)); - output = add(output, assertEqual(entity1, entity2, entity1.getTopLevels(),entity2.getTopLevels(), DataModel.Collection.member)); + output = add(output, assertEqual(entity1, entity2, entity1.getMembers(),entity2.getMembers(), DataModel.Collection.member)); } return output; } @@ -456,7 +459,7 @@ private static StringBuilder assertEqualVariableComponent(VariableFeature entity if (entity1!=null) { output = add(output, assertEqual(entity1, entity2)); - output = add(output, assertEqual(entity1, entity2, entity1.getCardinality(),entity2.getCardinality(), DataModel.VariableComponent.cardinality)); + output = add(output, assertEqual(entity1, entity2, entity1.getCardinality().getUri(),entity2.getCardinality().getUri(), DataModel.VariableComponent.cardinality)); output = add(output, assertEqual(entity1, entity2, entity1.getFeature(),entity2.getFeature(), DataModel.VariableComponent.variable)); output = add(output, assertEqual(entity1, entity2, entity1.getVariantCollections(),entity2.getVariantCollections(), DataModel.VariableComponent.variantCollection)); output = add(output, assertEqual(entity1, entity2, entity1.getVariantDerivations(),entity2.getVariantDerivations(), DataModel.VariableComponent.variantDerivation)); @@ -506,7 +509,7 @@ private static StringBuilder assertEqualComponentReference(ComponentReference en if (entity1!=null) { output = add(output, assertEqualFeature(entity1, entity2)); - output = add(output, assertEqual(entity1, entity2, entity1.getFeature(),entity2.getFeature(), DataModel.ComponentReference.feature)); + output = add(output, assertEqual(entity1, entity2, entity1.getRefersTo(),entity2.getRefersTo(), DataModel.ComponentReference.refersTo)); output = add(output, assertEqual(entity1, entity2, entity1.getInChildOf(),entity2.getInChildOf(), DataModel.ComponentReference.inChildOf)); } return output; @@ -680,7 +683,7 @@ private static StringBuilder assertEqualSingularUnit(SingularUnit entity1, Singu if (entity1!=null) { output = add(output, assertEqualUnit(entity1, entity2)); - output = add(output, assertEqual(entity1, entity2, entity1.getFactor(), entity2.getFactor(),MeasureDataModel.SingularUnit.factor)); + output = add(output, assertEqual(entity1, entity2, entity1.getFactor().toString(), entity2.getFactor().toString(),MeasureDataModel.SingularUnit.factor)); output = add(output, assertEqual(entity1, entity2, entity1.getUnit(), entity2.getUnit(),MeasureDataModel.SingularUnit.unit)); } return output; @@ -717,7 +720,7 @@ private static StringBuilder assertEqualUnitExponentiation (UnitExponentiation e { output = add(output, assertEqualUnit(entity1, entity2)); output = add(output, assertEqual(entity1, entity2, entity1.getBase(), entity2.getBase(),MeasureDataModel.UnitExponentiation.base)); - output = add(output, assertEqual(entity1, entity2, entity1.getExponent(), entity2.getExponent(),MeasureDataModel.UnitExponentiation.base)); + output = add(output, assertEqual(entity1, entity2, entity1.getExponent().toString(), entity2.getExponent().toString(),MeasureDataModel.UnitExponentiation.base)); } return output; } @@ -751,7 +754,7 @@ private static StringBuilder assertEqualMeasure(Measure entity1, Measure entity2 { output = add(output, assertEqual(entity1, entity2)); output = add(output, assertEqual(entity1, entity2, entity1.getUnit(),entity2.getUnit(), MeasureDataModel.Measure.unit)); - output = add(output, assertEqual(entity1, entity2, entity1.getValue(),entity2.getValue(), MeasureDataModel.Measure.value)); + output = add(output, assertEqual(entity1, entity2, entity1.getValue().toString(),entity2.getValue().toString(), MeasureDataModel.Measure.value)); output = add(output, assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), MeasureDataModel.Measure.type)); } return output; @@ -834,7 +837,18 @@ private static StringBuilder assertEqual(Identified identified1, Identified iden return output; } - private static StringBuilder assertEqual(Identified identified1, Identified identified2, float value1, float value2, URI property) + /*private static StringBuilder assertEqual(Identified identified1, Identified identified2, Optional value1, Optional value2, URI property) + { + StringBuilder output=null; + String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), String.valueOf(value1), String.valueOf(value2)); + if (!stringEquals(String.valueOf(value1),String.valueOf(value2))) + { + output = add(output,message); + } + return output; + }*/ + + /*private static StringBuilder assertEqual(Identified identified1, Identified identified2, Optional value1, Optional value2, URI property) { StringBuilder output=null; String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), String.valueOf(value1), String.valueOf(value2)); @@ -845,6 +859,17 @@ private static StringBuilder assertEqual(Identified identified1, Identified iden return output; } + private static StringBuilder assertEqual(Identified identified1, Identified identified2, OptionalInt value1, OptionalInt value2, URI property) + { + StringBuilder output=null; + String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), String.valueOf(value1), String.valueOf(value2)); + if (!stringEquals(String.valueOf(value1),String.valueOf(value2))) + { + output = add(output,message); + } + return output; + }*/ + private static StringBuilder assertEqual(Identified identified1, Identified identified2, XSDDateTime value1, XSDDateTime value2, URI property) { StringBuilder output=null; diff --git a/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLValidator.java b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLValidator.java index d4cf554..13460e0 100644 --- a/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLValidator.java +++ b/libSBOLj3/src/main/java/org/sbolstandard/core3/validation/SBOLValidator.java @@ -3,35 +3,137 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.net.URI; import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; import org.apache.commons.compress.utils.FileNameUtils; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.jena.query.QuerySolution; import org.apache.jena.query.ResultSet; import org.apache.jena.query.Syntax; import org.apache.jena.rdf.model.RDFNode; import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Identified; import org.sbolstandard.core3.entity.SBOLDocument; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.util.RDFUtil; +import org.sbolstandard.core3.util.SBOLGraphException; + +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; + public class SBOLValidator { - public static String validateFolder(String folder, String extension) throws IOException + private static SBOLValidator sbolValidator = null; + protected Validator validator; + + private SBOLValidator() + { + } + + public static SBOLValidator getValidator() throws SBOLGraphException + { + if (sbolValidator == null) + { + try + { + sbolValidator=new SBOLValidator(); + ValidatorFactory factory = Validation.byDefaultProvider() + .configure() + //.addValueExtractor(new ...ValueExtractor()) + .buildValidatorFactory(); + sbolValidator.validator = factory.getValidator(); + } + catch (Exception exception) + { + throw new SBOLGraphException("Could not initialize the validator", exception); + } + } + return sbolValidator; + } + + public List validate(SBOLDocument document) + { + Set> violations = validator.validate(document); + List messages=new ArrayList(); + for (ConstraintViolation violation : violations) { + List fragments=new ArrayList(); + fragments.add(violation.getMessage()); + fragments.add(String.format("Property: %s",violation.getPropertyPath().toString())); + if (violation.getLeafBean()!=null && violation.getLeafBean() instanceof Identified ){ + Identified identified= (Identified) violation.getLeafBean(); + fragments.add(String.format("Entity URI: %s",identified.getUri().toString())); + fragments.add(String.format("Entity type: %s",identified.getClass())); + } + if (violation.getInvalidValue()!=null){ + fragments.add("Value:" + violation.getInvalidValue().toString()); + } + String message=StringUtils.join(fragments, String.format(",%s\t", System.lineSeparator())); + messages.add(message); + } + return messages; + } + + public boolean isValid(SBOLDocument document) throws SBOLGraphException + { + String CRLF=System.lineSeparator(); + List messages=validate(document); + if (messages!=null && messages.size()>0) + { + String message=StringUtils.join(messages, CRLF + CRLF); + throw new SBOLGraphException("Could not validate the SBOL document:" + CRLF + message); + } + return true; + } + + public static List validateSBOLDocument2(SBOLDocument document) + { + Validator validator=null; + ValidatorFactory factory = Validation.byDefaultProvider() + .configure() + //.addValueExtractor(new ProfileValueExtractor()) + .buildValidatorFactory(); + validator = factory.getValidator(); + + Set> violations = validator.validate(document); + List messages=new ArrayList(); + for (ConstraintViolation violation : violations) { + String propertyMessage=String.format("Property:%s",violation.getPropertyPath().toString()); + //String entityMessage =String.format("Entity Type:%s",violation.getRootBeanClass().getName()); + String uriMessage=""; + if (violation.getLeafBean()!=null) + { + URI uri=((Identified) violation.getLeafBean()).getUri(); + uriMessage =String.format("Entity:%s",uri.toString()); + } + + String message=String.format("%s, %s, %s", violation.getMessage(), propertyMessage, uriMessage); + messages.add(message); + } + return messages; + } + + public static String validateFolder(String folder, String extension, String keywordsToExclude) throws IOException, SBOLGraphException { StringBuilder output=new StringBuilder(); - validateFolderRecursive(output, new File(folder), extension); + validateFolderRecursive(output, new File(folder), extension, keywordsToExclude); String result=output.toString(); return result; } - public static String validateFolder(String folder) throws IOException + public static String validateFolder(String folder) throws IOException, SBOLGraphException { - return validateFolder(folder,null); + return validateFolder(folder,null,null); } - private static void validateFolderRecursive(StringBuilder output, File folder, String extension) throws IOException + private static void validateFolderRecursive(StringBuilder output, File folder, String extension, String keywordsToExclude) throws IOException, SBOLGraphException { File[] files=folder.listFiles(); for (int i=0;i lookup = new HashMap<>(); + + static + { + for(VariableFeatureCardinality encoding: VariableFeatureCardinality.values()) + { + lookup.put(encoding.getUri(), encoding); + } + } + + public static VariableFeatureCardinality get(URI uri) + { + return lookup.get(uri); } } diff --git a/libSBOLj3/src/main/resources/ValidationMessages.properties b/libSBOLj3/src/main/resources/ValidationMessages.properties new file mode 100644 index 0000000..1027e5b --- /dev/null +++ b/libSBOLj3/src/main/resources/ValidationMessages.properties @@ -0,0 +1,56 @@ +ATTACHMENT_SOURCE_NOT_NULL = sbol3-12801 - The source property of an Attachment MUST specify the location of the model's source file. +ATTACHMENT_SIZE_POSITIVE_OR_ZERO = sbol3-12804 The size property, if specified, MUST indicate file size in bytes. +COMBINATORIALDERIVATION_TEMPLATE_NOT_NULL = CombinatorialDerivation.template cannot be null. +COMBINATORIALREFERENCE_REFERSTO_NOT_NULL = ComponentReference.refersTo cannot be null. +COMBINATORIALREFERENCE_INCHILDOF_NOT_NULL = ComponentReference.inChildOf cannot be null. +COMPONENT_TYPES_NOT_EMPTY = Component.types cannot be empty. +CONSTRAINT_RESTRICTION_NOT_NULL = Constraint.restriction cannot be null. +CONSTRAINT_SUBJECT_NOT_NULL = Constraint.subject cannot be null. +CONSTRAINT_OBJECT_NOT_NULL = Constraint.object cannot be null. +CUT_AT_NOT_NULL = Cut.at cannot be null. +CUT_AT_POSITIVE_OR_ZERO = sbol3-11501 - The value of the at property of a Cut MUST be greater than or equal to zero. +LOCATION_SEQUENCE_NOT_NULL = Location.sequence cannot be null. +EXTERNALLYDEFINED_TYPES_NOT_EMPTY = ExternallyDefined.type cannot be empty. +EXTERNALLYDEFINED_DEFINITION_NOT_NULL = ExternallyDefined.definition cannot be null. +INTERACTION_TYPES_NOT_EMPTY = Interaction.types cannot be empty. +LOCALSUBCOMPONENT_TYPES_NOT_EMPTY = LocalSubComponent.types cannot be empty. +MODEL_SOURCE_NOT_NULL = sbol3-12501 - The URI contained by the source property of a Model MUST specify the location of the model's source file. +MODEL_LANGUAGE_NOT_NULL = sbol3-12502 The URI contained by the language property of a Model MUST specify the language in which the model is encoded. +MODEL_FRAMEWORK_NOT_NULL = sbol3-12505 - The URI contained by the framework property of a Model MUST specify the modeling framework of the model. +PARTICIPANT_ROLES_NOT_EMPTY = Participation.roles cannot be empty. +RANGE_START_NOT_NULL = Range.start cannot be empty. +RANGE_START_POSITIVE_OR_ZERO = Range.start must be bigger than zero. +RANGE_END_NOT_NULL = Range.end cannot be empty. +RANGE_END_POSITIVE_OR_ZERO = Range.end must be bigger than zero. +SEQUENCEFEATURE_LOCATIONS_NOT_EMPTY = SequenceFeature.locations cannot be empty. +SUBCOMPONENT_ISINSTANCEOF_NOT_NULL = SubComponent.isInstanceOf cannot be null. +TOPLEVEL_NAMESPACE_NOT_NULL = TopLevel.namespace cannot be null. +IDENTIFIED_DISPLAYID = sbol3-10201 - The displayId property, if specified, MUST be composed of only alphanumeric or underscore characters and MUST NOT begin with a digit. +VARIABLEFEATURE_CARDINALITY_NOT_NULL = VariableFeature.cardinality cannot be null. +VARIABLEFEATURE_FEATURE_NOT_NULL = VariableFeature.feature cannot be null +MEASURE_VALUE_NOT_NULL = Measure.value cannot be null. +MEASURE_UNIT_NOT_NULL = Measure.unit cannot be null. +PREFIX_FACTOR_NOT_NULL = Prefix.factor cannot be null. +PREFIXEDUNIT_PREFIX_NOT_NULL = PrefixedUnit.prefix cannot be null. +PREFIXEDUNIT_UNIT_NOT_NULL = PrefixedUnit.unit cannot be null. +UNIT_SYMBOL_NOT_EMPTY = Unit.symbol cannot be empty. +UNIT_LABEL_NOT_EMPTY = Unit.label cannot be empty. +UNITDIVISION_NUMERATOR_NOT_NULL = UnitDivision.numerator cannot be null. +UNITDIVISION_DENOMINATOR__NOT_NULL = UnitDivision.denominator cannot be null. +UNITEXPONENTIATION_BASE_NOT_NULL = UnitExponentiation.base cannot be null. +UNITEXPONENTIATION_EXPONENT_NOT_EMPTY = UnitExponentiation.exponent cannot be empty. +UNITMULTIPLICATION_TERM1_NOT_NULL = UnitMultiplication.term1 cannot be null. +UNITMULTIPLICATION_TERM2_NOT_NULL = UnitMultiplication.term2 cannot be null. +ASSOCIATION_AGENT_NOT_NULL = Association.agent cannot be null +USAGE_ENTITY_NOT_NULL = Usage.entity cannot be null. + + + + + + + + + + + diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/provenance/test/ActivityTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/provenance/test/ActivityTest.java index 5906259..77cd20d 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/provenance/test/ActivityTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/provenance/test/ActivityTest.java @@ -2,8 +2,10 @@ import java.io.IOException; import java.net.URI; +import java.time.Month; import java.util.Arrays; import java.util.Calendar; +import java.util.Date; import org.apache.jena.datatypes.xsd.XSDDateTime; import org.sbolstandard.core3.api.SBOLAPI; @@ -18,7 +20,11 @@ import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.validation.SBOLComparator; +import org.sbolstandard.core3.validation.SBOLValidator; import org.sbolstandard.core3.vocabulary.ActivityType; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.ParticipationRole; @@ -27,7 +33,7 @@ public class ActivityTest extends TestCase { - public void test() throws SBOLGraphException, IOException + public void test() throws SBOLGraphException, IOException, Exception { String baseUri="https://sbolstandard.org/examples/"; SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); @@ -43,18 +49,17 @@ public void test() throws SBOLGraphException, IOException plan.setName("Codon Optimisation Protocol"); plan.setDescription("Optimisation protocol to improve the translation of mRNAs."); - Activity activity=doc.createActivity("codon_optimization_activity"); activity.setTypes(Arrays.asList(ActivityType.Design.getUrl())); activity.setName("Codon optimization activity"); activity.setDescription("An activity that is used to optimise codons"); Calendar calendar=Calendar.getInstance(); - calendar.set(2019, 6,29); + calendar.set(2019,Calendar.JULY,29); + activity.setStartedAtTime(new XSDDateTime(calendar)); - calendar.set(2020, 7,30); + calendar.set(2020,Calendar.AUGUST,30); activity.setEndedAtTime(new XSDDateTime(calendar)); - Usage usage1=activity.createUsage(toggleSwitch.getUri()); usage1.setRoles(Arrays.asList(ParticipationRole.Template)); Usage usage2=activity.createUsage(toggleSwitchOptimised.getUri()); @@ -86,7 +91,17 @@ public void test() throws SBOLGraphException, IOException printActivity(doc2, act); } - TestUtil.assertEqual(doc, doc2); + SBOLComparator.assertEqual(doc, doc2); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateProperty(association, "setAgent", new Object[] {null}, URI.class); + TestUtil.validateProperty(usage1, "setEntity", new Object[] {null}, URI.class); + TestUtil.validateDocument(doc, 0); + association.setAgent(null); + TestUtil.validateIdentified(association,doc, 1); + usage1.setEntity(null); + TestUtil.validateIdentified(usage1,doc, 1,2); } private void printActivity(SBOLDocument document, Activity activity) throws SBOLGraphException @@ -124,7 +139,7 @@ private void printActivity(SBOLDocument document, Activity activity) throws SBOL } } - private void printMetadata(Identified identified, int count) + private void printMetadata(Identified identified, int count) throws SBOLGraphException { String space=""; if (count>0) diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AnnotationTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AnnotationTest.java index 035c981..6d4f3ba 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AnnotationTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AnnotationTest.java @@ -125,7 +125,7 @@ public void printMetadata(Identified identified) throws SBOLGraphException } } - private void printMetadata(Metadata metadata, int count) + private void printMetadata(Metadata metadata, int count) throws SBOLGraphException { String space=String.format("%"+count+"s", "") ; System.out.println(space + "uri:" + metadata.getUri()); diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest.java index f584548..9e06c1a 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest.java @@ -3,6 +3,7 @@ import java.io.IOException; import java.net.URI; import java.util.Arrays; +import java.util.OptionalLong; import org.sbolstandard.core3.api.SBOLAPI; import org.sbolstandard.core3.entity.Attachment; @@ -12,7 +13,9 @@ import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.ModelLanguage; import org.sbolstandard.core3.vocabulary.Role; @@ -21,29 +24,121 @@ public class AttachmentTest extends TestCase { - public void testImplementation() throws SBOLGraphException, IOException + public void testAttachment() throws SBOLGraphException, IOException, Exception { String baseUri="https://sbolstandard.org/examples/"; SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); Component TetR_protein=SBOLAPI.createComponent(doc,"TetR_protein", ComponentType.Protein.getUrl(), "TetR", "TetR protein", Role.TF); - Attachment attachment=doc.createAttachment("attachment1", URI.create("https://sbolstandard.org/attachment1")); attachment.setFormat(ModelLanguage.SBML); - attachment.setSize(1000); - attachment.setHash("aaa"); + attachment.setSize(OptionalLong.of(1000)); attachment.setHashAlgorithm("Alg1"); - + attachment.setHash("aaa"); Implementation impl=doc.createImplementation("impl1"); impl.setComponent(TetR_protein.getUri()); impl.setAttachments(Arrays.asList(attachment.getUri())); TestUtil.serialise(doc, "entity/attachment", "attachment"); - System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + URI temp=attachment.getSource(); + attachment.setSource(URI.create("https://sbolstandard.org/attachment1_source2")); + TestUtil.validateIdentified(attachment,doc,0); + attachment.setSource(temp); + + //Attachment.source: exactly one. + + TestUtil.validateProperty(attachment, "setSource", new Object[] {null}, URI.class); + attachment.setSource(null); + TestUtil.validateIdentified(attachment,doc,1); + attachment.setSource(temp); + + //Attachment.format: optional + temp=attachment.getFormat(); + attachment.setFormat(null); + TestUtil.validateIdentified(attachment, doc,0); + attachment.setFormat(temp); + + //Attachment.hashAlgorithm: optional + String tempString=attachment.getHashAlgorithm(); + attachment.setHashAlgorithm(null); + TestUtil.validateIdentified(attachment,doc,0); + attachment.setHashAlgorithm(tempString); + + //Attachment.hash: optional + tempString=attachment.getHash(); + attachment.setHash(null); + TestUtil.validateIdentified(attachment,doc,0); + attachment.setHash(tempString); + + //Attachment size can't be negative + OptionalLong tempLong=attachment.getSize(); + TestUtil.validateProperty(attachment, "setSize", new Object[] {OptionalLong.of(-1)}, OptionalLong.class); + attachment.setSize(OptionalLong.of(-1)); + TestUtil.validateIdentified(attachment,doc,1); + + //Attachment size can be empty + attachment.setSize(OptionalLong.empty()); + TestUtil.validateIdentified(attachment,doc,0); + + //Attachment size can be zero + attachment.setSize(OptionalLong.of(0)); + TestUtil.validateIdentified(attachment,doc,0); + + //Attachment size can be bigger than zero + attachment.setSize(tempLong); + TestUtil.validateIdentified(attachment,doc,0); + + attachment.setDisplayId("test"); + TestUtil.validateIdentified(attachment,doc,0); + attachment.setDisplayId("1test"); + TestUtil.validateIdentified(attachment,doc,1); + attachment.setDisplayId("_test"); + TestUtil.validateIdentified(attachment,doc,0); + TestUtil.validateProperty(attachment, "setDisplayId", new Object[] {"!qq"}, String.class); + + + Attachment attachment2=doc.createAttachment("2attachment", URI.create("https://sbolstandard.org/attachment2_source")); + TestUtil.validateIdentified(attachment2,doc,1); + attachment2.setDisplayId("attachment2"); + TestUtil.validateIdentified(attachment2,doc,0); + + /*attachment2.setWasDerivedFrom(null); + TestUtil.validateIdentified(attachment2,doc,0); + attachment2.setWasDerivedFrom(Arrays.asList(attachment2.getUri())); + TestUtil.validateIdentified(attachment2,doc,1);*/ + + + + + + } + /*public List validateAttachment32(Attachment attachment) + { + Validator validator=null; + ValidatorFactory factory = Validation.byDefaultProvider() + .configure() + //.addValueExtractor(new ProfileValueExtractor()) + .buildValidatorFactory(); + validator = factory.getValidator(); + + Set> violations = validator.validate(attachment); + List messages=new ArrayList(); + for (ConstraintViolation violation : violations) { + String propertyMessage=String.format("Property:%s",violation.getPropertyPath().toString()); + String entityMessage =String.format("Entity:%s",violation.getRootBeanClass().getName()); + String message=String.format("%s, %s, %s", violation.getMessage(), propertyMessage, entityMessage); + messages.add(message); + } + return messages; + }*/ + } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest2.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest2.java new file mode 100644 index 0000000..1cec045 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/AttachmentTest2.java @@ -0,0 +1,67 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.lang.reflect.Method; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.OptionalLong; + +import org.apache.jena.sparql.function.library.execTime; +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Attachment; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.Identified; +import org.sbolstandard.core3.entity.Implementation; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.validation.PropertyValidator; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.ModelLanguage; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class AttachmentTest2 extends TestCase { + + public void testAttachment2() throws SBOLGraphException, IOException, Exception + { + String baseUri="https://sbolstandard.org/examples/"; + SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); + + Attachment attachment=doc.createAttachment("attachment1", URI.create("https://sbolstandard.org/attachment1")); + attachment.setFormat(ModelLanguage.SBML); + attachment.setSize(OptionalLong.of(1000)); + attachment.setHashAlgorithm("Alg1"); + attachment.setHash("aaa"); + + //Attachment.source: exactly one. + /*boolean validEx=false; + try + { + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateAfterSettingProperties); + attachment.setSource(null); + } + catch (SBOLGraphException ex) + { + validEx=true; + } + finally + { + assertTrue(validEx); + }*/ + TestUtil.validateProperty(attachment, "setSource", new Object[] {null}, URI.class); + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + attachment.setSource(null); + TestUtil.validateDocument(doc, 1); + } + + + + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CollectionTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CollectionTest.java index 1618585..ae21afc 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CollectionTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CollectionTest.java @@ -3,7 +3,6 @@ import java.io.IOException; import java.net.URI; import java.util.Arrays; - import org.sbolstandard.core3.api.SBOLAPI; import org.sbolstandard.core3.entity.Collection; import org.sbolstandard.core3.entity.Component; @@ -19,7 +18,7 @@ public class CollectionTest extends TestCase { - public void testInterface() throws SBOLGraphException, IOException + public void testCollection() throws SBOLGraphException, IOException { String baseUri="https://sbolstandard.org/examples/"; SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); @@ -28,9 +27,14 @@ public void testInterface() throws SBOLGraphException, IOException Component LacI_protein=SBOLAPI.createComponent(doc, "LacI_protein", ComponentType.Protein.getUrl(), "LacI", "LacI protein", Role.TF); Collection col=doc.createCollection("col1"); - col.setTopLevels(Arrays.asList(TetR_protein.getUri(), LacI_protein.getUri())); + //Collections can be empty + TestUtil.validateIdentified(col,doc,0); + + col.setMembers(Arrays.asList(TetR_protein.getUri(), LacI_protein.getUri())); + //Collections can have members + TestUtil.validateIdentified(col,doc,0); + TestUtil.serialise(doc, "entity/collection", "collection"); - System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); TestUtil.assertReadWrite(doc); } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CombinatorialDerivationTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CombinatorialDerivationTest.java new file mode 100644 index 0000000..66a9ba8 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CombinatorialDerivationTest.java @@ -0,0 +1,75 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.OptionalLong; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Attachment; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.CombinatorialDerivation; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Feature; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.SequenceFeature; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.entity.VariableFeature; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Encoding; +import org.sbolstandard.core3.vocabulary.ModelLanguage; +import org.sbolstandard.core3.vocabulary.Role; +import org.sbolstandard.core3.vocabulary.VariableFeatureCardinality; + +import junit.framework.TestCase; + +public class CombinatorialDerivationTest extends TestCase { + + public void testCombinatorialDerivation() throws SBOLGraphException, IOException, Exception + { + URI base=URI.create("https://synbiohub.org/public/igem/"); + SBOLDocument doc=new SBOLDocument(base); + + CombinatorialDerivation cd=doc.createCombinatorialDerivation("cs1", URI.create("http://sbolstandard.org/template")); + + Component pTetR=SBOLAPI.createDnaComponent(doc, URI.create("https://synbiohub.org/public/igem/BBa_R0040"), "pTetR", "TetR repressible promoter", Role.Promoter, "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac"); + + + TestUtil.serialise(doc, "entity_additional/combinatorialderivation", "combinatorialderivation"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(cd, doc, 0); + + //template is required. + URI tmpURI=cd.getTemplate(); + TestUtil.validateProperty(cd, "setTemplate", new Object[] {null}, URI.class); + cd.setTemplate(null); + TestUtil.validateIdentified(cd, doc, 1); + cd.setTemplate(tmpURI); + + Component start=SBOLAPI.createDnaComponent(doc, URI.create("https://synbiohub.org/public/igem/BBa_R0040_start"), "pTetR_start", "promoter_start", Role.EngineeredRegion, "tccctat"); + + pTetR.createSubComponent(start.getUri()); + VariableFeature vf=cd.createVariableFeature(VariableFeatureCardinality.One,start.getUri()); + + TestUtil.validateProperty(vf, "setCardinality", new Object[] {null}, VariableFeatureCardinality.class); + vf.setCardinality(null); + TestUtil.validateIdentified(vf, doc, 1); + + TestUtil.validateProperty(vf, "setFeature", new Object[] {null}, URI.class); + vf.setFeature(null); + TestUtil.validateIdentified(vf, doc, 2); + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentReferenceTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentReferenceTest.java new file mode 100644 index 0000000..bafccab --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentReferenceTest.java @@ -0,0 +1,66 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.OptionalLong; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.validation.SBOLValidator; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class ComponentReferenceTest extends TestCase { + + public void testComponentReference() throws SBOLGraphException, IOException, Exception + { + URI base=URI.create("https://synbiohub.org/public/igem/"); + SBOLDocument doc=new SBOLDocument(base); + + Component i13504_system=SBOLAPI.createComponent(doc,"i13504_system", ComponentType.DNA.getUrl(), "i13504 system", null, Role.FunctionalCompartment); + Component ilab16_dev1=doc.createComponent("interlab16device1", Arrays.asList(ComponentType.DNA.getUrl())); + Component device=doc.createComponent("i13504", Arrays.asList(ComponentType.DNA.getUrl())); + SubComponent i13504SubComponent=SBOLAPI.addSubComponent(i13504_system, device); + SubComponent sc_i13504_system=SBOLAPI.addSubComponent(ilab16_dev1, i13504_system); + + ComponentReference compRef=ilab16_dev1.createComponentReference(i13504SubComponent, sc_i13504_system); + + TestUtil.serialise(doc, "entity_additonal/componentreference", "componentreference"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(compRef,doc,0); + + //refersTo is required + TestUtil.validateProperty(compRef, "setRefersTo", new Object[] {null}, URI.class); + URI temp=compRef.getRefersTo(); + compRef.setRefersTo(null); + TestUtil.validateIdentified(compRef,doc,1); + compRef.setRefersTo(temp); + + //inChildOf is required + TestUtil.validateProperty(compRef, "setInChildOf", new Object[] {null}, URI.class); + temp=compRef.getInChildOf(); + compRef.setInChildOf(null); + TestUtil.validateIdentified(compRef,doc,1); + compRef.setInChildOf(temp); + + + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentTest.java new file mode 100644 index 0000000..af0fbe8 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ComponentTest.java @@ -0,0 +1,84 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.OptionalLong; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Attachment; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Feature; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.SequenceFeature; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Encoding; +import org.sbolstandard.core3.vocabulary.ModelLanguage; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class ComponentTest extends TestCase { + + public void testComponentReference() throws SBOLGraphException, IOException, Exception + { + URI base=URI.create("https://synbiohub.org/public/igem/"); + SBOLDocument doc=new SBOLDocument(base); + + Component popsReceiver=SBOLAPI.createDnaComponent(doc, URI.create("https://synbiohub.org/public/igem/BBa_F2620"), "BBa_F2620", "PoPS Receiver", Role.EngineeredGene, null); + TestUtil.serialise(doc, "entity_additional/component", "component"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + //Component.hasSequence can have zero values + TestUtil.validateIdentified(popsReceiver,doc,0); + + Component pTetR=SBOLAPI.createDnaComponent(doc, URI.create("https://synbiohub.org/public/igem/BBa_R0040"), "pTetR", "TetR repressible promoter", Role.Promoter, "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac"); + TestUtil.validateIdentified(pTetR,doc,0); + + //Component.hasSequence can have multiple values + List tempList=pTetR.getSequences(); + SBOLAPI.addSequence(doc, pTetR, Encoding.NucleicAcid, "aaaa"); + TestUtil.validateIdentified(pTetR,doc,0); + pTetR.setSequences(tempList); + + //Component.type is required + TestUtil.validateProperty(pTetR, "setTypes", new Object[] {null}, List.class); + tempList=pTetR.getTypes(); + pTetR.setTypes(null); + TestUtil.validateIdentified(pTetR,doc,1); + pTetR.setTypes(new ArrayList()); + TestUtil.validateIdentified(pTetR,doc,1); + pTetR.setTypes(tempList); + TestUtil.validateIdentified(pTetR,doc,0); + + + Attachment attachment=doc.createAttachment("attachment1", URI.create("https://sbolstandard.org/attachment1")); + attachment.setFormat(ModelLanguage.SBML); + attachment.setSize(OptionalLong.of(1000)); + + pTetR.setAttachments(Arrays.asList(attachment.getUri())); + TestUtil.validateIdentified(pTetR,doc,0); + attachment.setSize(OptionalLong.of(-1)); + TestUtil.validateDocument(doc,1); + attachment.setSize(OptionalLong.of(100)); + + TestUtil.validateProperty(pTetR, "setNamespace", new Object[] {null}, URI.class); + pTetR.setNamespace(null); + TestUtil.validateIdentified(pTetR,doc,1); + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ConstraintTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ConstraintTest.java new file mode 100644 index 0000000..027d4fe --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ConstraintTest.java @@ -0,0 +1,69 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Encoding; +import org.sbolstandard.core3.vocabulary.RestrictionType; +import org.sbolstandard.core3.vocabulary.Role; + +import jakarta.validation.Constraint; +import junit.framework.TestCase; + +public class ConstraintTest extends TestCase { + + public void testConstraintReference() throws SBOLGraphException, IOException, Exception + { + URI base=URI.create("https://synbiohub.org/public/igem/"); + SBOLDocument doc=new SBOLDocument(base); + + Component device= SBOLAPI.createDnaComponent(doc, "i13504", "i13504", "Screening plasmid intermediate", ComponentType.DNA.getUrl(), null); + + Component i13504_system=SBOLAPI.createComponent(doc,"i13504_system", ComponentType.FunctionalEntity.getUrl(), "i13504 system", null, Role.FunctionalCompartment); + + Component ilab16_dev1=doc.createComponent("interlab16device1", Arrays.asList(ComponentType.DNA.getUrl())); + SubComponent i13504SubComponent=SBOLAPI.addSubComponent(i13504_system, device); + SubComponent sc_i13504_system=SBOLAPI.addSubComponent(ilab16_dev1, i13504_system); + ComponentReference compRef_i13504_dev1=ilab16_dev1.createComponentReference(i13504SubComponent, sc_i13504_system); + Component j23101=doc.createComponent("j23101", Arrays.asList(ComponentType.DNA.getUrl())); + SubComponent sc_j23101=SBOLAPI.addSubComponent(ilab16_dev1, j23101); + + org.sbolstandard.core3.entity.Constraint constraint=ilab16_dev1.createConstraint(RestrictionType.Topology.meets, sc_j23101.getUri(), compRef_i13504_dev1.getUri()); + + TestUtil.serialise(doc, "entity_additional/constraint", "constraint"); + + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(constraint,doc,0); + TestUtil.validateProperty(constraint, "setRestriction", new Object[] {null}, URI.class); + constraint.setRestriction(null); + TestUtil.validateIdentified(constraint,doc,1); + + TestUtil.validateProperty(constraint, "setObject", new Object[] {null}, URI.class); + constraint.setObject(null); + TestUtil.validateIdentified(constraint,doc,2); + + TestUtil.validateProperty(constraint, "setSubject", new Object[] {null}, URI.class); + constraint.setSubject(null); + TestUtil.validateIdentified(constraint,doc,3); + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CutTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CutTest.java new file mode 100644 index 0000000..f7b2658 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/CutTest.java @@ -0,0 +1,82 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Cut; +import org.sbolstandard.core3.entity.Feature; +import org.sbolstandard.core3.entity.Location; +import org.sbolstandard.core3.entity.Location.LocationBuilder; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.Sequence; +import org.sbolstandard.core3.entity.SequenceFeature; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Encoding; +import org.sbolstandard.core3.vocabulary.RestrictionType; +import org.sbolstandard.core3.vocabulary.Role; + +import jakarta.validation.Constraint; +import junit.framework.TestCase; + +public class CutTest extends TestCase { + + public void testConstraintReference() throws SBOLGraphException, IOException, Exception + { + URI base=URI.create("https://synbiohub.org/public/igem/"); + SBOLDocument doc=new SBOLDocument(base); + + Component pTetR=SBOLAPI.createDnaComponent(doc, URI.create("https://synbiohub.org/public/igem/BBa_R0040"), "pTetR", "TetR repressible promoter", Role.Promoter, "tccctatcagtgatagagattgacatccctatcagtgatagagatactgagcac"); + Sequence sequence=doc.getSequences().get(0); + LocationBuilder locationBuilder=new Location.CutLocationBuilder(5, sequence.getUri()); + + SequenceFeature feature=pTetR.createSequenceFeature(Arrays.asList(locationBuilder)); + + List seqFeatures=pTetR.getSequenceFeatures(); + List features=pTetR.getFeatures(); + assertTrue(features!=null && features.size()>0); + assertTrue(features.size()==seqFeatures.size()); + + TestUtil.serialise(doc, "entity_additional/cut", "cut"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + Cut cut=(Cut)feature.getLocations().get(0); + TestUtil.validateIdentified(cut,doc,0); + + //Cut.at can't be null + TestUtil.validateProperty(cut, "setAt", new Object[] {Optional.empty()}, Optional.class); + cut.setAt(Optional.empty()); + TestUtil.validateIdentified(cut,doc,1); + + //Cut.at can't be negative + TestUtil.validateProperty(cut, "setAt", new Object[] {Optional.of(-5)}, Optional.class); + cut.setAt(Optional.of(-5)); + TestUtil.validateIdentified(cut,doc,1); + + cut.setAt(Optional.of(5)); + TestUtil.validateIdentified(cut,doc,0); + + //Location.sequence can't be null + TestUtil.validateProperty(cut, "setSequence", new Object[] {null}, URI.class); + cut.setSequence(null); + TestUtil.validateIdentified(cut,doc,1); + + } +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExperimentTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExperimentTest.java new file mode 100644 index 0000000..9bc5c17 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExperimentTest.java @@ -0,0 +1,50 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Attachment; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.Experiment; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class ExperimentTest extends TestCase { + + public void testExperiment() throws SBOLGraphException, IOException + { + String baseUri="https://sbolstandard.org/examples/"; + SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); + + + Attachment attachment1=doc.createAttachment("attachment1", URI.create("https://sbolstandard.org/attachment1")); + Attachment attachment2=doc.createAttachment("attachment2", URI.create("https://sbolstandard.org/attachment2")); + + Experiment exp=doc.createExperiment("exp1"); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + //Collections can be empty + TestUtil.validateIdentified(exp,doc,0); + + exp.setMembers(Arrays.asList(attachment1.getUri(), attachment2.getUri())); + //Collections can have members + TestUtil.validateIdentified(exp,doc,0); + + TestUtil.serialise(doc, "entity_additional/experiment", "experiment"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExternallyDefinedTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExternallyDefinedTest.java new file mode 100644 index 0000000..24b22cb --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ExternallyDefinedTest.java @@ -0,0 +1,61 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ExternallyDefined; +import org.sbolstandard.core3.entity.Interface; +import org.sbolstandard.core3.entity.Location; +import org.sbolstandard.core3.entity.Range; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.Sequence; +import org.sbolstandard.core3.entity.SequenceFeature; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.entity.Location.RangeLocationBuilder; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Orientation; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class ExternallyDefinedTest extends TestCase { + + public void testSequenceFeature() throws SBOLGraphException, IOException, Exception + { + String baseUri="https://sbolstandard.org/examples/"; + SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); + + Component ilab16_dev1=doc.createComponent("interlab16device1", Arrays.asList(ComponentType.FunctionalEntity.getUrl())); + ExternallyDefined exDefined= ilab16_dev1.createExternallyDefined(Arrays.asList(ComponentType.Protein.getUrl()), URI.create("http://uniprot.org/gfp")); + ExternallyDefined exDefined2= ilab16_dev1.createExternallyDefined(Arrays.asList(ComponentType.Protein.getUrl()), URI.create("http://uniprot.org/rfp")); + + TestUtil.serialise(doc, "entity_additional/externallydefined", "externallydefined"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(exDefined,doc,0); + + TestUtil.validateProperty(exDefined, "setDefinition", new Object[] {null}, URI.class); + exDefined.setDefinition(null); + TestUtil.validateIdentified(exDefined,doc,1); + + TestUtil.validateProperty(exDefined, "setTypes", new Object[] {null}, List.class); + exDefined.setTypes(null); + TestUtil.validateIdentified(exDefined,doc,2); + + exDefined2.setDefinition(null); + TestUtil.validateIdentified(exDefined2,doc,1,3); + } +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ImplementationTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ImplementationTest.java index a62686a..1919c3b 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ImplementationTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ImplementationTest.java @@ -10,7 +10,9 @@ import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.Role; @@ -25,14 +27,16 @@ public void testImplementation() throws SBOLGraphException, IOException Component TetR_protein=SBOLAPI.createComponent(doc, "TetR_protein", ComponentType.Protein.getUrl(), "TetR", "TetR protein", Role.TF); - Implementation impl=doc.createImplementation("impl1"); impl.setComponent(TetR_protein.getUri()); TestUtil.serialise(doc, "entity/implementation", "implementation"); - System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(impl,doc,0); } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InteractionTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InteractionTest.java new file mode 100644 index 0000000..de8f2e0 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InteractionTest.java @@ -0,0 +1,58 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Implementation; +import org.sbolstandard.core3.entity.Interaction; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.InteractionType; +import org.sbolstandard.core3.vocabulary.Orientation; +import org.sbolstandard.core3.vocabulary.ParticipationRole; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class InteractionTest extends TestCase { + + public void testInteraction() throws SBOLGraphException, IOException, Exception + { + String baseUri="https://sbolstandard.org/examples/"; + SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); + + Component i13504_system=SBOLAPI.createComponent(doc,"i13504_system", ComponentType.DNA.getUrl(), "i13504 system", null, Role.FunctionalCompartment); + + Interaction interaction= i13504_system.createInteraction(Arrays.asList(InteractionType.GeneticProduction)); + + TestUtil.serialise(doc, "entity_additional/interaction", "interaction"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(interaction,doc,0); + + //Interaction.types cannot be empty + TestUtil.validateProperty(interaction, "setTypes", new Object[] {null}, List.class); + TestUtil.validateProperty(interaction, "setTypes", new Object[] {new ArrayList()}, List.class); + + interaction.setTypes(null); + + TestUtil.validateIdentified(interaction,doc,1); + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InterfaceTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InterfaceTest.java index 872803a..21ca656 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InterfaceTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/InterfaceTest.java @@ -12,7 +12,9 @@ import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.Role; @@ -44,9 +46,12 @@ public void testInterface() throws SBOLGraphException, IOException compInterface.setNonDirectionals(Arrays.asList(aTCSubComponent.getUri())); TestUtil.serialise(doc, "entity/interface", "interface"); - System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(compInterface,doc,0); } } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/LocalSubComponentTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/LocalSubComponentTest.java new file mode 100644 index 0000000..c19a22b --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/LocalSubComponentTest.java @@ -0,0 +1,60 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Implementation; +import org.sbolstandard.core3.entity.Interaction; +import org.sbolstandard.core3.entity.LocalSubComponent; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.InteractionType; +import org.sbolstandard.core3.vocabulary.Orientation; +import org.sbolstandard.core3.vocabulary.ParticipationRole; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class LocalSubComponentTest extends TestCase { + + public void testLocalSubComponent() throws SBOLGraphException, IOException, Exception + { + String baseUri="https://sbolstandard.org/examples/"; + SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); + + Component i13504_system=SBOLAPI.createComponent(doc,"i13504_system", ComponentType.DNA.getUrl(), "i13504 system", null, Role.FunctionalCompartment); + + LocalSubComponent lsComponent = i13504_system.createLocalSubComponent(Arrays.asList(ComponentType.DNA.getUrl())); + + TestUtil.serialise(doc, "entity_additional/localsubcomponent", "localsubcomponent"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(lsComponent,doc,0); + //LocalSubComponent.types cannot be empty + TestUtil.validateProperty(lsComponent, "setTypes", new Object[] {null}, List.class); + TestUtil.validateProperty(lsComponent, "setTypes", new Object[] {new ArrayList()}, List.class); + + lsComponent.setTypes(null); + TestUtil.validateIdentified(lsComponent,doc,1); + + lsComponent.setTypes(new ArrayList()); + TestUtil.validateIdentified(lsComponent,doc,1); + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ModelTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ModelTest.java index 1b5445f..e4be003 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ModelTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ModelTest.java @@ -3,6 +3,7 @@ import java.io.IOException; import java.net.URI; import java.util.Arrays; +import java.util.List; import org.sbolstandard.core3.api.SBOLAPI; import org.sbolstandard.core3.entity.Component; @@ -11,7 +12,9 @@ import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.ModelFramework; import org.sbolstandard.core3.vocabulary.ModelLanguage; @@ -20,7 +23,7 @@ public class ModelTest extends TestCase { - public void testInterface() throws SBOLGraphException, IOException + public void testInterface() throws SBOLGraphException, IOException, Exception { String namespace="https://sbolstandard.org"; String baseUri=namespace + "/examples/"; @@ -32,9 +35,24 @@ public void testInterface() throws SBOLGraphException, IOException toggleSwitch.setModels(Arrays.asList(model.getUri())); TestUtil.serialise(doc, "entity/model", "model"); - System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(model,doc,0); + + TestUtil.validateProperty(model, "setSource", new Object[] {null}, URI.class); + model.setSource(null); + TestUtil.validateIdentified(model,doc,1); + + TestUtil.validateProperty(model, "setFramework", new Object[] {null}, URI.class); + model.setFramework(null); + TestUtil.validateIdentified(model,doc,2); + + TestUtil.validateProperty(model, "setLanguage", new Object[] {null}, URI.class); + model.setLanguage(null); + TestUtil.validateIdentified(model,doc,3); } } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ParticipantTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ParticipantTest.java new file mode 100644 index 0000000..d2b4c1d --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/ParticipantTest.java @@ -0,0 +1,73 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Implementation; +import org.sbolstandard.core3.entity.Interaction; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.InteractionType; +import org.sbolstandard.core3.vocabulary.Orientation; +import org.sbolstandard.core3.vocabulary.ParticipationRole; +import org.sbolstandard.core3.vocabulary.Role; + +import junit.framework.TestCase; + +public class ParticipantTest extends TestCase { + + public void testParticipation() throws SBOLGraphException, IOException, Exception + { + String baseUri="https://sbolstandard.org/examples/"; + SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); + + Component device=doc.createComponent("i13504", Arrays.asList(ComponentType.DNA.getUrl())); + String gfp_na="atgcgtaaaggagaagaacttttcactggagttgtcccaattcttgttgaattagatggtgatgttaatgggcacaaattttctgtcagtggagagggtgaaggtgatgcaacatacggaaaacttacccttaaatttatttgcactactggaaaactacctgttccatggccaacacttgtcactactttcggttatggtgttcaatgctttgcgagatacccagatcatatgaaacagcatgactttttcaagagtgccatgcccgaaggttatgtacaggaaagaactatatttttcaaagatgacgggaactacaagacacgtgctgaagtcaagtttgaaggtgatacccttgttaatagaatcgagttaaaaggtattgattttaaagaagatggaaacattcttggacacaaattggaatacaactataactcacacaatgtatacatcatggcagacaaacaaaagaatggaatcaaagttaacttcaaaattagacacaacattgaagatggaagcgttcaactagcagaccattatcaacaaaatactccaattggcgatggccctgtccttttaccagacaaccattacctgtccacacaatctgccctttcgaaagatcccaacgaaaagagagaccacatggtccttcttgagtttgtaacagctgctgggattacacatggcatggatgaactatacaaataataa"; + Component gfp=SBOLAPI.createDnaComponent(doc, "E0040", "gfp", "gfp coding sequence", Role.CDS, gfp_na); + + SubComponent gfpSubComponent=SBOLAPI.appendComponent(doc, device,gfp, Orientation.inline); + + Component i13504_system=SBOLAPI.createComponent(doc,"i13504_system", ComponentType.DNA.getUrl(), "i13504 system", null, Role.FunctionalCompartment); + Component GFP=SBOLAPI.createComponent(doc, "GFP_protein", ComponentType.Protein.getUrl(), "GFP", "GFP", null); + SubComponent i13504SubComponent=SBOLAPI.addSubComponent(i13504_system, device); + SubComponent gfpProteinSubComponent=SBOLAPI.addSubComponent(i13504_system, GFP); + + ComponentReference gfpCDSReference=i13504_system.createComponentReference(gfpSubComponent, i13504SubComponent); + + Interaction interaction= i13504_system.createInteraction(Arrays.asList(InteractionType.GeneticProduction)); + org.sbolstandard.core3.entity.Participation participation= interaction.createParticipation(Arrays.asList(ParticipationRole.Template), gfpCDSReference.getUri()); + interaction.createParticipation(Arrays.asList(ParticipationRole.Product), gfpProteinSubComponent.getUri()); + + TestUtil.serialise(doc, "entity_additional/participation", "participation"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(participation,doc,0); + + TestUtil.validateProperty(participation, "setRoles", new Object[] {null}, List.class); + TestUtil.validateProperty(participation, "setRoles", new Object[] {new ArrayList()}, List.class); + + participation.setRoles(null); + TestUtil.validateIdentified(participation,doc,1); + + participation.setRoles(new ArrayList()); + TestUtil.validateIdentified(participation,doc,1); + + } + +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/RangeTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/RangeTest.java new file mode 100644 index 0000000..6f21297 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/RangeTest.java @@ -0,0 +1,96 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Cut; +import org.sbolstandard.core3.entity.Feature; +import org.sbolstandard.core3.entity.Location; +import org.sbolstandard.core3.entity.Location.LocationBuilder; +import org.sbolstandard.core3.entity.Range; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.Sequence; +import org.sbolstandard.core3.entity.SequenceFeature; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Encoding; +import org.sbolstandard.core3.vocabulary.Orientation; +import org.sbolstandard.core3.vocabulary.RestrictionType; +import org.sbolstandard.core3.vocabulary.Role; + +import jakarta.validation.Constraint; +import junit.framework.TestCase; + +public class RangeTest extends TestCase { + + public void testRange() throws SBOLGraphException, IOException, Exception + { + URI base=URI.create("https://synbiohub.org/public/igem/"); + SBOLDocument doc=new SBOLDocument(base); + + String term_na="ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc"; + Component device=doc.createComponent("i13504", Arrays.asList(ComponentType.DNA.getUrl())); + SBOLAPI.addSequence(doc, device, Encoding.NucleicAcid, ""); + + Component term=SBOLAPI.createDnaComponent(doc, "B0015", "terminator", "B0015 double terminator", Role.Terminator,term_na); + SubComponent termSubComponent=device.createSubComponent(term.getUri()); + termSubComponent.setOrientation(Orientation.inline); + + Sequence i13504Sequence= doc.getIdentified(device.getSequences().get(0),Sequence.class); + + int start=i13504Sequence.getElements().length() + 1; + int end=start + term_na.length()-1; + + i13504Sequence.setElements(i13504Sequence.getElements() + term_na); + LocationBuilder locationBuilder=new Location.RangeLocationBuilder(start, end,i13504Sequence.getUri()); + locationBuilder.setOrientation(Orientation.inline); + Range range=(Range)termSubComponent.createLocation(locationBuilder); + + + TestUtil.serialise(doc, "entity_additional/range", "range"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(range,doc,0); + + //Range.start cannot be empty + TestUtil.validateProperty(range, "setStart", new Object[] {Optional.empty()}, Optional.class); + TestUtil.validateProperty(range, "setEnd", new Object[] {Optional.empty()}, Optional.class); + range.setStart(Optional.empty()); + range.setEnd(Optional.empty()); + TestUtil.validateIdentified(range,doc,2); + + //Range.start cannot be negative + range.setStart(Optional.of(-1)); + range.setEnd(Optional.of(-1)); + TestUtil.validateIdentified(range,doc,2); + + //Range.start cannot be negative + range.setStart(Optional.of(0)); + range.setEnd(Optional.of(0)); + TestUtil.validateIdentified(range,doc,2); + + //Range.start cannot be negative + range.setStart(Optional.of(1)); + range.setEnd(Optional.of(2)); + TestUtil.validateIdentified(range,doc,0); + + + } +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SequenceFeatureTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SequenceFeatureTest.java index e778003..36e56b3 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SequenceFeatureTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SequenceFeatureTest.java @@ -17,7 +17,9 @@ import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.Orientation; import org.sbolstandard.core3.vocabulary.Role; @@ -37,10 +39,16 @@ public void testSequenceFeature() throws SBOLGraphException, IOException Sequence seq= (Sequence)doc.getIdentified(gfp.getSequences().get(0),Sequence.class); RangeLocationBuilder location=new RangeLocationBuilder(1, 3, seq.getUri()); - gfp.createSequenceFeature(Arrays.asList(location)); + SequenceFeature feature=gfp.createSequenceFeature(Arrays.asList(location)); - System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); - + + TestUtil.serialise(doc, "entity_additional/sequencefeature", "sequencefeature"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(feature,doc,0); } } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SubComponentTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SubComponentTest.java new file mode 100644 index 0000000..5f4bf67 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/entity/test/SubComponentTest.java @@ -0,0 +1,80 @@ +package org.sbolstandard.core3.entity.test; + +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; + +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Collection; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ComponentReference; +import org.sbolstandard.core3.entity.Cut; +import org.sbolstandard.core3.entity.Feature; +import org.sbolstandard.core3.entity.Location; +import org.sbolstandard.core3.entity.Location.LocationBuilder; +import org.sbolstandard.core3.entity.Range; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.Sequence; +import org.sbolstandard.core3.entity.SequenceFeature; +import org.sbolstandard.core3.entity.SubComponent; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.vocabulary.ComponentType; +import org.sbolstandard.core3.vocabulary.Encoding; +import org.sbolstandard.core3.vocabulary.Orientation; +import org.sbolstandard.core3.vocabulary.RestrictionType; +import org.sbolstandard.core3.vocabulary.Role; + +import jakarta.validation.Constraint; +import junit.framework.TestCase; + +public class SubComponentTest extends TestCase { + + public void testRange() throws SBOLGraphException, IOException, Exception + { + URI base=URI.create("https://synbiohub.org/public/igem/"); + SBOLDocument doc=new SBOLDocument(base); + + String term_na="ccaggcatcaaataaaacgaaaggctcagtcgaaagactgggcctttcgttttatctgttgtttgtcggtgaacgctctc"; + Component device=doc.createComponent("i13504", Arrays.asList(ComponentType.DNA.getUrl())); + SBOLAPI.addSequence(doc, device, Encoding.NucleicAcid, ""); + + Component term=SBOLAPI.createDnaComponent(doc, "B0015", "terminator", "B0015 double terminator", Role.Terminator,term_na); + SubComponent termSubComponent=device.createSubComponent(term.getUri()); + termSubComponent.setOrientation(Orientation.inline); + + Sequence i13504Sequence= doc.getIdentified(device.getSequences().get(0),Sequence.class); + + int start=i13504Sequence.getElements().length() + 1; + int end=start + term_na.length()-1; + + i13504Sequence.setElements(i13504Sequence.getElements() + term_na); + LocationBuilder locationBuilder=new Location.RangeLocationBuilder(start, end,i13504Sequence.getUri()); + locationBuilder.setOrientation(Orientation.inline); + Range range=(Range)termSubComponent.createLocation(locationBuilder); + + LocationBuilder locationBuilder2=new Location.RangeLocationBuilder(start+1, end,i13504Sequence.getUri()); + Range range2=(Range)termSubComponent.createSourceLocation(locationBuilder2); + + TestUtil.serialise(doc, "entity_additional/subcomponent", "subcomponent"); + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); + TestUtil.assertReadWrite(doc); + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + TestUtil.validateIdentified(termSubComponent,doc,0); + + TestUtil.validateProperty(termSubComponent, "setIsInstanceOf", new Object[] {null}, URI.class); + termSubComponent.setIsInstanceOf(null); + range.setEnd(Optional.empty()); + range2.setEnd(Optional.empty()); + TestUtil.validateIdentified(termSubComponent,doc,3); + } +} diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/measure/test/MeasureTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/measure/test/MeasureTest.java index 228cfc2..b17aa7f 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/measure/test/MeasureTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/measure/test/MeasureTest.java @@ -5,6 +5,8 @@ import java.net.URI; import java.util.Arrays; import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; import org.sbolstandard.core3.api.SBOLAPI; import org.sbolstandard.core3.entity.Component; @@ -15,18 +17,23 @@ import org.sbolstandard.core3.entity.measure.SIPrefix; import org.sbolstandard.core3.entity.measure.SingularUnit; import org.sbolstandard.core3.entity.measure.UnitDivision; +import org.sbolstandard.core3.entity.measure.UnitExponentiation; +import org.sbolstandard.core3.entity.measure.UnitMultiplication; import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.util.URINameSpace; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.validation.SBOLValidator; import org.sbolstandard.core3.vocabulary.ComponentType; import junit.framework.TestCase; public class MeasureTest extends TestCase { - public void test() throws SBOLGraphException, IOException + public void test() throws SBOLGraphException, IOException, Exception { String baseUri="https://sbolstandard.org/examples/"; SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); @@ -40,7 +47,7 @@ public void test() throws SBOLGraphException, IOException liter.setComment("The litre is a unit of volume defined as 1.0e-3 cubic metre."); liter.setAlternativeSymbols(Arrays.asList("L", "L2")); liter.setLongComment("This is an example long comment."); - liter.setFactor(0.001f); + liter.setFactor(Optional.of(0.001f)); SingularUnit mole=doc.createSingularUnit("mole", "mol", "mole"); @@ -59,10 +66,10 @@ public void test() throws SBOLGraphException, IOException measure.setTypes(Arrays.asList(URINameSpace.SBO.local("0000196"),URINameSpace.SBO.local("0000197"))); SingularUnit kelvin=doc.createSingularUnit("kelvin", "kelvin", "kelvin"); - doc.createUnitMultiplication("kelvinMole", "K mol", "kelvinMole", kelvin.getUri(), mole.getUri()); + UnitMultiplication um= doc.createUnitMultiplication("kelvinMole", "K mol", "kelvinMole", kelvin.getUri(), mole.getUri()); SingularUnit meter=doc.createSingularUnit("meter", "m", "meter"); - doc.createUnitExponentiation("cubicMeter", "m3", "cubicMeter", meter.getUri(), 3); + UnitExponentiation m3=doc.createUnitExponentiation("cubicMeter", "m3", "cubicMeter", meter.getUri(), 3); TestUtil.serialise(doc, "measurement_entity/measurement", "measurement"); SBOLDocument doc2=SBOLIO.read(new File("output/measurement_entity/measurement/measurement.ttl"), SBOLFormat.TURTLE); @@ -89,10 +96,92 @@ public void test() throws SBOLGraphException, IOException } } + //TestUtil.assertReadWrite(doc); - TestUtil.assertReadWrite(doc); + + //measure.setTest(Optional.of(5)); + //CaCl2.g + //TestUtil.validateIdentified(measure, 0); + //TestUtil.validateDocument(doc, 0); + + /*URI tmp=measure.getUnit(); + measure.setUnit(null); + TestUtil.validateIdentified(measure, doc, 1); + measure.setUnit(tmp); + TestUtil.validateIdentified(measure, doc, 0); + */ + + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + Optional temp=measure.getValue(); + measure.setValue(Optional.of(4f)); + TestUtil.validateIdentified(measure,doc, 0); + + TestUtil.validateProperty(measure, "setValue", new Object[] {Optional.empty()}, Optional.class); + TestUtil.validateProperty(measure, "setValue", new Object[] {null}, Optional.class); + measure.setValue(Optional.empty()); + TestUtil.validateIdentified(measure, doc, 1); + measure.setValue(null); + TestUtil.validateIdentified(measure, doc, 1); + + TestUtil.validateIdentified(CaCl2, 1); + measure.setValue(temp); + TestUtil.validateIdentified(CaCl2, 0); + + TestUtil.validateProperty(measure, "setUnit", new Object[] {null}, URI.class); + URI tempURI=measure.getUnit(); + measure.setUnit(null); + TestUtil.validateIdentified(measure, doc, 1); + measure.setUnit(tempURI); + + TestUtil.validateProperty(millimole, "setPrefix", new Object[] {null}, URI.class); + TestUtil.validateProperty(millimole, "setUnit", new Object[] {null}, URI.class); + TestUtil.validateProperty(millimole, "setSymbol", new Object[] {null}, String.class); + TestUtil.validateProperty(millimole, "setSymbol", new Object[] {""}, String.class); + TestUtil.validateProperty(millimole, "setLabel", new Object[] {null}, String.class); + TestUtil.validateProperty(millimole, "setLabel", new Object[] {""}, String.class); + millimole.setPrefix(null); + millimole.setUnit(null); + millimole.setSymbol(null); + millimole.setLabel(null); + TestUtil.validateIdentified(millimole,doc, 4); + TestUtil.validateDocument(doc, 4); + millimole.setSymbol(""); + millimole.setLabel(""); + TestUtil.validateIdentified(millimole,doc, 4); + TestUtil.validateDocument(doc, 4); + + TestUtil.validateProperty(milli, "setFactor", new Object[] {null}, Optional.class); + TestUtil.validateProperty(milli, "setFactor", new Object[] {Optional.empty()}, Optional.class); + milli.setFactor(Optional.empty()); + TestUtil.validateIdentified(milli,1); + milli.setFactor(null); + TestUtil.validateIdentified(milli,1); + + TestUtil.validateDocument(doc,5); + + TestUtil.validateProperty(milliMolePerLiter, "setDenominator", new Object[] {null}, URI.class); + TestUtil.validateProperty(milliMolePerLiter, "setNumerator", new Object[] {null}, URI.class); + milliMolePerLiter.setDenominator(null); + milliMolePerLiter.setNumerator(null); + TestUtil.validateIdentified(milliMolePerLiter,doc,2,7); + + TestUtil.validateProperty(m3, "setBase", new Object[] {null}, URI.class); + TestUtil.validateProperty(m3, "setExponent", new Object[] {Optional.empty()}, Optional.class); + TestUtil.validateProperty(m3, "setExponent", new Object[] {null}, Optional.class); + m3.setExponent(Optional.empty()); + m3.setBase(null); + TestUtil.validateIdentified(m3,doc,2,9); + + m3.setExponent(null); + TestUtil.validateIdentified(m3,2); + + TestUtil.validateProperty(um, "setTerm1", new Object[] {null}, URI.class); + TestUtil.validateProperty(um, "setTerm2", new Object[] {null}, URI.class); + um.setTerm1(null); + um.setTerm2(null); + TestUtil.validateIdentified(um,doc,2,11); } - } // om:hasFactor "0.001"^^ ; \ No newline at end of file diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/test/AppTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/test/AppTest.java index c894034..660bb24 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/test/AppTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/test/AppTest.java @@ -101,34 +101,31 @@ public void testReflection() throws SBOLGraphException { SBOLAPI.createInteraction(Arrays.asList(InteractionType.Stimulation),popsReceiver, pTetR, Arrays.asList(ParticipationRole.Stimulated), TetR_protein, Arrays.asList(ParticipationRole.Stimulator)); } - middle= System.nanoTime(); + //middle= System.nanoTime(); end= System.nanoTime(); - print(start,middle, end); + print(start,end); start=System.nanoTime(); - for (int i=0;i<300000;i++) + for (int i=0;i<3000;i++) { popsReceiver.getInteractions(); } - middle= System.nanoTime(); end= System.nanoTime(); - print(start,middle, end); + print(start, end); } - private void print(long start, long middle, long end) + private void print(long start, long end) { - long first=middle-start; - long second=end-middle; - System.out.println(String.format("First execution time: %s ns, %s ms", first, first/1000000)); - System.out.println(String.format("Second execution time: %s ns, %s ms", second, second/1000000)); + long first=end-start; + System.out.println(String.format("Execution time: %s ns, %s ms", first, first/1000000)); } } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/test/TestUtil.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/test/TestUtil.java index e188184..bab0cdb 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/test/TestUtil.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/test/TestUtil.java @@ -3,6 +3,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.lang.reflect.Method; import java.net.URI; import java.nio.charset.Charset; import java.util.Collections; @@ -10,6 +11,7 @@ import java.util.Set; import org.apache.commons.lang3.CharSet; +import org.apache.commons.lang3.StringUtils; import org.apache.jena.datatypes.xsd.XSDDateTime; import org.apache.jena.riot.RDFFormat; import org.sbolstandard.core3.api.SBOLAPI; @@ -18,9 +20,13 @@ import org.sbolstandard.core3.entity.provenance.*; import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.util.Configuration; import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.util.SBOLUtil; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.validation.IdentityValidator; import org.sbolstandard.core3.validation.SBOLComparator; +import org.sbolstandard.core3.validation.SBOLValidator; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.MeasureDataModel; @@ -31,7 +37,7 @@ public class TestUtil { public static final String baseOutput="output"; - public static void serialise(SBOLDocument doc, String directory, String file) throws FileNotFoundException, IOException + public static void serialise(SBOLDocument doc, String directory, String file) throws FileNotFoundException, IOException, SBOLGraphException { File outputDir=new File(baseOutput + "/" + directory); if (!outputDir.exists()) @@ -61,655 +67,656 @@ public static void assertReadWrite(SBOLDocument doc) throws IOException, SBOLGra // assertEqual(doc, doc2); } - public static void assertEqual(SBOLDocument doc1, SBOLDocument doc2) throws SBOLGraphException - { - assertEqualEntity(doc1.getActivities(), doc2,Activity.class); - assertEqualEntity(doc1.getAgents(), doc2,Agent.class); - assertEqualEntity(doc1.getAttachments(), doc2,Attachment.class); - assertEqualEntity(doc1.getBinaryPrefixes(), doc2,BinaryPrefix.class); - assertEqualEntity(doc1.getCollections(), doc2,Collection.class); - assertEqualEntity(doc1.getCombinatorialDerivations(), doc2,CombinatorialDerivation.class); - assertEqualEntity(doc1.getComponents(), doc2,Component.class); - assertEqualEntity(doc1.getExperimentalData(), doc2,ExperimentalData.class); - assertEqualEntity(doc1.getExperiments(), doc2,Experiment.class); - assertEqualEntity(doc1.getImplementations(), doc2,Implementation.class); - assertEqualEntity(doc1.getModels(), doc2,Model.class); - assertEqualEntity(doc1.getPlans(), doc2,Plan.class); - assertEqualEntity(doc1.getPrefixedUnits(), doc2,PrefixedUnit.class); - assertEqualEntity(doc1.getSequences(), doc2,Sequence.class); - assertEqualEntity(doc1.getSingularUnits(), doc2,SingularUnit.class); - assertEqualEntity(doc1.getSIPrefixes(), doc2,SIPrefix.class); - assertEqualEntity(doc1.getUnitDivisions(), doc2,UnitDivision.class); - assertEqualEntity(doc1.getUnitExponentiations(), doc2,UnitExponentiation.class); - assertEqualEntity(doc1.getUnitMultiplications(), doc2,UnitMultiplication.class); - - /*if (doc1.getAgents()!=null) - { - for (Agent agent:doc1.getAgents()) - { - Agent agent2=(Agent) doc2.getIdentified(agent.getUri(), Agent.class); - assertEqual(agent, agent2); - } - }*/ - - } - - private static void assertEqualEntity(List entities, SBOLDocument doc2, Class classType) throws SBOLGraphException - { - if (entities!=null) - { - for (T entity:entities) - { - T entity2=(T) doc2.getIdentified(entity.getUri(), classType ); - assertEqualEntity(entity,entity2); - } - } - } - - private static Identified getEntity(List entities, URI uri) - { - if (entities!=null) - { - for (T entity:entities) - { - if (entity.getUri().equals(uri)) - { - return entity; - } - } - } - return null; - } - - - private static void assertEqualEntity(List entities, List entities2) throws SBOLGraphException - { - if (entities!=null && entities2!=null) - { - for (T entity:entities) - { - Identified entity2=getEntity(entities2, entity.getUri()); - assertEqualEntity(entity,entity2); - } - } - } - - public static void assertEqualEntity(Identified identified1, Identified identified2) throws SBOLGraphException - { - if (identified1!=null && identified2==null) - { - throw new SBOLGraphException("Could not compare " + identified1.getUri()); - } - - if (identified1 instanceof Activity) - { - assertEqualActivity((Activity)identified1, (Activity) identified2); - } - else if (identified1 instanceof Agent) - { - assertEqualAgent((Agent)identified1, (Agent) identified2); - } - else if (identified1 instanceof Attachment) - { - assertEqualAttachment((Attachment)identified1, (Attachment) identified2); - } - else if (identified1 instanceof BinaryPrefix) - { - assertEqualBinaryPrefix((BinaryPrefix)identified1, (BinaryPrefix) identified2); - } - else if (identified1 instanceof Collection) - { - assertEqualCollection((Collection)identified1, (Collection) identified2); - } - else if (identified1 instanceof CombinatorialDerivation) - { - assertEqualCombinatorialDerivation((CombinatorialDerivation)identified1, (CombinatorialDerivation) identified2); - } - - else if (identified1 instanceof Component) - { - assertEqualComponent((Component)identified1, (Component) identified2); - } - else if (identified1 instanceof ExperimentalData) - { - assertEqualExperimentalData((ExperimentalData)identified1, (ExperimentalData) identified2); - } - else if (identified1 instanceof Experiment) - { - assertEqualExperiment((Experiment)identified1, (Experiment) identified2); - } - else if (identified1 instanceof Implementation) - { - assertEqualImplementation((Implementation)identified1, (Implementation) identified2); - } - else if (identified1 instanceof Model) - { - assertEqualModel((Model)identified1, (Model) identified2); - } - else if (identified1 instanceof Model) - { - assertEqualModel((Model)identified1, (Model) identified2); - } - else if (identified1 instanceof Plan) - { - assertEqualPlan((Plan)identified1, (Plan) identified2); - } - else if (identified1 instanceof PrefixedUnit) - { - assertEqualPrefixedUnit((PrefixedUnit)identified1, (PrefixedUnit) identified2); - } - else if (identified1 instanceof Sequence) - { - assertEqualSequence((Sequence)identified1, (Sequence)identified2); - } - else if (identified1 instanceof SingularUnit) - { - assertEqualSingularUnit((SingularUnit)identified1, (SingularUnit) identified2); - } - else if (identified1 instanceof SIPrefix) - { - assertEqualSIPrefix((SIPrefix)identified1, (SIPrefix) identified2); - } - else if (identified1 instanceof UnitDivision) - { - assertEqualUnitDivision((UnitDivision)identified1, (UnitDivision) identified2); - } - - else if (identified1 instanceof UnitExponentiation) - { - assertEqualUnitExponentiation((UnitExponentiation)identified1, (UnitExponentiation) identified2); - } - else if (identified1 instanceof UnitMultiplication) - { - assertEqualUnitMultiplication((UnitMultiplication)identified1, (UnitMultiplication) identified2); - } - else if (identified1 instanceof Measure) - { - assertEqualMeasure((Measure)identified1, (Measure) identified2); - } - else if (identified1 instanceof Association) - { - assertEqualAssociation((Association)identified1, (Association) identified2); - } - else if (identified1 instanceof Usage) - { - assertEqualUsage((Usage)identified1, (Usage) identified2); - } - else if (identified1 instanceof VariableFeature) - { - assertEqualVariableComponent((VariableFeature)identified1, (VariableFeature) identified2); - } - else if (identified1 instanceof ExternallyDefined) - { - assertEqualExternallyDefined((ExternallyDefined)identified1, (ExternallyDefined) identified2); - } - else if (identified1 instanceof ComponentReference) - { - assertEqualComponentReference((ComponentReference)identified1, (ComponentReference) identified2); - } - else if (identified1 instanceof Constraint) - { - assertEqualConstraint((Constraint)identified1, (Constraint) identified2); - } - else if (identified1 instanceof LocalSubComponent) - { - assertEqualLocalSubComponent((LocalSubComponent)identified1, (LocalSubComponent) identified2); - } - else if (identified1 instanceof SequenceFeature) - { - assertEqualSequenceFeature((SequenceFeature)identified1, (SequenceFeature) identified2); - } - else if (identified1 instanceof SubComponent) - { - assertEqualSubComponent((SubComponent)identified1, (SubComponent) identified2); - } - else if (identified1 instanceof Interaction) - { - assertEqualInteraction((Interaction)identified1, (Interaction) identified2); - } - else if (identified1 instanceof Participation) - { - assertEqualParticipation((Participation)identified1, (Participation) identified2); - } - else - { - throw new SBOLGraphException ("No assert method has been defined for " + identified1.getUri()); - } - } - - private static void assertEqualActivity(Activity entity1, Activity entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), ProvenanceDataModel.Activity.type); - assertEqual(entity1, entity2, entity1.getWasInformedBys(),entity2.getWasInformedBys(), ProvenanceDataModel.Activity.wasInformedBy); - assertEqual(entity1, entity2, entity1.getEndedAtTime(),entity2.getEndedAtTime(), ProvenanceDataModel.Activity.endedAtTime); - assertEqual(entity1, entity2, entity1.getStartedAtTime(),entity2.getStartedAtTime(), ProvenanceDataModel.Activity.startedAtTime); - assertEqualEntity(entity1.getAssociations(), entity2.getAssociations()); - assertEqualEntity(entity1.getUsages(), entity2.getUsages()); - } - } - private static void assertEqualAssociation(Association entity1, Association entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getAgent(),entity2.getAgent(), ProvenanceDataModel.Association.agent); - assertEqual(entity1, entity2, entity1.getPlan(),entity2.getPlan(), ProvenanceDataModel.Association.plan); - assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), ProvenanceDataModel.Association.role); - } - } - - private static void assertEqualUsage(Usage entity1, Usage entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), ProvenanceDataModel.Usage.role); - assertEqual(entity1, entity2, entity1.getEntity(),entity2.getEntity(), ProvenanceDataModel.Usage.entity); - } - } - - private static void assertEqualAgent(Agent entity1, Agent entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - } - } - - private static void assertEqualAttachment(Attachment entity1, Attachment entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getFormat(),entity2.getFormat(), DataModel.Attachment.format); - assertEqual(entity1, entity2, entity1.getHash(),entity2.getHash(), DataModel.Attachment.hash); - assertEqual(entity1, entity2, entity1.getHashAlgorithm(),entity2.getHashAlgorithm(), DataModel.Attachment.hashAlgorithm); - assertEqual(entity1, entity2, entity1.getSource(),entity2.getSource(), DataModel.Attachment.source); - assertEqual(entity1, entity2, entity1.getSize(),entity2.getSize(), DataModel.Attachment.size); - } - } - - private static void assertEqualBinaryPrefix(BinaryPrefix entity1, BinaryPrefix entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualPrefix(entity1, entity2); - } - } - - private static void assertEqualSIPrefix(SIPrefix entity1, SIPrefix entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualPrefix(entity1, entity2); - } - } - - private static void assertEqualPrefix(Prefix entity1, Prefix entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualUnit(entity1, entity2); - assertEqual(entity1, entity2, entity1.getFactor(),entity2.getFactor(), MeasureDataModel.Prefix.factor); - } - } - - private static void assertEqualUnit(Unit entity1, Unit entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getComment(),entity2.getComment(), MeasureDataModel.Unit.comment); - assertEqual(entity1, entity2, entity1.getLabel(),entity2.getLabel(), MeasureDataModel.Unit.label); - assertEqual(entity1, entity2, entity1.getLongComment(),entity2.getLongComment(), MeasureDataModel.Unit.longComment); - assertEqual(entity1, entity2, entity1.getSymbol(),entity2.getSymbol(), MeasureDataModel.Unit.symbol); - assertEqualStrings(entity1, entity2, entity1.getAlternativeLabels(),entity2.getAlternativeLabels(), MeasureDataModel.Unit.alternativeLabel); - assertEqualStrings(entity1, entity2, entity1.getAlternativeSymbols(),entity2.getAlternativeSymbols(), MeasureDataModel.Unit.alternativeSymbol); - } - } - - - private static void assertEqualCollection(Collection entity1, Collection entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getTopLevels(),entity2.getTopLevels(), DataModel.Collection.member); - } - } - - private static void assertEqualCombinatorialDerivation(CombinatorialDerivation entity1, CombinatorialDerivation entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getStrategy(),entity2.getStrategy(), DataModel.CombinatorialDerivation.strategy); - assertEqual(entity1, entity2, entity1.getTemplate(),entity2.getTemplate(), DataModel.CombinatorialDerivation.template); - assertEqualEntity(entity1.getVariableFeatures(), entity2.getVariableFeatures()); - } - } - - private static void assertEqualVariableComponent(VariableFeature entity1, VariableFeature entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getCardinality(),entity2.getCardinality(), DataModel.VariableComponent.cardinality); - assertEqual(entity1, entity2, entity1.getFeature(),entity2.getFeature(), DataModel.VariableComponent.variable); - assertEqual(entity1, entity2, entity1.getVariantCollections(),entity2.getVariantCollections(), DataModel.VariableComponent.variantCollection); - assertEqual(entity1, entity2, entity1.getVariantDerivations(),entity2.getVariantDerivations(), DataModel.VariableComponent.variantDerivation); - assertEqual(entity1, entity2, entity1.getVariants(),entity2.getVariants(), DataModel.VariableComponent.variant); - } - } - - private static void assertEqualComponent(Component entity1, Component entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getModels(),entity2.getModels(), DataModel.Component.model); - assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), DataModel.role); - assertEqual(entity1, entity2, entity1.getSequences(),entity2.getSequences(), DataModel.Component.sequence); - assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), DataModel.type); - assertEqualInterface(entity1.getInterface(),entity2.getInterface()); - assertEqualEntity(entity1.getComponentReferences(), entity2.getComponentReferences()); - assertEqualEntity(entity1.getConstraints(), entity2.getConstraints()); - assertEqualEntity(entity1.getExternallyDefineds(), entity2.getExternallyDefineds()); - assertEqualEntity(entity1.getInteractions(), entity2.getInteractions()); - assertEqualEntity(entity1.getLocalSubComponents(), entity2.getLocalSubComponents()); - assertEqualEntity(entity1.getSequenceFeatures(), entity2.getSequenceFeatures()); - assertEqualEntity(entity1.getSubComponents(), entity2.getSubComponents()); - } - } - - private static void assertEqualInterface(Interface entity1, Interface entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getInputs(),entity2.getInputs(), DataModel.Interface.input); - assertEqual(entity1, entity2, entity1.getNonDirectionals(),entity2.getNonDirectionals(), DataModel.Interface.nondirectional); - assertEqual(entity1, entity2, entity1.getOutputs(),entity2.getOutputs(), DataModel.Interface.output); - } - } - - private static void assertEqualComponentReference(ComponentReference entity1, ComponentReference entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualFeature(entity1, entity2); - assertEqual(entity1, entity2, entity1.getFeature(),entity2.getFeature(), DataModel.ComponentReference.feature); - assertEqual(entity1, entity2, entity1.getInChildOf(),entity2.getInChildOf(), DataModel.ComponentReference.inChildOf); - } - } - - private static void assertEqualConstraint(Constraint entity1, Constraint entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getObject(),entity2.getObject(), DataModel.Constraint.object); - assertEqual(entity1, entity2, entity1.getSubject(),entity2.getSubject(), DataModel.Constraint.subject); - assertEqual(entity1, entity2, entity1.getRestriction(),entity2.getRestriction(), DataModel.Constraint.restriction); - } - } - - private static void assertEqualExternallyDefined(ExternallyDefined entity1, ExternallyDefined entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualFeature(entity1, entity2); - assertEqual(entity1, entity2, entity1.getDefinition(),entity2.getDefinition(), DataModel.ExternalyDefined.definition); - } - } - - private static void assertEqualLocalSubComponent(LocalSubComponent entity1, LocalSubComponent entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualFeature(entity1, entity2); - //TODO: assertEqualLocations(entity1, entity2, entity1.getLocations(),entity2.getLocations(), DataModel.SubComponent.location); - assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), DataModel.type); - } - } - - private static void assertEqualFeature(Feature entity1, Feature entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - if (entity1.getOrientation()!=null) - { - assertEqual(entity1, entity2, entity1.getOrientation().getUri(),entity2.getOrientation().getUri(), DataModel.orientation); - } - assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), DataModel.role); - } - } - - private static void assertEqualSequenceFeature(SequenceFeature entity1, SequenceFeature entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualFeature(entity1, entity2); - } - //TODO: assertEqualLocations(entity1, entity2, entity1.getLocations(),entity2.getLocations(), DataModel.SubComponent.location); - } - - private static void assertEqualSubComponent(SubComponent entity1, SubComponent entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualFeature(entity1, entity2); - //TODO: assertEqualLocations(entity1, entity2, entity1.getLocations(),entity2.getLocations(), DataModel.SubComponent.location); - //TODO: assertEqualLocations(entity1, entity2, entity1.getSourceLocations(),entity2.getSourceLocations(), DataModel.SubComponent.sourcelocation); - assertEqual(entity1, entity2, entity1.getIsInstanceOf(),entity2.getIsInstanceOf(), DataModel.SubComponent.instanceOf); - assertEqual(entity1, entity2, entity1.getRoleIntegration(),entity2.getRoleIntegration(), DataModel.SubComponent.roleIntegration); - } - } - - private static void assertEqualInteraction(Interaction entity1, Interaction entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqualEntity(entity1.getParticipations(), entity2.getParticipations()); - assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), DataModel.type); - } - } - - private static void assertEqualParticipation(Participation entity1, Participation entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getParticipant(), entity2.getParticipant(),DataModel.Participation.participant); - assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), DataModel.role); - } - } - - private static void assertEqualExperimentalData(ExperimentalData entity1, ExperimentalData entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - } - } - - private static void assertEqualExperiment(Experiment entity1, Experiment entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - } - } - - private static void assertEqualImplementation(Implementation entity1, Implementation entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getComponent(), entity2.getComponent(),DataModel.Implementation.built); - } - } - - private static void assertEqualModel(Model entity1, Model entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getFramework(), entity2.getFramework(),DataModel.Model.framework); - assertEqual(entity1, entity2, entity1.getLanguage(), entity2.getLanguage(),DataModel.Model.language); - assertEqual(entity1, entity2, entity1.getSource(), entity2.getSource(),DataModel.Model.source); - } - } - - private static void assertEqualPrefixedUnit(PrefixedUnit entity1, PrefixedUnit entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualUnit(entity1, entity2); - assertEqual(entity1, entity2, entity1.getPrefix(), entity2.getPrefix(),MeasureDataModel.PrefixedUnit.prefix); - assertEqual(entity1, entity2, entity1.getUnit(), entity2.getUnit(),MeasureDataModel.PrefixedUnit.unit); - } - } - - private static void assertEqualSingularUnit(SingularUnit entity1, SingularUnit entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualUnit(entity1, entity2); - assertEqual(entity1, entity2, entity1.getFactor(), entity2.getFactor(),MeasureDataModel.SingularUnit.factor); - assertEqual(entity1, entity2, entity1.getUnit(), entity2.getUnit(),MeasureDataModel.SingularUnit.unit); - } - } - private static void assertEqualSequence(Sequence entity1, Sequence entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getElements(), entity2.getElements(),DataModel.Sequence.elements); - assertEqual(entity1, entity2, entity1.getEncoding().getUri(), entity2.getEncoding().getUri(),DataModel.Sequence.encoding); - } - } - - private static void assertEqualUnitDivision(UnitDivision entity1, UnitDivision entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualUnit(entity1, entity2); - assertEqual(entity1, entity2, entity1.getDenominator(), entity2.getDenominator(),MeasureDataModel.UnitDivision.denominator); - assertEqual(entity1, entity2, entity1.getNumerator(), entity2.getNumerator(),MeasureDataModel.UnitDivision.numerator); - } - } - - private static void assertEqualUnitExponentiation (UnitExponentiation entity1, UnitExponentiation entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualUnit(entity1, entity2); - assertEqual(entity1, entity2, entity1.getBase(), entity2.getBase(),MeasureDataModel.UnitExponentiation.base); - assertEqual(entity1, entity2, entity1.getExponent(), entity2.getExponent(),MeasureDataModel.UnitExponentiation.base); - } - } - - private static void assertEqualUnitMultiplication(UnitMultiplication entity1, UnitMultiplication entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqualUnit(entity1, entity2); - assertEqual(entity1, entity2, entity1.getTerm1(), entity2.getTerm1(),MeasureDataModel.UnitMultiplication.term1); - assertEqual(entity1, entity2, entity1.getTerm2(), entity2.getTerm2(),MeasureDataModel.UnitMultiplication.term2); - } - } - - private static void assertEqualPlan(Plan entity1, Plan entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - } - } - - private static void assertEqualMeasure(Measure entity1, Measure entity2) throws SBOLGraphException - { - if (entity1!=null) - { - assertEqual(entity1, entity2); - assertEqual(entity1, entity2, entity1.getUnit(),entity2.getUnit(), MeasureDataModel.Measure.unit); - assertEqual(entity1, entity2, entity1.getValue(),entity2.getValue(), MeasureDataModel.Measure.value); - assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), MeasureDataModel.Measure.type); - } - } - - private static void assertEqual(TopLevel topLevel1, TopLevel topLevel2) throws SBOLGraphException - { - assertEqual((Identified)topLevel1, (Identified)topLevel2); - assertEqual(topLevel1,topLevel2, topLevel1.getNamespace(), topLevel2.getNamespace(), DataModel.TopLevel.namespace); - assertEqual(topLevel1, topLevel2, topLevel1.getAttachments(),topLevel2.getAttachments(), DataModel.TopLevel.attachment); - } - - private static void assertEqual(Identified identified1, Identified identified2) throws SBOLGraphException - { - assertEqual(identified1, identified2, identified1.getName(),identified2.getName(), DataModel.Identified.name); - assertEqual(identified1, identified2, identified1.getDescription(),identified2.getDescription(), DataModel.Identified.description); - assertEqual(identified1, identified2, identified1.getDisplayId(),identified2.getDisplayId(), DataModel.Identified.displayId); - assertEqual(identified1, identified2, identified1.getUri(),identified2.getUri(), DataModel.Identified.uri); - assertEqual(identified1, identified2, identified1.getWasDerivedFrom(),identified2.getWasDerivedFrom(), DataModel.Identified.wasDerivedFrom); - assertEqual(identified1, identified2, identified1.getWasGeneratedBy(),identified2.getWasGeneratedBy(), DataModel.Identified.wasGeneratedBy); - assertEqualEntity(identified1.getMeasures(), identified2.getMeasures()); - } - - private static void assertEqual(Identified identified1, Identified identified2, String value1, String value2, URI property) - { - String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), value1, value2); - assertEquals(message, value1, value2); - } - - private static void assertEqual(Identified identified1, Identified identified2, URI value1, URI value2, URI property) - { - String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), value1, value2); - assertEquals(message, value1, value2); - } - - private static void assertEqual(Identified identified1, Identified identified2, float value1, float value2, URI property) - { - String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), String.valueOf(value1), String.valueOf(value2)); - assertEquals(message, String.valueOf(value1), String.valueOf(value2)); - } - - private static void assertEqual(Identified identified1, Identified identified2, XSDDateTime value1, XSDDateTime value2, URI property) - { - String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), value1, value2); - assertEquals(message, String.valueOf(value1), String.valueOf(value2)); - } - - private static void assertEqual(Identified identified1, Identified identified2, List value1, List value2, URI property) - { - if (value1!=null && value2!=null) - { - String message=String.format("Could not read the %s property. Entity: %s", property.toString(), identified1.getUri().toString()); - Collections.sort(value1); - Collections.sort(value2); - - assertEquals(message, value1, value2); - } - } - - private static void assertEqualStrings(Identified identified1, Identified identified2, List value1, List value2, URI property) - { - if (value1!=null && value2!=null) - { - String message=String.format("Could not read the %s property. Entity: %s", property.toString(), identified1.getUri().toString()); - Collections.sort(value1); - Collections.sort(value2); - - assertEquals(message, value1, value2); - } - } +// public static void assertEqual(SBOLDocument doc1, SBOLDocument doc2) throws SBOLGraphException +// { +// assertEqualEntity(doc1.getActivities(), doc2,Activity.class); +// assertEqualEntity(doc1.getAgents(), doc2,Agent.class); +// assertEqualEntity(doc1.getAttachments(), doc2,Attachment.class); +// assertEqualEntity(doc1.getBinaryPrefixes(), doc2,BinaryPrefix.class); +// assertEqualEntity(doc1.getCollections(), doc2,Collection.class); +// assertEqualEntity(doc1.getCombinatorialDerivations(), doc2,CombinatorialDerivation.class); +// assertEqualEntity(doc1.getComponents(), doc2,Component.class); +// assertEqualEntity(doc1.getExperimentalData(), doc2,ExperimentalData.class); +// assertEqualEntity(doc1.getExperiments(), doc2,Experiment.class); +// assertEqualEntity(doc1.getImplementations(), doc2,Implementation.class); +// assertEqualEntity(doc1.getModels(), doc2,Model.class); +// assertEqualEntity(doc1.getPlans(), doc2,Plan.class); +// assertEqualEntity(doc1.getPrefixedUnits(), doc2,PrefixedUnit.class); +// assertEqualEntity(doc1.getSequences(), doc2,Sequence.class); +// assertEqualEntity(doc1.getSingularUnits(), doc2,SingularUnit.class); +// assertEqualEntity(doc1.getSIPrefixes(), doc2,SIPrefix.class); +// assertEqualEntity(doc1.getUnitDivisions(), doc2,UnitDivision.class); +// assertEqualEntity(doc1.getUnitExponentiations(), doc2,UnitExponentiation.class); +// assertEqualEntity(doc1.getUnitMultiplications(), doc2,UnitMultiplication.class); +// +// /*if (doc1.getAgents()!=null) +// { +// for (Agent agent:doc1.getAgents()) +// { +// Agent agent2=(Agent) doc2.getIdentified(agent.getUri(), Agent.class); +// assertEqual(agent, agent2); +// } +// }*/ +// +// } +// +// private static void assertEqualEntity(List entities, SBOLDocument doc2, Class classType) throws SBOLGraphException +// { +// if (entities!=null) +// { +// for (T entity:entities) +// { +// T entity2=(T) doc2.getIdentified(entity.getUri(), classType ); +// assertEqualEntity(entity,entity2); +// } +// } +// } +// +// private static Identified getEntity(List entities, URI uri) +// { +// if (entities!=null) +// { +// for (T entity:entities) +// { +// if (entity.getUri().equals(uri)) +// { +// return entity; +// } +// } +// } +// return null; +// } +// +// +// private static void assertEqualEntity(List entities, List entities2) throws SBOLGraphException +// { +// if (entities!=null && entities2!=null) +// { +// for (T entity:entities) +// { +// Identified entity2=getEntity(entities2, entity.getUri()); +// assertEqualEntity(entity,entity2); +// } +// } +// } +// +// public static void assertEqualEntity(Identified identified1, Identified identified2) throws SBOLGraphException +// { +// if (identified1!=null && identified2==null) +// { +// throw new SBOLGraphException("Could not compare " + identified1.getUri()); +// } +// +// if (identified1 instanceof Activity) +// { +// assertEqualActivity((Activity)identified1, (Activity) identified2); +// } +// else if (identified1 instanceof Agent) +// { +// assertEqualAgent((Agent)identified1, (Agent) identified2); +// } +// else if (identified1 instanceof Attachment) +// { +// assertEqualAttachment((Attachment)identified1, (Attachment) identified2); +// } +// else if (identified1 instanceof BinaryPrefix) +// { +// assertEqualBinaryPrefix((BinaryPrefix)identified1, (BinaryPrefix) identified2); +// } +// else if (identified1 instanceof Collection) +// { +// assertEqualCollection((Collection)identified1, (Collection) identified2); +// } +// else if (identified1 instanceof CombinatorialDerivation) +// { +// assertEqualCombinatorialDerivation((CombinatorialDerivation)identified1, (CombinatorialDerivation) identified2); +// } +// +// else if (identified1 instanceof Component) +// { +// assertEqualComponent((Component)identified1, (Component) identified2); +// } +// else if (identified1 instanceof ExperimentalData) +// { +// assertEqualExperimentalData((ExperimentalData)identified1, (ExperimentalData) identified2); +// } +// else if (identified1 instanceof Experiment) +// { +// assertEqualExperiment((Experiment)identified1, (Experiment) identified2); +// } +// else if (identified1 instanceof Implementation) +// { +// assertEqualImplementation((Implementation)identified1, (Implementation) identified2); +// } +// else if (identified1 instanceof Model) +// { +// assertEqualModel((Model)identified1, (Model) identified2); +// } +// else if (identified1 instanceof Model) +// { +// assertEqualModel((Model)identified1, (Model) identified2); +// } +// else if (identified1 instanceof Plan) +// { +// assertEqualPlan((Plan)identified1, (Plan) identified2); +// } +// else if (identified1 instanceof PrefixedUnit) +// { +// assertEqualPrefixedUnit((PrefixedUnit)identified1, (PrefixedUnit) identified2); +// } +// else if (identified1 instanceof Sequence) +// { +// assertEqualSequence((Sequence)identified1, (Sequence)identified2); +// } +// else if (identified1 instanceof SingularUnit) +// { +// assertEqualSingularUnit((SingularUnit)identified1, (SingularUnit) identified2); +// } +// else if (identified1 instanceof SIPrefix) +// { +// assertEqualSIPrefix((SIPrefix)identified1, (SIPrefix) identified2); +// } +// else if (identified1 instanceof UnitDivision) +// { +// assertEqualUnitDivision((UnitDivision)identified1, (UnitDivision) identified2); +// } +// +// else if (identified1 instanceof UnitExponentiation) +// { +// assertEqualUnitExponentiation((UnitExponentiation)identified1, (UnitExponentiation) identified2); +// } +// else if (identified1 instanceof UnitMultiplication) +// { +// assertEqualUnitMultiplication((UnitMultiplication)identified1, (UnitMultiplication) identified2); +// } +// else if (identified1 instanceof Measure) +// { +// assertEqualMeasure((Measure)identified1, (Measure) identified2); +// } +// else if (identified1 instanceof Association) +// { +// assertEqualAssociation((Association)identified1, (Association) identified2); +// } +// else if (identified1 instanceof Usage) +// { +// assertEqualUsage((Usage)identified1, (Usage) identified2); +// } +// else if (identified1 instanceof VariableFeature) +// { +// assertEqualVariableComponent((VariableFeature)identified1, (VariableFeature) identified2); +// } +// else if (identified1 instanceof ExternallyDefined) +// { +// assertEqualExternallyDefined((ExternallyDefined)identified1, (ExternallyDefined) identified2); +// } +// else if (identified1 instanceof ComponentReference) +// { +// assertEqualComponentReference((ComponentReference)identified1, (ComponentReference) identified2); +// } +// else if (identified1 instanceof Constraint) +// { +// assertEqualConstraint((Constraint)identified1, (Constraint) identified2); +// } +// else if (identified1 instanceof LocalSubComponent) +// { +// assertEqualLocalSubComponent((LocalSubComponent)identified1, (LocalSubComponent) identified2); +// } +// else if (identified1 instanceof SequenceFeature) +// { +// assertEqualSequenceFeature((SequenceFeature)identified1, (SequenceFeature) identified2); +// } +// else if (identified1 instanceof SubComponent) +// { +// assertEqualSubComponent((SubComponent)identified1, (SubComponent) identified2); +// } +// else if (identified1 instanceof Interaction) +// { +// assertEqualInteraction((Interaction)identified1, (Interaction) identified2); +// } +// else if (identified1 instanceof Participation) +// { +// assertEqualParticipation((Participation)identified1, (Participation) identified2); +// } +// else +// { +// throw new SBOLGraphException ("No assert method has been defined for " + identified1.getUri()); +// } +// } +// +// private static void assertEqualActivity(Activity entity1, Activity entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), ProvenanceDataModel.Activity.type); +// assertEqual(entity1, entity2, entity1.getWasInformedBys(),entity2.getWasInformedBys(), ProvenanceDataModel.Activity.wasInformedBy); +// assertEqual(entity1, entity2, entity1.getEndedAtTime(),entity2.getEndedAtTime(), ProvenanceDataModel.Activity.endedAtTime); +// assertEqual(entity1, entity2, entity1.getStartedAtTime(),entity2.getStartedAtTime(), ProvenanceDataModel.Activity.startedAtTime); +// assertEqualEntity(entity1.getAssociations(), entity2.getAssociations()); +// assertEqualEntity(entity1.getUsages(), entity2.getUsages()); +// } +// } +// +// private static void assertEqualAssociation(Association entity1, Association entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getAgent(),entity2.getAgent(), ProvenanceDataModel.Association.agent); +// assertEqual(entity1, entity2, entity1.getPlan(),entity2.getPlan(), ProvenanceDataModel.Association.plan); +// assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), ProvenanceDataModel.Association.role); +// } +// } +// +// private static void assertEqualUsage(Usage entity1, Usage entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), ProvenanceDataModel.Usage.role); +// assertEqual(entity1, entity2, entity1.getEntity(),entity2.getEntity(), ProvenanceDataModel.Usage.entity); +// } +// } +// +// private static void assertEqualAgent(Agent entity1, Agent entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// } +// } +// +// private static void assertEqualAttachment(Attachment entity1, Attachment entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getFormat(),entity2.getFormat(), DataModel.Attachment.format); +// assertEqual(entity1, entity2, entity1.getHash(),entity2.getHash(), DataModel.Attachment.hash); +// assertEqual(entity1, entity2, entity1.getHashAlgorithm(),entity2.getHashAlgorithm(), DataModel.Attachment.hashAlgorithm); +// assertEqual(entity1, entity2, entity1.getSource(),entity2.getSource(), DataModel.Attachment.source); +// assertEqual(entity1, entity2, entity1.getSize().toString(),entity2.getSize().toString(), DataModel.Attachment.size); +// } +// } +// +// private static void assertEqualBinaryPrefix(BinaryPrefix entity1, BinaryPrefix entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualPrefix(entity1, entity2); +// } +// } +// +// private static void assertEqualSIPrefix(SIPrefix entity1, SIPrefix entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualPrefix(entity1, entity2); +// } +// } +// +// private static void assertEqualPrefix(Prefix entity1, Prefix entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualUnit(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getFactor(),entity2.getFactor(), MeasureDataModel.Prefix.factor); +// } +// } +// +// private static void assertEqualUnit(Unit entity1, Unit entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getComment(),entity2.getComment(), MeasureDataModel.Unit.comment); +// assertEqual(entity1, entity2, entity1.getLabel(),entity2.getLabel(), MeasureDataModel.Unit.label); +// assertEqual(entity1, entity2, entity1.getLongComment(),entity2.getLongComment(), MeasureDataModel.Unit.longComment); +// assertEqual(entity1, entity2, entity1.getSymbol(),entity2.getSymbol(), MeasureDataModel.Unit.symbol); +// assertEqualStrings(entity1, entity2, entity1.getAlternativeLabels(),entity2.getAlternativeLabels(), MeasureDataModel.Unit.alternativeLabel); +// assertEqualStrings(entity1, entity2, entity1.getAlternativeSymbols(),entity2.getAlternativeSymbols(), MeasureDataModel.Unit.alternativeSymbol); +// } +// } +// +// +// private static void assertEqualCollection(Collection entity1, Collection entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getTopLevels(),entity2.getTopLevels(), DataModel.Collection.member); +// } +// } +// +// private static void assertEqualCombinatorialDerivation(CombinatorialDerivation entity1, CombinatorialDerivation entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getStrategy(),entity2.getStrategy(), DataModel.CombinatorialDerivation.strategy); +// assertEqual(entity1, entity2, entity1.getTemplate(),entity2.getTemplate(), DataModel.CombinatorialDerivation.template); +// assertEqualEntity(entity1.getVariableFeatures(), entity2.getVariableFeatures()); +// } +// } +// +// private static void assertEqualVariableComponent(VariableFeature entity1, VariableFeature entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getCardinality(),entity2.getCardinality(), DataModel.VariableComponent.cardinality); +// assertEqual(entity1, entity2, entity1.getFeature(),entity2.getFeature(), DataModel.VariableComponent.variable); +// assertEqual(entity1, entity2, entity1.getVariantCollections(),entity2.getVariantCollections(), DataModel.VariableComponent.variantCollection); +// assertEqual(entity1, entity2, entity1.getVariantDerivations(),entity2.getVariantDerivations(), DataModel.VariableComponent.variantDerivation); +// assertEqual(entity1, entity2, entity1.getVariants(),entity2.getVariants(), DataModel.VariableComponent.variant); +// } +// } +// +// private static void assertEqualComponent(Component entity1, Component entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getModels(),entity2.getModels(), DataModel.Component.model); +// assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), DataModel.role); +// assertEqual(entity1, entity2, entity1.getSequences(),entity2.getSequences(), DataModel.Component.sequence); +// assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), DataModel.type); +// assertEqualInterface(entity1.getInterface(),entity2.getInterface()); +// assertEqualEntity(entity1.getComponentReferences(), entity2.getComponentReferences()); +// assertEqualEntity(entity1.getConstraints(), entity2.getConstraints()); +// assertEqualEntity(entity1.getExternallyDefineds(), entity2.getExternallyDefineds()); +// assertEqualEntity(entity1.getInteractions(), entity2.getInteractions()); +// assertEqualEntity(entity1.getLocalSubComponents(), entity2.getLocalSubComponents()); +// assertEqualEntity(entity1.getSequenceFeatures(), entity2.getSequenceFeatures()); +// assertEqualEntity(entity1.getSubComponents(), entity2.getSubComponents()); +// } +// } +// +// private static void assertEqualInterface(Interface entity1, Interface entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getInputs(),entity2.getInputs(), DataModel.Interface.input); +// assertEqual(entity1, entity2, entity1.getNonDirectionals(),entity2.getNonDirectionals(), DataModel.Interface.nondirectional); +// assertEqual(entity1, entity2, entity1.getOutputs(),entity2.getOutputs(), DataModel.Interface.output); +// } +// } +// +// private static void assertEqualComponentReference(ComponentReference entity1, ComponentReference entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualFeature(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getRefersTo(),entity2.getRefersTo(), DataModel.ComponentReference.refersTo); +// assertEqual(entity1, entity2, entity1.getInChildOf(),entity2.getInChildOf(), DataModel.ComponentReference.inChildOf); +// } +// } +// +// private static void assertEqualConstraint(Constraint entity1, Constraint entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getObject(),entity2.getObject(), DataModel.Constraint.object); +// assertEqual(entity1, entity2, entity1.getSubject(),entity2.getSubject(), DataModel.Constraint.subject); +// assertEqual(entity1, entity2, entity1.getRestriction(),entity2.getRestriction(), DataModel.Constraint.restriction); +// } +// } +// +// private static void assertEqualExternallyDefined(ExternallyDefined entity1, ExternallyDefined entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualFeature(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getDefinition(),entity2.getDefinition(), DataModel.ExternalyDefined.definition); +// } +// } +// +// private static void assertEqualLocalSubComponent(LocalSubComponent entity1, LocalSubComponent entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualFeature(entity1, entity2); +// //TODO: assertEqualLocations(entity1, entity2, entity1.getLocations(),entity2.getLocations(), DataModel.SubComponent.location); +// assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), DataModel.type); +// } +// } +// +// private static void assertEqualFeature(Feature entity1, Feature entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// if (entity1.getOrientation()!=null) +// { +// assertEqual(entity1, entity2, entity1.getOrientation().getUri(),entity2.getOrientation().getUri(), DataModel.orientation); +// } +// assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), DataModel.role); +// } +// } +// +// private static void assertEqualSequenceFeature(SequenceFeature entity1, SequenceFeature entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualFeature(entity1, entity2); +// } +// //TODO: assertEqualLocations(entity1, entity2, entity1.getLocations(),entity2.getLocations(), DataModel.SubComponent.location); +// } +// +// private static void assertEqualSubComponent(SubComponent entity1, SubComponent entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualFeature(entity1, entity2); +// //TODO: assertEqualLocations(entity1, entity2, entity1.getLocations(),entity2.getLocations(), DataModel.SubComponent.location); +// //TODO: assertEqualLocations(entity1, entity2, entity1.getSourceLocations(),entity2.getSourceLocations(), DataModel.SubComponent.sourcelocation); +// assertEqual(entity1, entity2, entity1.getIsInstanceOf(),entity2.getIsInstanceOf(), DataModel.SubComponent.instanceOf); +// assertEqual(entity1, entity2, entity1.getRoleIntegration(),entity2.getRoleIntegration(), DataModel.SubComponent.roleIntegration); +// } +// } +// +// private static void assertEqualInteraction(Interaction entity1, Interaction entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqualEntity(entity1.getParticipations(), entity2.getParticipations()); +// assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), DataModel.type); +// } +// } +// +// private static void assertEqualParticipation(Participation entity1, Participation entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getParticipant(), entity2.getParticipant(),DataModel.Participation.participant); +// assertEqual(entity1, entity2, entity1.getRoles(),entity2.getRoles(), DataModel.role); +// } +// } +// +// private static void assertEqualExperimentalData(ExperimentalData entity1, ExperimentalData entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// } +// } +// +// private static void assertEqualExperiment(Experiment entity1, Experiment entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// } +// } +// +// private static void assertEqualImplementation(Implementation entity1, Implementation entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getComponent(), entity2.getComponent(),DataModel.Implementation.built); +// } +// } +// +// private static void assertEqualModel(Model entity1, Model entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getFramework(), entity2.getFramework(),DataModel.Model.framework); +// assertEqual(entity1, entity2, entity1.getLanguage(), entity2.getLanguage(),DataModel.Model.language); +// assertEqual(entity1, entity2, entity1.getSource(), entity2.getSource(),DataModel.Model.source); +// } +// } +// +// private static void assertEqualPrefixedUnit(PrefixedUnit entity1, PrefixedUnit entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualUnit(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getPrefix(), entity2.getPrefix(),MeasureDataModel.PrefixedUnit.prefix); +// assertEqual(entity1, entity2, entity1.getUnit(), entity2.getUnit(),MeasureDataModel.PrefixedUnit.unit); +// } +// } +// +// private static void assertEqualSingularUnit(SingularUnit entity1, SingularUnit entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualUnit(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getFactor(), entity2.getFactor(),MeasureDataModel.SingularUnit.factor); +// assertEqual(entity1, entity2, entity1.getUnit(), entity2.getUnit(),MeasureDataModel.SingularUnit.unit); +// } +// } +// private static void assertEqualSequence(Sequence entity1, Sequence entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getElements(), entity2.getElements(),DataModel.Sequence.elements); +// assertEqual(entity1, entity2, entity1.getEncoding().getUri(), entity2.getEncoding().getUri(),DataModel.Sequence.encoding); +// } +// } +// +// private static void assertEqualUnitDivision(UnitDivision entity1, UnitDivision entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualUnit(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getDenominator(), entity2.getDenominator(),MeasureDataModel.UnitDivision.denominator); +// assertEqual(entity1, entity2, entity1.getNumerator(), entity2.getNumerator(),MeasureDataModel.UnitDivision.numerator); +// } +// } +// +// private static void assertEqualUnitExponentiation (UnitExponentiation entity1, UnitExponentiation entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualUnit(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getBase(), entity2.getBase(),MeasureDataModel.UnitExponentiation.base); +// assertEqual(entity1, entity2, entity1.getExponent(), entity2.getExponent(),MeasureDataModel.UnitExponentiation.base); +// } +// } +// +// private static void assertEqualUnitMultiplication(UnitMultiplication entity1, UnitMultiplication entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqualUnit(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getTerm1(), entity2.getTerm1(),MeasureDataModel.UnitMultiplication.term1); +// assertEqual(entity1, entity2, entity1.getTerm2(), entity2.getTerm2(),MeasureDataModel.UnitMultiplication.term2); +// } +// } +// +// private static void assertEqualPlan(Plan entity1, Plan entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// } +// } +// +// private static void assertEqualMeasure(Measure entity1, Measure entity2) throws SBOLGraphException +// { +// if (entity1!=null) +// { +// assertEqual(entity1, entity2); +// assertEqual(entity1, entity2, entity1.getUnit(),entity2.getUnit(), MeasureDataModel.Measure.unit); +// assertEqual(entity1, entity2, entity1.getValue(),entity2.getValue(), MeasureDataModel.Measure.value); +// assertEqual(entity1, entity2, entity1.getTypes(),entity2.getTypes(), MeasureDataModel.Measure.type); +// } +// } +// +// private static void assertEqual(TopLevel topLevel1, TopLevel topLevel2) throws SBOLGraphException +// { +// assertEqual((Identified)topLevel1, (Identified)topLevel2); +// assertEqual(topLevel1,topLevel2, topLevel1.getNamespace(), topLevel2.getNamespace(), DataModel.TopLevel.namespace); +// assertEqual(topLevel1, topLevel2, topLevel1.getAttachments(),topLevel2.getAttachments(), DataModel.TopLevel.attachment); +// } +// +// private static void assertEqual(Identified identified1, Identified identified2) throws SBOLGraphException +// { +// assertEqual(identified1, identified2, identified1.getName(),identified2.getName(), DataModel.Identified.name); +// assertEqual(identified1, identified2, identified1.getDescription(),identified2.getDescription(), DataModel.Identified.description); +// assertEqual(identified1, identified2, identified1.getDisplayId(),identified2.getDisplayId(), DataModel.Identified.displayId); +// assertEqual(identified1, identified2, identified1.getUri(),identified2.getUri(), DataModel.Identified.uri); +// assertEqual(identified1, identified2, identified1.getWasDerivedFrom(),identified2.getWasDerivedFrom(), DataModel.Identified.wasDerivedFrom); +// assertEqual(identified1, identified2, identified1.getWasGeneratedBy(),identified2.getWasGeneratedBy(), DataModel.Identified.wasGeneratedBy); +// assertEqualEntity(identified1.getMeasures(), identified2.getMeasures()); +// } +// +// private static void assertEqual(Identified identified1, Identified identified2, String value1, String value2, URI property) +// { +// String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), value1, value2); +// assertEquals(message, value1, value2); +// } +// +// private static void assertEqual(Identified identified1, Identified identified2, URI value1, URI value2, URI property) +// { +// String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), value1, value2); +// assertEquals(message, value1, value2); +// } +// +// private static void assertEqual(Identified identified1, Identified identified2, float value1, float value2, URI property) +// { +// String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), String.valueOf(value1), String.valueOf(value2)); +// assertEquals(message, String.valueOf(value1), String.valueOf(value2)); +// } +// +// private static void assertEqual(Identified identified1, Identified identified2, XSDDateTime value1, XSDDateTime value2, URI property) +// { +// String message=String.format("Could not read the %s property. Entity:%s, Value1:%s, Value2:%s", property.toString(), identified1.getUri().toString(), value1, value2); +// assertEquals(message, String.valueOf(value1), String.valueOf(value2)); +// } +// +// private static void assertEqual(Identified identified1, Identified identified2, List value1, List value2, URI property) +// { +// if (value1!=null && value2!=null) +// { +// String message=String.format("Could not read the %s property. Entity: %s", property.toString(), identified1.getUri().toString()); +// Collections.sort(value1); +// Collections.sort(value2); +// +// assertEquals(message, value1, value2); +// } +// } +// +// private static void assertEqualStrings(Identified identified1, Identified identified2, List value1, List value2, URI property) +// { +// if (value1!=null && value2!=null) +// { +// String message=String.format("Could not read the %s property. Entity: %s", property.toString(), identified1.getUri().toString()); +// Collections.sort(value1); +// Collections.sort(value2); +// +// assertEquals(message, value1, value2); +// } +// } public static void assertDNARootComponents(SBOLDocument doc, int rootCount) throws SBOLGraphException { Set roots = SBOLAPI.getRootComponents(doc, ComponentType.DNA); @@ -720,4 +727,82 @@ public static void assertDNARootComponents(SBOLDocument doc, int rootCount) thro System.out.println("Root:" + comp.getUri()); } } + + private static void printMessages(List messages, String type) + { + for (String message: messages){ + System.out.println(type + " Validation test: " + message); + } + if (messages!=null && messages.size()>0) + System.out.println("--------------------"); + } + + public static void validateIdentified(Identified identified, SBOLDocument doc, int numberOfExpectedErrors) throws SBOLGraphException + { + validateIdentified(identified, numberOfExpectedErrors); + validateDocument(doc, numberOfExpectedErrors); + } + + public static void validateIdentified(Identified identified, SBOLDocument doc, int numberOfExpectedErrorsInIdentified, int numberOfExpectedErrorsInDocument) throws SBOLGraphException + { + validateIdentified(identified, numberOfExpectedErrorsInIdentified); + validateDocument(doc, numberOfExpectedErrorsInDocument); + } + + public static void validateIdentified(Identified identified,int numberOfExpectedErrors) throws SBOLGraphException + { + PropertyValidationType validationType=Configuration.getConfiguration().getPropertyValidationType(); + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + List messages=IdentityValidator.getValidator().validate(identified); + printMessages(messages, "Identified"); + assertEquals(numberOfExpectedErrors, messages.size()); + Configuration.getConfiguration().setPropertyValidationType(validationType); + } + + public static void validateDocument(SBOLDocument document ,int numberOfExpectedErrors) throws SBOLGraphException + { + PropertyValidationType validationType=Configuration.getConfiguration().getPropertyValidationType(); + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + + List messages=SBOLValidator.getValidator().validate(document); + printMessages(messages, "Document"); + assertEquals(numberOfExpectedErrors, messages.size()); + Configuration.getConfiguration().setPropertyValidationType(validationType); + + } + + public static void validateProperty(Identified identified, String methodName, Object[] parameterValues, Class... parameterTypes) throws SBOLGraphException, Exception + { + PropertyValidationType validationType=Configuration.getConfiguration().getPropertyValidationType(); + boolean validEx=false; + Method method; + try { + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateAfterSettingProperties); + method = identified.getClass().getMethod(methodName, parameterTypes); + method.invoke(identified, parameterValues); + } + catch (NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + throw new Exception(e.getMessage(),e); + } + catch (Exception ex) + { + if (ex.getCause() instanceof SBOLGraphException) + { + System.out.println("Property Validation:" + ex.getCause().getMessage()); + System.out.println("--------------------"); + validEx=true; + } + else + { + throw ex; + } + } + finally + { + String message=String.format("Property validation fails. Entity: %s, property: %s, values:", identified.getUri(), methodName, StringUtils.join(parameterValues,",")); + assertTrue(message,validEx); + Configuration.getConfiguration().setPropertyValidationType(validationType); + } + } } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/GettingStartedTutorial_Short.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/GettingStartedTutorial_Short.java index 0b810fb..9e40d50 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/GettingStartedTutorial_Short.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/GettingStartedTutorial_Short.java @@ -129,8 +129,8 @@ public void runExample() throws SBOLGraphException, IOException System.out.println(output); TestUtil.serialise(doc, "combine2020", "combine2020"); System.out.println("--------------------------"); - SBOLDocument doc2=SBOLIO.read(new File("input/gfp.nt"),SBOLFormat.NTRIPLES); - //SBOLDocument doc2=SBOLIO.read(new File("output/combine2020/combine2020.nt"),"N-TRIPLES"); + //SBOLDocument doc2=SBOLIO.read(new File("input/gfp.nt"),SBOLFormat.NTRIPLES); + SBOLDocument doc2=SBOLIO.read(new File("output/combine2020/combine2020.nt"),SBOLFormat.NTRIPLES); //SBOLDocument doc2=SBOLIO.read(new File("output/combine2020/combine2020.rdf"),"RDF/XML-ABBREV"); diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/PoPSReceiverExample.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/PoPSReceiverExample.java index fa77b12..609750e 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/PoPSReceiverExample.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/usecase/test/PoPSReceiverExample.java @@ -14,6 +14,7 @@ import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.validation.SBOLComparator; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.DataModel; import org.sbolstandard.core3.vocabulary.Encoding; @@ -82,7 +83,7 @@ public void testApp() throws SBOLGraphException, IOException assertTrue("Could not filter document sequences by encoding type", naSequences!=null && naSequences.size()==8); Component comp=doc2.getIdentified(pTetR.getUri(), Component.class); - TestUtil.assertEqualEntity(pTetR, comp); + SBOLComparator.assertEqualEntity(pTetR, comp); diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/InvalidDisplayIdTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/InvalidDisplayIdTest.java index 66676bc..1d7fcee 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/InvalidDisplayIdTest.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/InvalidDisplayIdTest.java @@ -12,6 +12,8 @@ import org.sbolstandard.core3.io.SBOLFormat; import org.sbolstandard.core3.io.SBOLIO; import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.vocabulary.ComponentType; import org.sbolstandard.core3.vocabulary.Role; @@ -24,25 +26,22 @@ public void testCreateInvalidDisplayId() throws SBOLGraphException, IOException { String baseUri="https://sbolstandard.org/examples/"; SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); - - + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.NoValidation); + Component TetR_protein=SBOLAPI.createComponent(doc, "TetR_protein", ComponentType.Protein.getUrl(), "TetR", "TetR protein", Role.TF); TetR_protein.setDisplayId("1TetR"); //Component LacI_protein=SBOLAPI.createComponent(doc, "LacI_protein", ComponentType.Protein.getUrl(), "LacI", "LacI protein", Role.TF); TetR_protein.setNamespace(URI.create("https://sbolstandard.org/examples/")); - Component rbs=doc.createComponent(URI.create("https://sbolstandard.org/examples"),URI.create("https://sbolstandard.org/examples/rbs"), Arrays.asList(ComponentType.DNA.getUrl())); rbs.setName("B0034"); rbs.setDisplayId("B0034 rbs"); rbs.setDescription("RBS (Elowitz 1999)"); rbs.setRoles(Arrays.asList(Role.RBS)); - - TestUtil.serialise(doc, "invalid/displayid", "displayid"); + TestUtil.serialise(doc, "invalid/displayid", "displayid"); - System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); - + System.out.println(SBOLIO.write(doc, SBOLFormat.TURTLE)); } } diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/Validate.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/Validate.java index 17e031f..203a12f 100644 --- a/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/Validate.java +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/Validate.java @@ -3,13 +3,14 @@ import static org.junit.Assert.*; import java.io.IOException; import org.junit.Test; +import org.sbolstandard.core3.util.SBOLGraphException; import org.sbolstandard.core3.validation.SBOLValidator; public class Validate { @Test - public void validate() throws IOException { - String message=SBOLValidator.validateFolder("output","ttl"); + public void validate() throws IOException, SBOLGraphException { + String message=SBOLValidator.validateFolder("output","ttl","invalid"); if (message!=null) { diff --git a/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/ValidationReadWriteTest.java b/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/ValidationReadWriteTest.java new file mode 100644 index 0000000..9801c49 --- /dev/null +++ b/libSBOLj3/src/test/java/org/sbolstandard/core3/validation/test/ValidationReadWriteTest.java @@ -0,0 +1,209 @@ +package org.sbolstandard.core3.validation.test; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.OptionalInt; +import org.sbolstandard.core3.api.SBOLAPI; +import org.sbolstandard.core3.entity.Component; +import org.sbolstandard.core3.entity.ExternallyDefined; +import org.sbolstandard.core3.entity.SBOLDocument; +import org.sbolstandard.core3.entity.measure.Measure; +import org.sbolstandard.core3.entity.measure.PrefixedUnit; +import org.sbolstandard.core3.entity.measure.SIPrefix; +import org.sbolstandard.core3.entity.measure.SingularUnit; +import org.sbolstandard.core3.entity.measure.UnitDivision; +import org.sbolstandard.core3.entity.measure.UnitExponentiation; +import org.sbolstandard.core3.entity.measure.UnitMultiplication; +import org.sbolstandard.core3.io.SBOLFormat; +import org.sbolstandard.core3.io.SBOLIO; +import org.sbolstandard.core3.test.TestUtil; +import org.sbolstandard.core3.util.Configuration; +import org.sbolstandard.core3.util.Configuration.PropertyValidationType; +import org.sbolstandard.core3.util.SBOLGraphException; +import org.sbolstandard.core3.util.URINameSpace; +import org.sbolstandard.core3.validation.SBOLValidator; +import org.sbolstandard.core3.vocabulary.ComponentType; + +import junit.framework.TestCase; + +public class ValidationReadWriteTest extends TestCase { + + public void test() throws SBOLGraphException, IOException + { + String baseUri="https://sbolstandard.org/examples/"; + SBOLDocument doc=new SBOLDocument(URI.create(baseUri)); + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.ValidateBeforeSavingSBOLDocuments); + Component media=SBOLAPI.createComponent(doc, "M9_Glucose_CAA", ComponentType.FunctionalEntity.getUrl(), "M9 Glucose CAA", "M9 Glucose CAA growth media", null); + ExternallyDefined CaCl2=media.createExternallyDefined(Arrays.asList(ComponentType.SimpleChemical.getUrl()), URINameSpace.CHEBI.local("3312")); + + + SingularUnit liter=doc.createSingularUnit("litre", "l", "liter"); + liter.setAlternativeLabels(Arrays.asList("liter","litre2")); + liter.setComment("The litre is a unit of volume defined as 1.0e-3 cubic metre."); + liter.setAlternativeSymbols(Arrays.asList("L", "L2")); + liter.setLongComment("This is an example long comment."); + liter.setFactor(Optional.of(0.001f)); + + SingularUnit mole=doc.createSingularUnit("mole", "mol", "mole"); + + SIPrefix milli=doc.createSIPrefix("milli", "m", "milli", 0.001f); + milli.setAlternativeLabels(Arrays.asList("milli1","milli2")); + milli.setComment("Comment for the milli prefix."); + milli.setAlternativeSymbols(Arrays.asList("m1", "m2")); + milli.setLongComment("This is an example long comment for the milli prefix."); + + PrefixedUnit millimole=doc.createPrexiedUnit("millimole", "mmol", "millimole", mole.getUri(),milli.getUri()); + + UnitDivision milliMolePerLiter=doc.createUnitDivision("millimolePerLitre", "mmol/l", "millimolar", millimole.getUri(), liter.getUri()); + + //URI milliMolePerLiter=URINameSpace.OM.local("millimolePerLitre"); + Measure measure=CaCl2.createMeasure(SBOLAPI.append(CaCl2.getUri(), "measure1"), 0.1f, milliMolePerLiter.getUri()); + measure.setTypes(Arrays.asList(URINameSpace.SBO.local("0000196"),URINameSpace.SBO.local("0000197"))); + + SingularUnit kelvin=doc.createSingularUnit("kelvin", "kelvin", "kelvin"); + UnitMultiplication um= doc.createUnitMultiplication("kelvinMole", "K mol", "kelvinMole", kelvin.getUri(), mole.getUri()); + + SingularUnit meter=doc.createSingularUnit("meter", "m", "meter"); + UnitExponentiation m3=doc.createUnitExponentiation("cubicMeter", "m3", "cubicMeter", meter.getUri(), 3); + + TestUtil.serialise(doc, "measurement_entity/measurement", "measurement"); + SBOLDocument doc2=SBOLIO.read(new File("output/measurement_entity/measurement/measurement.ttl"), SBOLFormat.TURTLE); + + System.out.println(SBOLIO.write(doc2, SBOLFormat.TURTLE)); + List units=doc2.getSingularUnits(); + if (units!=null) + { + for (SingularUnit unit:units) + { + System.out.print("Name:" + unit.getName() + " "); + System.out.println("Factor:" + unit.getFactor()); + } + } + + List prefixedUnits=doc2.getPrefixedUnits(); + if (prefixedUnits!=null) + { + for (PrefixedUnit unit:prefixedUnits) + { + System.out.print("Name:" + unit.getName() + " "); + System.out.println("Prefix:" + unit.getPrefix()); + + } + } + + Optional temp=measure.getValue(); + measure.setValue(Optional.of(4f)); + TestUtil.validateIdentified(measure,doc, 0); + + measure.setValue(Optional.empty()); + TestUtil.validateIdentified(measure, doc, 1); + + TestUtil.validateIdentified(CaCl2, 1); + measure.setValue(temp); + TestUtil.validateIdentified(CaCl2, 0); + + millimole.setPrefix(null); + millimole.setUnit(null); + millimole.setSymbol(null); + millimole.setLabel(null); + TestUtil.validateIdentified(millimole,doc, 4); + TestUtil.validateDocument(doc, 4); + + + milli.setFactor(Optional.empty()); + TestUtil.validateIdentified(milli,1); + TestUtil.validateDocument(doc,5); + + milliMolePerLiter.setDenominator(null); + milliMolePerLiter.setNumerator(null); + TestUtil.validateIdentified(milliMolePerLiter,doc,2,7); + + m3.setExponent(Optional.empty()); + m3.setBase(null); + TestUtil.validateIdentified(m3,doc,2,9); + + um.setTerm1(null); + um.setTerm2(null); + TestUtil.validateIdentified(um,doc,2,11); + + + //Validating the invalid SBOL document will throw exceptions + boolean exception=false; + try + { + boolean isValid=SBOLValidator.getValidator().isValid(doc); + } + catch (SBOLGraphException e) + { + exception=true; + System.out.print("Validaton exception message:" + e.getMessage()); + } + assertTrue(exception); + + + String output=null; + + //Writing the invalid SBOL document will fail + exception=false; + try + { + output=SBOLIO.write(doc, SBOLFormat.TURTLE); + } + catch (SBOLGraphException e) + { + exception=true; + } + assertTrue(exception); + + + //Write the invalid SBOL document + Configuration.getConfiguration().setPropertyValidationType(PropertyValidationType.NoValidation); + exception=false; + try + { + output=SBOLIO.write(doc, SBOLFormat.TURTLE); + } + catch (SBOLGraphException e) + { + exception=true; + } + assertTrue(!exception); + + + //Reading the invalid SBOL document will fail + SBOLDocument doc3=null; + exception=false; + try + { + doc3=SBOLIO.read(output, SBOLFormat.TURTLE); + } + catch (SBOLGraphException e) + { + exception=true; + } + assertTrue(exception); + + + //Read the invalid SBOL document with errors and validate programmatically + Configuration.getConfiguration().setValidateAfterReadingSBOLDocuments(false); + exception=false; + try + { + doc3=SBOLIO.read(output, SBOLFormat.TURTLE); + } + catch (SBOLGraphException e) + { + exception=true; + } + assertTrue(!exception); + + TestUtil.validateDocument(doc3,11); + + } +} + +// om:hasFactor "0.001"^^ ; \ No newline at end of file