@@ -29,7 +29,10 @@ JENA_VERSION := 6.0.0
2929JENA_DIR := apache-jena-$(JENA_VERSION )
3030JENA_ARCHIVE := $(JENA_DIR ) .tar.gz
3131JENA_URL := https://archive.apache.org/dist/jena/binaries/$(JENA_ARCHIVE )
32- RIOT := ./$(JENA_DIR ) /bin/riot
32+ LOCAL_RIOT := ./$(JENA_DIR ) /bin/riot
33+
34+ # Use system riot if available, otherwise fall back to local
35+ RIOT := $(shell command -v riot 2>/dev/null || echo "$(LOCAL_RIOT ) ")
3336
3437# ## Configuration
3538
@@ -108,15 +111,18 @@ registry/obo_context.jsonld: registry/ontologies.yml
108111registry/obo_prefixes.ttl : registry/ontologies.yml
109112 ./util/make-shacl-prefixes.py $< > $@ .tmp && mv $@ .tmp $@
110113
111- # Download and extract Jena
112- $(RIOT ) : $(JENA_DIR ) /bin/riot
113- $(JENA_DIR ) /bin/riot : $(JENA_ARCHIVE )
114+ # Only built if RIOT resolved to the local path
115+ $(LOCAL_RIOT ) : $(JENA_ARCHIVE )
114116 tar -xzf $(JENA_ARCHIVE )
115117 touch $@
116118
117119$(JENA_ARCHIVE ) :
118120 curl -fL $(JENA_URL ) -o $(JENA_ARCHIVE )
119121
122+ # If RIOT is the system one, this is a no-op (file already exists)
123+ $(shell command -v riot 2>/dev/null) :
124+ @true
125+
120126# Use Apache-Jena RIOT to convert jsonld to n-triples
121127# NOTE: UGLY HACK. If there is a problem then Jena will write WARN message (to stdout!!!), there appears to
122128# be no way to get it to flag this even with strict and check options, so we do a check with grep, ugh.
0 commit comments