Skip to content

Commit

Permalink
Merge branch 'main' of github.com:BrickSchema/ontology.brickschema.org
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Aug 22, 2024
2 parents 45e0f23 + f78c1a6 commit 3ae8fc1
Show file tree
Hide file tree
Showing 6 changed files with 141,711 additions and 4 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/build-explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,38 @@ jobs:
npm i @rdf-toolkit/cli
- name: Copy ontologies
run: cp ontologies/*.ttl rdf-toolkit/explorer/vocab
run: |
cp -r ontologies/* rdf-toolkit/explorer/vocab/
ls rdf-toolkit/explorer/vocab
- name: Copy config file
run: cp rdfconfig.json rdf-toolkit/explorer/

- name: Build site
working-directory: rdf-toolkit/explorer
run: |
npx rdf add file "https://brickschema.org/schema/1.4/Brick" vocab/Brick.ttl
npx rdf add file "https://brickschema.org/schema/1.4/Brick" vocab/brick/latest/Brick.ttl
npx rdf add file "http://qudt.org/2.1/schema/shacl/qudt" vocab/SCHEMA_QUDT_NoOWL-v2.1.ttl
npx rdf add file "http://qudt.org/2.1/vocab/unit" vocab/VOCAB_QUDT-UNITS-ALL-v2.1.ttl
npx rdf add file "http://qudt.org/2.1/vocab/quantitykind" vocab/VOCAB_QUDT-QUANTITY-KINDS-ALL-v2.1.ttl
npx rdf add file "http://www.w3.org/ns/shacl" vocab/shacl.ttl
npx rdf add file "https://brickschema.org/schema/Brick/ref" vocab/ref-schema.ttl
npx rdf add file "https://w3id.org/rec" vocab/rec.ttl
npx rdf make site
npx rdf make site --output public
- name: handle brick 1.3
working-directory: rdf-toolkit/explorer
run: |
git checkout package.json
npx rdf add file "https://brickschema.org/schema/1.3/Brick" vocab/brick/1.3/Brick.ttl
npx rdf make site --output public/1.3
- name: handle brick 1.4
working-directory: rdf-toolkit/explorer
run: |
git checkout package.json
npx rdf add file "https://brickschema.org/schema/1.4/Brick" vocab/brick/1.4/Brick.ttl
npx rdf make site --output public/1.4
- name: Commit Built Files
run: |
Expand Down
65 changes: 65 additions & 0 deletions build-site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

set -ex

# make an array of Brick versions
BRICK_VERSIONS="1.3 1.4"

# Create a temporary directory
TEMP_DIR=$(mktemp -d)
#rm -rf /tmp/rdf-toolkit
#TEMP_DIR=/tmp/rdf-toolkit
CURRENT_DIR=$(pwd)
DEST=$CURRENT_DIR/site

mkdir -p $DEST

# Clone the repository and navigate into it
git clone https://github.com/KrishnanN27/rdf-toolkit "$TEMP_DIR"
cd "$TEMP_DIR"

cp $CURRENT_DIR/rdfconfig.json "$TEMP_DIR/explorer/"

# Install dependencies
npm ci

# Build NPM package
npm run build
npm install @rdf-toolkit/cli

# Copy ontologies to the appropriate directory
#mkdir -p "$TEMP_DIR/rdf-toolkit/explorer/vocab"
#cp -R $CURRENT_DIR/ontologies/ "$TEMP_DIR/rdf-toolkit/explorer/vocab"
#tree $TEMP_DIR/rdf-toolkit/explorer/vocab

# Copy config file
#cp $CURRENT_DIR/rdfconfig.json "$TEMP_DIR/rdf-toolkit/explorer/"

# download the latest version of Brick from github
wget -O $CURRENT_DIR/ontologies/brick/latest/Brick.ttl https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl

# do the generic version-agnostic stuff first
cd "$TEMP_DIR/explorer"
npx rdf add file "https://brickschema.org/schema/Brick" $CURRENT_DIR/ontologies/brick/latest/Brick.ttl
npx rdf add file "http://qudt.org/2.1/schema/shacl/qudt" $CURRENT_DIR/ontologies/SCHEMA_QUDT_NoOWL-v2.1.ttl
npx rdf add file "http://qudt.org/2.1/vocab/unit" $CURRENT_DIR/ontologies/VOCAB_QUDT-UNITS-ALL-v2.1.ttl
npx rdf add file "http://qudt.org/2.1/vocab/quantitykind" $CURRENT_DIR/ontologies/VOCAB_QUDT-QUANTITY-KINDS-ALL-v2.1.ttl
npx rdf add file "http://www.w3.org/ns/shacl" $CURRENT_DIR/ontologies/shacl.ttl
npx rdf add file "https://brickschema.org/schema/Brick/ref" $CURRENT_DIR/ontologies/ref-schema.ttl
npx rdf add file "https://w3id.org/rec" $CURRENT_DIR/ontologies/rec.ttl
npx rdf make site --output "$DEST/$version" --project "$TEMP_DIR/explorer"

# loop through and build the site for each version by calling './b2.sh <version>'
for version in $BRICK_VERSIONS; do
git checkout package.json
# download the Brick version from https://brickschema.org/schema/$version/Brick.ttl
# if the version is 'latest', then pull from https://github.com/BrickSchema/Brick/releases/download/nightly/Brick.ttl
# put the result in vocab/brick/$version/Brick.ttl

mkdir -p $CURRENT_DIR/ontologies/brick/$version
wget -O $CURRENT_DIR/ontologies/brick/$version/Brick.ttl https://brickschema.org/schema/$version/Brick.ttl
#./b2.sh $version
cd "$TEMP_DIR/explorer"
npx rdf add file "https://brickschema.org/schema/$version/Brick" $CURRENT_DIR/ontologies/brick/$version/Brick.ttl
npx rdf make site --output "$DEST/$version" --project "$TEMP_DIR/explorer"
done
Loading

0 comments on commit 3ae8fc1

Please sign in to comment.