Skip to content

Commit 4946df1

Browse files
committed
Switch to using jelly-cli
1 parent 112a983 commit 4946df1

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

Dockerfile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,8 @@ WORKDIR /app
3838
# Download robot.jar
3939
RUN wget https://github.com/ontodev/robot/releases/download/v1.9.7/robot.jar
4040

41-
# Download Apache Jena
42-
# The path to Jena RIOT CLI tool is /app/jena/bin/riot
43-
RUN wget https://dlcdn.apache.org/jena/binaries/apache-jena-5.2.0.tar.gz -O apache-jena.tar.gz && \
44-
tar -xzf apache-jena.tar.gz && \
45-
rm apache-jena.tar.gz && \
46-
mv apache-jena-* jena
47-
48-
# Download the Jelly-JVM plugin for Jena
49-
RUN wget https://github.com/Jelly-RDF/jelly-jvm/releases/download/v2.3.0/jelly-jena-plugin.jar \
50-
-O jena/lib/jelly-jena-plugin.jar
41+
# Install jelly-cli
42+
RUN bash -c "$(curl -sSfL https://w3id.org/jelly/setup-cli.sh)"
5143

5244
# Copy virtual env from python-deps stage
5345
COPY --from=python-deps /.venv /app/.venv
@@ -56,4 +48,4 @@ ENV PATH="/app/.venv/bin:$PATH"
5648
# Install application into container
5749
COPY . .
5850

59-
ENTRYPOINT []
51+
ENTRYPOINT []

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CI worker for processing the RDF Stream Taxonomy (RDF-STaX).
44

55
## Usage
66

7-
Use the provided Docker image. The container includes the Python scripts, a JRE, the [ROBOT tool](http://robot.obolibrary.org/), and an [Apache Jena CLI distribution](https://jena.apache.org/documentation/tools/index.html) with the [Jelly-JVM plugin](https://w3id.org/jelly/jelly-jvm/dev/getting-started-plugins/) installed.
7+
Use the provided Docker image. The container includes the Python scripts, a JRE, the [ROBOT tool](http://robot.obolibrary.org/), and [jelly-cli](https://github.com/Jelly-RDF/cli) for converting between various RDF formats, including [Jelly](https://w3id.org/jelly).
88

99
In the container you can invoke the commands:
1010

tasks/nanopub_fetch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def main():
7070
d.parse(Path(cache_dir, source_file), format='trig')
7171
d.serialize(Path(output_dir, 'nanopubs.trig'), format='trig')
7272
d.serialize(Path(output_dir, 'nanopubs.nq'), format='nquads')
73-
# Convert it to Jelly as well, using Apache Jena RIOT
73+
# Convert it to Jelly as well, using jelly-cli
7474
with open(Path(output_dir, 'nanopubs.jelly'), 'wb') as f:
7575
subprocess.run([
76-
str(parent_dir / 'jena/bin/riot'), '--stream=jelly', str(Path(output_dir, 'nanopubs.nq'))
76+
'jelly-cli', 'rdf', 'to-jelly', str(Path(output_dir, 'nanopubs.nq'))
7777
], check=True, stdout=f, stderr=subprocess.STDOUT)
7878

7979
print(f'Writing download links...')

tasks/package.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ def serialize(g: Graph, output_dir: Path, filename: str, parent_dir: Path):
137137
g.serialize(destination=output_dir / f'{filename}.rdf', format='xml', encoding='utf-8')
138138
g.serialize(destination=output_dir / f'{filename}.jsonld', format='json-ld', encoding='utf-8')
139139
g.serialize(destination=output_dir / f'{filename}.nt', format='nt', encoding='utf-8')
140-
# Convert it to Jelly as well, using Apache Jena RIOT
140+
# Convert it to Jelly as well, using jelly-cli
141141
with open(output_dir / f'{filename}.jelly', 'wb') as f:
142142
subprocess.run([
143-
str(parent_dir / 'jena/bin/riot'),
144-
'--stream=jelly',
143+
'jelly-cli', 'rdf', 'to-jelly',
145144
# Disable generalized RDF and RDF-star in the metadata, because we are not using that
146-
'--set="https://ostrzyciel.eu/jelly/riot/symbols#preset=SMALL_STRICT"',
145+
'--opt.rdf-star=false',
146+
'--opt.generalized-statements=false',
147147
str(output_dir / f'{filename}.nt')
148148
], check=True, stdout=f, stderr=subprocess.STDOUT)
149149

0 commit comments

Comments
 (0)