-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·23 lines (17 loc) · 944 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·23 lines (17 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash +e +x
# Generate JSON-LD @contexts from OpenFDA ElasticSearch JSON mappings
# NOTE: this script expects to be run within the repo root directory
git clone https://github.com/westurner/elasticsearchjsonld
pip install -e elasticsearchjsonld/
./elasticsearchjsonld/scripts/build_openfda_jsonld_contexts.sh ./schemas ./ns
echo "<html><head><title>openfda-jsonld-testing</title></head><body><pre>" > index.html
find ./schemas ./ns | tr '<' '_' | tr '>' '_' >> index.html # XXX
echo "</pre></body></html>" >> index.html
(cd ./schemas && \
echo "<html><head><title>openfda-jsonld-testing</title></head><body><pre>" > index.html && \
(find . | tr '<' '_' | tr '>' '_' >> index.html) &&
echo "</pre></body></html>" >> index.html)
(cd ./ns && \
echo "<html><head><title>openfda-jsonld-testing</title></head><body><pre>" > index.html && \
(find . | tr '<' '_' | tr '>' '_' >> index.html) &&
echo "</pre></body></html>" >> index.html)