use of org.sbolstandard.core2.SBOLValidationException in project libSBOLj by SynBioDex.
the class Implementation method copy.
/**
* @throws SBOLValidationException
* if an SBOL validation rule violation occurred in any of the
* following constructors or methods:
* <ul>
* <li>{@link #deepCopy()},</li>
* <li>{@link URIcompliance#createCompliantURI(String, String, String)},</li>
* <li>{@link #setDisplayId(String)},</li>
* <li>{@link #setVersion(String)},</li>
* <li>{@link #setWasDerivedFrom(URI)},</li>
* <li>{@link #setIdentity(URI)}</li>
* </ul>
*/
@Override
Implementation copy(String URIprefix, String displayId, String version) throws SBOLValidationException {
Implementation cloned = this.deepCopy();
cloned.setPersistentIdentity(createCompliantURI(URIprefix, displayId, ""));
cloned.setDisplayId(displayId);
cloned.setVersion(version);
URI newIdentity = createCompliantURI(URIprefix, displayId, version);
if (!this.getIdentity().equals(newIdentity)) {
cloned.addWasDerivedFrom(this.getIdentity());
} else {
cloned.setWasDerivedFroms(this.getWasDerivedFroms());
}
cloned.setIdentity(newIdentity);
return cloned;
}
use of org.sbolstandard.core2.SBOLValidationException in project libSBOLj by SynBioDex.
the class SBOLDocumentTest method test_createTLmethods.
@Test
public void test_createTLmethods() throws SBOLValidationException {
ComponentDefinition gRNA_b_gene = doc.createComponentDefinition("http://partsregistry.org", "gRNA_b_gene", "", ComponentDefinition.DNA);
assertNotNull(gRNA_b_gene);
assertTrue(doc.getComponentDefinition("gRNA_b_gene", "").equals(gRNA_b_gene));
}
use of org.sbolstandard.core2.SBOLValidationException in project libSBOLj by SynBioDex.
the class SBOLDocumentTest method test_createCopy.
@Test
public void test_createCopy() throws SBOLValidationException, IOException, SBOLConversionException {
SBOLDocument repression_doc = new SBOLDocument();
repression_doc.setDefaultURIprefix(prURI);
repression_doc.setTypesInURIs(false);
// repression_doc.setComplete(true);
SBOLDocument copied_doc = new SBOLDocument();
copied_doc.setDefaultURIprefix(prURI);
copied_doc.setTypesInURIs(false);
// copied_doc.setComplete(true);
// /core2/src/test/java/org/sbolstandard/core2/Testing/RepressionModel.xml"
InputStream docAsStream = SequenceConstraintTest.class.getResourceAsStream("/SBOLTestSuite/SBOL2/RepressionModel.xml");
repression_doc.read(docAsStream);
// repression_doc.read("C:/Users/meher/Documents/workspace/libSBOLj/core2/src/test/resources/SBOL2/RepressionModel.xml");
copied_doc.createCopy(repression_doc);
assertTrue(repression_doc.equals(copied_doc));
}
use of org.sbolstandard.core2.SBOLValidationException in project libSBOLj by SynBioDex.
the class SBOLDocumentTest method test_docModelMethods.
@Test
public void test_docModelMethods() throws SBOLValidationException {
Model model = doc.createModel("pIKE_Toggle_1", "1.0", URI.create("http://virtualparts.org/part/pIKE_Toggle_1"), URI.create("http://identifiers.org/edam/format_2585"), SystemsBiologyOntology.CONTINUOUS_FRAMEWORK);
assertTrue(doc.getModels().size() == 1);
assertTrue(doc.getModel("pIKE_Toggle_1", "").equals(model));
doc.clearModels();
assertTrue(doc.getModels().size() == 0);
}
use of org.sbolstandard.core2.SBOLValidationException in project libSBOLj by SynBioDex.
the class AnnotationTest method test_toString.
@Test
public void test_toString() throws SBOLValidationException {
Annotation CD_annot = gRNA_b_gene.createAnnotation(new QName(prURI, "protein", "pr"), true);
// System.out.println(CD_annot.toString());
assertTrue(CD_annot.toString().contains("value=" + true));
}
Aggregations