From aa740863f2d5810a473daed7862eefc92b177193 Mon Sep 17 00:00:00 2001 From: angelip2303 Date: Tue, 27 Jun 2023 10:06:42 +0000 Subject: [PATCH] from_uniprot is now easier to work with --- .gitignore | 1 + examples/from_uniprot/README.md | 11 +++++++++++ examples/from_uniprot/main.rs | 2 +- examples/from_uniprot/run.sh | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 examples/from_uniprot/README.md create mode 100644 examples/from_uniprot/run.sh diff --git a/.gitignore b/.gitignore index 32f7bef..2365217 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ Cargo.lock *.json *.duckdb *.nt +*.rdf *.parquet diff --git a/examples/from_uniprot/README.md b/examples/from_uniprot/README.md new file mode 100644 index 0000000..df96ebe --- /dev/null +++ b/examples/from_uniprot/README.md @@ -0,0 +1,11 @@ +## Usage + +```{shell} +cd examples/from_uniprot/ +sh run.sh +``` + +## Requirements + +Have the `xz` tool installed, as well as [Apache Jena's](https://jena.apache.org/documentation/tools/) `riot` command line utility +installed. \ No newline at end of file diff --git a/examples/from_uniprot/main.rs b/examples/from_uniprot/main.rs index 7a1219c..c757553 100644 --- a/examples/from_uniprot/main.rs +++ b/examples/from_uniprot/main.rs @@ -48,7 +48,7 @@ fn main() -> Result<(), String> { .into(); // Load Wikidata entities - let edges = NTriples::import("./examples/from_uniprot/uniprotkb_reviewed_viruses_10239.nt")?; + let edges = NTriples::import("uniprotkb_reviewed_viruses_10239_0.nt")?; // Perform schema validation let start = Instant::now(); diff --git a/examples/from_uniprot/run.sh b/examples/from_uniprot/run.sh new file mode 100644 index 0000000..7f6e45f --- /dev/null +++ b/examples/from_uniprot/run.sh @@ -0,0 +1,3 @@ +xz -v -d -k uniprotkb_reviewed_viruses_10239_0.rdf.xz +riot --output=ntriples uniprotkb_reviewed_viruses_10239_0.rdf > uniprotkb_reviewed_viruses_10239_0.nt +cargo run -r --example from_uniprot \ No newline at end of file