Skip to content

Commit 8970b09

Browse files
committed
Automatically download Jena RIOT
1 parent b4bb707 commit 8970b09

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ share/python-wheels/
3131
*.egg
3232
MANIFEST
3333
node_modules/
34+
apache-jena-*.tar.gz
35+
apache-jena-*/

Makefile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
# Before editing this file, ensure that your editor is not set up to convert tabs
2626
# to spaces, and then use tabs to indent recipe lines.
2727

28+
JENA_VERSION := 6.0.0
29+
JENA_DIR := apache-jena-$(JENA_VERSION)
30+
JENA_ARCHIVE := $(JENA_DIR).tar.gz
31+
JENA_URL := https://archive.apache.org/dist/jena/binaries/$(JENA_ARCHIVE)
32+
RIOT := ./$(JENA_DIR)/bin/riot
2833

2934
### Configuration
3035

@@ -51,7 +56,7 @@ integration-test: test valid-purl-report.txt
5156

5257
# Remove and/or revert all targets to their repository versions:
5358
clean:
54-
rm -Rf registry/ontologies.nt registry/ontologies.ttl registry/ontologies.yml sparql-consistency-report.txt jenkins-output.txt valid-purl-report.txt valid-purl-report.txt.tmp _site/ tmp/ reports/
59+
rm -Rf registry/ontologies.nt registry/ontologies.ttl registry/ontologies.yml sparql-consistency-report.txt jenkins-output.txt valid-purl-report.txt valid-purl-report.txt.tmp _site/ tmp/ reports/ $(JENA_DIR) $(JENA_ARCHIVE)
5560
git checkout _config.yml registry/ontologies.jsonld registry/ontologies.ttl registry/ontologies.yml
5661

5762

@@ -103,15 +108,24 @@ registry/obo_context.jsonld: registry/ontologies.yml
103108
registry/obo_prefixes.ttl: registry/ontologies.yml
104109
./util/make-shacl-prefixes.py $< > $@.tmp && mv $@.tmp $@
105110

111+
# Download and extract Jena
112+
$(RIOT): $(JENA_DIR)/bin/riot
113+
$(JENA_DIR)/bin/riot: $(JENA_ARCHIVE)
114+
tar -xzf $(JENA_ARCHIVE)
115+
touch $@
116+
117+
$(JENA_ARCHIVE):
118+
curl -fL $(JENA_URL) -o $(JENA_ARCHIVE)
119+
106120
# Use Apache-Jena RIOT to convert jsonld to n-triples
107121
# NOTE: UGLY HACK. If there is a problem then Jena will write WARN message (to stdout!!!), there appears to
108122
# be no way to get it to flag this even with strict and check options, so we do a check with grep, ugh.
109123
# see: http://stackoverflow.com/questions/20860222/why-do-i-have-these-warnings-with-jena-2-11-0
110-
registry/ontologies.nt: registry/ontologies.jsonld
111-
riot --base=http://purl.obolibrary.org/obo/ --strict --check -q registry/context.jsonld $< > $@.tmp && mv $@.tmp $@ && egrep '(WARN|ERROR)' $@ && exit 1 || echo ok
124+
registry/ontologies.nt: registry/ontologies.jsonld $(RIOT)
125+
$(RIOT) --base=http://purl.obolibrary.org/obo/ --strict --check -q registry/context.jsonld $< > $@.tmp && mv $@.tmp $@ && egrep '(WARN|ERROR)' $@ && exit 1 || echo ok
112126

113-
registry/ontologies.ttl: registry/ontologies.nt
114-
riot --base=http://purl.obolibrary.org/obo/ --out=ttl $< > $@.tmp && mv $@.tmp $@
127+
registry/ontologies.ttl: registry/ontologies.nt $(RIOT)
128+
$(RIOT) --base=http://purl.obolibrary.org/obo/ --out=ttl $< > $@.tmp && mv $@.tmp $@
115129

116130
### Validate Configuration Files
117131

0 commit comments

Comments
 (0)