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:
5358clean :
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
103108registry/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