Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates from SynBioDex.libSBOLj3 #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ SBOL represents data using RDF graphs, which can be serialised in different form
* Turtle (File extension: ttl)
* N-Triples (File extension: nt)
* JSON-LD (File extension: jsonld)
* RDF/JSON (File extension: rj)

## How to use libSBOLj3

Expand All @@ -18,7 +17,7 @@ Use this option if you are developing a Java application using [Maven](https://m
<dependency>
<groupId>org.sbolstandard</groupId>
<artifactId>libSBOLj3</artifactId>
<version>1.4-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
</dependency>
...
</dependencies>
Expand All @@ -36,13 +35,13 @@ Use this option if you are developing a Java application using [Maven](https://m
```

### As a Java dependency in a non-Maven project
The libSBOLj3 library is available as a JAR file. Please download the file from the [releases page](https://github.com/goksel/libSBOLj3/tags). A single JAR file (with the "withDepencencies" suffix), which includes all the required libSBOLj3 related dependencies, is also available.
The libSBOLj3 library is available as a JAR file. Please download the file from the [releases page](https://github.com/SynBioDex/libSBOLj3/tags). A single JAR file (with the "withDepencencies" suffix), which includes all the required libSBOLj3 related dependencies, is also available.

## SBOL Examples
[Several SBOL3 examples](https://github.com/goksel/libSBOLj3/tree/master/libSBOLj3/output) are available as part of the libSBOLj3 library. These examples have also been made available as part of the [SBOL Test Suite](https://github.com/SynBioDex/SBOLTestSuite/tree/master/SBOL3). Some of these examples have beeen explained in the recent SBOL3 paper, titled "[The Synthetic Biology Open Language (SBOL) Version 3: Simplified Data Exchange for Bioengineering](https://doi.org/10.3389/fbioe.2020.01009)".
[Several SBOL3 examples](https://github.com/SynBioDex/libSBOLj3/tree/master/libSBOLj3/output) are available as part of the libSBOLj3 library. These examples have also been made available as part of the [SBOL Test Suite](https://github.com/SynBioDex/SBOLTestSuite/tree/master/SBOL3). Some of these examples have beeen explained in the recent SBOL3 paper, titled "[The Synthetic Biology Open Language (SBOL) Version 3: Simplified Data Exchange for Bioengineering](https://doi.org/10.3389/fbioe.2020.01009)".

## Getting Started
Please see the [tutorial code](https://github.com/goksel/libSBOLj3/tree/feature/combine2020/libSBOLj3/output/combine2020) and the [COMBINE 2020 slides](https://github.com/SynBioDex/Community-Media/blob/master/2020/COMBINE20/pySBOL3-COMBINE-2020.pptx) for more details. The tutorial code includes additional examples to crete interactions, constraints, component references and so on.
Please see the [tutorial code](https://github.com/SynBioDex/libSBOLj3/tree/feature/combine2020/libSBOLj3/output/combine2020) and the [COMBINE 2020 slides](https://github.com/SynBioDex/Community-Media/blob/master/2020/COMBINE20/pySBOL3-COMBINE-2020.pptx) for more details. The tutorial code includes additional examples to crete interactions, constraints, component references and so on.

### Creating a new SBOL document
The SBOLDocument class is used to create SBOL documents which act as containers to create and access other SBOL entities. Although not required, the base URI can be used as prefix for all new SBOL entities.
Expand Down
29 changes: 27 additions & 2 deletions libSBOLj3/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<artifactId>libSBOLj3</artifactId>
<name>libSBOLj3</name>
<version>1.0.0-SNAPSHOT</version>
<url>https://github.com/goksel/libSBOLj3</url>
<url>https://github.com/SynBioDex/libSBOLj3</url>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/goksel/libSBOLj3/issues</url>
<url>https://github.com/SynBioDex/libSBOLj3/issues</url>
</issueManagement>
<build>
<plugins>
Expand Down Expand Up @@ -54,6 +54,31 @@
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"@id": "urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72",
"@id": "urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd",
"sbol:name": "TetR",
"sbol:hasNamespace": {
"@id": "urn:uuid:0bc0a0f6-fd79-4222-bcb6-db149c0396fe"
"@id": "urn:uuid:bbc5139e-9b65-418d-b5bf-25da4e066063"
},
"sbol:type": {
"@id": "SBO:0000252"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[ {
"@id" : "urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72",
"@id" : "urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd",
"http://sbols.org/v3#name" : [ {
"@value" : "TetR"
} ],
"http://sbols.org/v3#hasNamespace" : [ {
"@id" : "urn:uuid:0bc0a0f6-fd79-4222-bcb6-db149c0396fe"
"@id" : "urn:uuid:bbc5139e-9b65-418d-b5bf-25da4e066063"
} ],
"http://sbols.org/v3#type" : [ {
"@id" : "https://identifiers.org/SBO:0000252"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://sbols.org/v3#name> "TetR" .
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://sbols.org/v3#hasNamespace> <urn:uuid:0bc0a0f6-fd79-4222-bcb6-db149c0396fe> .
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://sbols.org/v3#type> <https://identifiers.org/SBO:0000252> .
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://sbols.org/v3#Component> .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://sbols.org/v3#name> "TetR" .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://sbols.org/v3#hasNamespace> <urn:uuid:bbc5139e-9b65-418d-b5bf-25da4e066063> .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://sbols.org/v3#type> <https://identifiers.org/SBO:0000252> .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://sbols.org/v3#Component> .
Original file line number Diff line number Diff line change
Expand Up @@ -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/">
<sbol:Component rdf:about="urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72">
<sbol:Component rdf:about="urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd">
<sbol:name>TetR</sbol:name>
<sbol:hasNamespace rdf:resource="urn:uuid:0bc0a0f6-fd79-4222-bcb6-db149c0396fe"/>
<sbol:hasNamespace rdf:resource="urn:uuid:bbc5139e-9b65-418d-b5bf-25da4e066063"/>
<sbol:type rdf:resource="https://identifiers.org/SBO:0000252"/>
</sbol:Component>
</rdf:RDF>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72" : {
"urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd" : {
"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" : "urn:uuid:0bc0a0f6-fd79-4222-bcb6-db149c0396fe"
"value" : "urn:uuid:bbc5139e-9b65-418d-b5bf-25da4e066063"
}
] ,
"http://sbols.org/v3#name" : [ {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix sbol: <http://sbols.org/v3#> .

<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72>
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd>
a sbol:Component ;
sbol:hasNamespace <urn:uuid:0bc0a0f6-fd79-4222-bcb6-db149c0396fe> ;
sbol:hasNamespace <urn:uuid:bbc5139e-9b65-418d-b5bf-25da4e066063> ;
sbol:name "TetR" ;
sbol:type SBO:0000252 .
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://sbols.org/v3#hasNamespace> <urn:uuid:0bc0a0f6-fd79-4222-bcb6-db149c0396fe> .
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://sbols.org/v3#name> "TetR" .
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://sbols.org/v3#type> <https://identifiers.org/SBO:0000252> .
<urn:uuid:2d9074d9-4a5b-48f7-a007-04e6decdad72> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://sbols.org/v3#Component> .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://sbols.org/v3#hasNamespace> <urn:uuid:bbc5139e-9b65-418d-b5bf-25da4e066063> .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://sbols.org/v3#name> "TetR" .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://sbols.org/v3#type> <https://identifiers.org/SBO:0000252> .
<urn:uuid:fb46f02f-d1c5-4529-a971-64b63b938cdd> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://sbols.org/v3#Component> .
81 changes: 52 additions & 29 deletions libSBOLj3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>libSBOLj3</name>
<url>https://github.com/goksel/libSBOLj3</url>
<url>https://github.com/SynBioDex/libSBOLj3</url>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/goksel/libSBOLj3/issues</url>
<url>https://github.com/SynBioDex/libSBOLj3/issues</url>
</issueManagement>
<dependencies>
<dependency>
Expand Down Expand Up @@ -63,16 +63,12 @@
<artifactId>hibernate-validator</artifactId>
<version>8.0.0.Final</version>
</dependency>
<!-- <dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<version>4.0.1</version>
</dependency>
-->
<!-- <dependency> <groupId>org.glassfish</groupId> <artifactId>jakarta.el</artifactId>
<version>4.0.1</version> </dependency> -->
<dependency>
<groupId>org.glassfish.expressly</groupId>
<artifactId>expressly</artifactId>
<version>5.0.0</version>
<groupId>org.glassfish.expressly</groupId>
<artifactId>expressly</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
Expand All @@ -99,24 +95,11 @@
</execution>
</executions>
</plugin>
<!-- <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>-->
<!-- <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>3.4.2</version>
<configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id>
<phase>package</phase> <goals> <goal>single</goal> </goals> </execution>
</executions> </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down Expand Up @@ -148,7 +131,47 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>-->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
46 changes: 5 additions & 41 deletions libSBOLj3/src/main/java/org/sbolstandard/core3/api/SBOLAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
import org.sbolstandard.core3.vocabulary.Orientation;
import org.sbolstandard.core3.vocabulary.RestrictionType;

/**
*
* @author gokselmisirli
*
*/
public class SBOLAPI {

public static List<Interaction> createInteraction(List<URI> interactionTypes, Component parent, Component participant1, List<URI> participant1Roles, Component participant2, List<URI> participant2Roles) throws SBOLGraphException
Expand All @@ -45,47 +50,6 @@ public static List<Interaction> createInteraction(List<URI> interactionTypes, Co
return interactions;
}

/*public static List<Interaction> createInteraction(List<URI> interactionTypes, Component parent, SubComponent participantContainer, Component participant1, List<URI> participant1Roles, Component participant2, List<URI> participant2Roles) throws SBOLGraphException
{
List<Interaction> interactions=new ArrayList<Interaction>();
List<ComponentReference> features1=createComponentReference(parent, participantContainer, child)
createSubComponents(parent, participant1);
List<SubComponent> features2=createSubComponents(parent, participant2);
if (features1!=null && features2!=null)
{
for (Feature feature1: features1)
{
for (Feature feature2: features2)
{
Interaction interaction=createInteraction(interactionTypes, parent, feature1, participant1Roles, feature2, participant2Roles);
interactions.add(interaction);
}
}
}
return interactions;
}
*/

/* public static List<Interaction> createNonCovalentBindingInteraction(Component container, List<Component> reactants, List<Component> products)
{
List<SubComponent> reactantSubComponents=new ArrayList<SubComponent>();
if (reactants!=null)
{
for (Component component:reactants)
{

}
}
String localName=createLocalName(DataModel.Interaction.uri, container.getInteractions());
Interaction interaction= container.createInteraction(append(container.getUri(), localName), Arrays.asList(InteractionType.NonCovalentBinding));

createParticipation(interaction, participant1Roles, participant1);
createParticipation(interaction, participant2Roles, participant2);
return interaction;

}*/


private static List<SubComponent> createSubComponents (Component parent, Component child) throws SBOLGraphException
{
List<SubComponent> subComponents=getSubComponents(parent, child);
Expand Down