Skip to content

Commit

Permalink
New framework release
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Nov 28, 2021
1 parent d08b904 commit 656a92f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ REPORTS := ${shell cat pathways.txt | sed -e 's/\(.*\)/reports\/\1.md/' }
SBMLS := ${shell cat pathways.txt | sed -e 's/\(.*\)/sbml\/\1.sbml/' } ${shell cat pathways.txt | sed -e 's/\(.*\)/sbml\/\1.txt/' }
SVGS := ${shell cat pathways.txt | sed -e 's/\(.*\)/sbml\/\1.svg/' }

FRAMEWORKVERSION=release-1
FRAMEWORKVERSION=release-2

WEBSITE := ${shell cat website.txt }

all: wikipathways-rdf-wp.zip wikipathways-rdf-gpml.zip

install:
@wget -O libs/GPML2RDF-3.0.0-SNAPSHOT-jar-with-dependencies.jar https://github.com/wikipathways/wikipathways-curation-template/releases/download/${FRAMEWORKVERSION}/GPML2RDF-3.0.0-SNAPSHOT-jar-with-dependencies.jar
@wget -O libs/jena-arq-3.17.0.jar https://github.com/wikipathways/wikipathways-curation-template/releases/download/${FRAMEWORKVERSION}/jena-arq-3.17.0.jar
@wget -O libs/GPML2RDF-3.0.0-SNAPSHOT.jar https://github.com/wikipathways/wikipathways-curation-template/releases/download/${FRAMEWORKVERSION}/GPML2RDF-3.0.0-SNAPSHOT.jar
@wget -O libs/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar https://github.com/wikipathways/wikipathways-curation-template/releases/download/${FRAMEWORKVERSION}/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar
@wget -O libs/slf4j-simple-1.7.32.jar https://search.maven.org/remotecontent?filepath=org/slf4j/slf4j-simple/1.7.32/slf4j-simple-1.7.32.jar
@wget -O libs/jena-arq-4.2.0.jar.jar https://repo1.maven.org/maven2/org/apache/jena/jena-arq/4.2.0/jena-arq-4.2.0.jar

sbml: ${SBMLS}

Expand Down Expand Up @@ -56,19 +56,19 @@ sbml/%.svg: sbml/%.sbml

wp/Human/%.ttl: gpml/%.gpml src/java/main/org/wikipathways/covid/CreateRDF.class
@mkdir -p wp/Human
@cat "$<.rev" | xargs java -cp src/java/main/.:libs/GPML2RDF-3.0.0-SNAPSHOT-jar-with-dependencies.jar:libs/derby-10.14.2.0.jar:libs/slf4j-simple-1.7.32.jar org.wikipathways.covid.CreateRDF $< | grep -v ".bridge" | grep -v "^WARNING" | grep -v "^TODO" | grep -v "^Unknown and unsupported" | grep -v "regulating line is reversible" > $@
@cat "$<.rev" | xargs java -cp src/java/main/.:libs/GPML2RDF-3.0.0-SNAPSHOT.jar:libs/derby-10.14.2.0.jar:libs/slf4j-simple-1.7.32.jar org.wikipathways.covid.CreateRDF $< $@

wp/gpml/Human/%.ttl: gpml/%.gpml src/java/main/org/wikipathways/covid/CreateGPMLRDF.class
@mkdir -p wp/gpml/Human
@cat "$<.rev" | xargs java -cp src/java/main/.:libs/GPML2RDF-3.0.0-SNAPSHOT-jar-with-dependencies.jar:libs/derby-10.14.2.0.jar:libs/slf4j-simple-1.7.32.jar org.wikipathways.covid.CreateGPMLRDF $< | grep -v ".bridge" | grep -v "^WARNING" | grep -v "^TODO" > $@
@cat "$<.rev" | xargs java -cp src/java/main/.:libs/GPML2RDF-3.0.0-SNAPSHOT.jar:libs/derby-10.14.2.0.jar:libs/slf4j-simple-1.7.32.jar org.wikipathways.covid.CreateGPMLRDF $< $@

src/java/main/org/wikipathways/covid/CreateRDF.class: src/java/main/org/wikipathways/covid/CreateRDF.java
@echo "Compiling $@ ..."
@javac -cp libs/GPML2RDF-3.0.0-SNAPSHOT-jar-with-dependencies.jar src/java/main/org/wikipathways/covid/CreateRDF.java
@javac -cp libs/GPML2RDF-3.0.0-SNAPSHOT.jar src/java/main/org/wikipathways/covid/CreateRDF.java

src/java/main/org/wikipathways/covid/CreateGPMLRDF.class: src/java/main/org/wikipathways/covid/CreateGPMLRDF.java
@echo "Compiling $@ ..."
@javac -cp libs/GPML2RDF-3.0.0-SNAPSHOT-jar-with-dependencies.jar src/java/main/org/wikipathways/covid/CreateGPMLRDF.java
@javac -cp libs/GPML2RDF-3.0.0-SNAPSHOT.jar src/java/main/org/wikipathways/covid/CreateGPMLRDF.java

src/java/main/org/wikipathways/covid/CheckRDF.class: src/java/main/org/wikipathways/covid/CheckRDF.java libs/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar
@echo "Compiling $@ ..."
Expand All @@ -91,6 +91,8 @@ index.md: ${REPORTS}
echo ".json\">" >> index.md ; \
done

update:
update: install
@wget -O Makefile https://raw.githubusercontent.com/wikipathways/wikipathways-curation-template/main/Makefile
@wget -O src/java/main/org/wikipathways/covid/CheckRDF.java https://raw.githubusercontent.com/wikipathways/wikipathways-curation-template/main/src/java/main/org/wikipathways/covid/CheckRDF.java
@wget -O src/java/main/org/wikipathways/covid/CreateRDF.java https://raw.githubusercontent.com/wikipathways/wikipathways-curation-template/main/src/java/main/org/wikipathways/covid/CreateRDF.java
@wget -O src/java/main/org/wikipathways/covid/CreateGPMLRDF.java https://raw.githubusercontent.com/wikipathways/wikipathways-curation-template/main/src/java/main/org/wikipathways/covid/CreateGPMLRDF.java
8 changes: 3 additions & 5 deletions libs/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Required libraries

Java libraries needed for running the tests. They can be downloaded from
https://github.com/wikipathways/wikipathways-curation-template/releases/tag/release-1
https://github.com/wikipathways/wikipathways-curation-template/releases/

Get the libraries with:

```
wget https://github.com/wikipathways/wikipathways-curation-template/releases/download/release-1/GPML2RDF-3.0.0-SNAPSHOT-jar-with-dependencies.jar
wget https://github.com/wikipathways/wikipathways-curation-template/releases/download/release-1/jena-arq-3.17.0.jar
wget https://github.com/wikipathways/wikipathways-curation-template/releases/download/release-1/wikipathways.curator-1-SNAPSHOT-jar-with-dependencies.jar
wget -O slf4j-simple-1.7.32.jar https://search.maven.org/remotecontent?filepath=org/slf4j/slf4j-simple/1.7.32/slf4j-simple-1.7.32.jar
cd ..
make install
```
15 changes: 7 additions & 8 deletions src/java/main/org/wikipathways/covid/CreateGPMLRDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ByteArrayOutputStream;
import java.util.Collections;

import org.bridgedb.DataSource;
Expand All @@ -18,25 +18,24 @@
import org.wikipathways.wp2rdf.GpmlConverter;
import org.wikipathways.wp2rdf.WPREST2RDF;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Model;

public class CreateGPMLRDF {

public static void main(String[] args) throws Exception {
String gpmlFile = args[0];
String wpid = gpmlFile.substring(5,11);
String rev = args[1];
String rev = args[2];
String outFile = args[1];

InputStream input = new FileInputStream(gpmlFile);
Pathway pathway = PathwayReader.readPathway(input);
input.close();

Model model = ModelFactory.createDefaultModel();
GpmlConverter.convertGpml(pathway, wpid, rev, model);
ByteArrayOutputStream output = new ByteArrayOutputStream();
Model model = GpmlConverter.convertGpml(pathway, wpid, rev, Collections.<String>emptyList());
FileOutputStream output = new FileOutputStream(outFile);
model.write(output, "TURTLE");
System.out.print(new String(output.toByteArray()));
output.close();
}

}
17 changes: 10 additions & 7 deletions src/java/main/org/wikipathways/covid/CreateRDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ByteArrayOutputStream;
import java.util.Collections;

import org.bridgedb.DataSource;
Expand All @@ -18,24 +18,27 @@
import org.wikipathways.wp2rdf.GpmlConverter;
import org.wikipathways.wp2rdf.WPREST2RDF;

import com.hp.hpl.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Model;

public class CreateRDF {

public static void main(String[] args) throws Exception {
String gpmlFile = args[0];
String wpid = gpmlFile.substring(5,11);
String rev = args[1];
String rev = args[2];
String outFile = args[1];

DataSourceTxt.init();
// the next line is needed until BridgeDb gets updated
InputStream input = new FileInputStream(gpmlFile);
Pathway pathway = PathwayReader.readPathway(input);
input.close();

IDMapperStack stack = WPREST2RDF.maps();
Model model = GpmlConverter.convertWp(pathway, wpid, rev, stack, Collections.<String>emptyList());
input.close();
ByteArrayOutputStream output = new ByteArrayOutputStream();
FileOutputStream output = new FileOutputStream(outFile);
model.write(output, "TURTLE");
System.out.print(new String(output.toByteArray()));
output.flush();
output.close();
}

}

0 comments on commit 656a92f

Please sign in to comment.