added etl #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ontology-bot | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: install libs | |
run: pip3 install rdflib | |
- name: rdflib load validation | |
uses: jannekem/run-python-script-action@v1 | |
with: | |
script: | | |
# import libraries | |
import pathlib | |
import rdflib | |
# compile class files | |
class_dir = pathlib.Path.cwd() / 'classes' | |
classes = [x for x in class_dir.iterdir() if x.suffix == '.ttl'] | |
# load into graph, should throw syntax errors | |
graph = rdflib.Graph() | |
for x in sorted(classes): | |
graph += rdflib.Graph().parse(x) | |
print(x, len(graph)) | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: install libs | |
run: pip3 install rdflib | |
- name: compile ontology | |
uses: jannekem/run-python-script-action@v1 | |
with: | |
script: | | |
# import libraries | |
import pathlib | |
import rdflib | |
# compile class files | |
class_dir = pathlib.Path.cwd() / 'classes' | |
classes = [x for x in class_dir.iterdir() if x.suffix == '.ttl'] | |
# load into graph, should throw syntax errors | |
graph = rdflib.Graph() | |
for x in sorted(classes): | |
graph += rdflib.Graph().parse(x) | |
graph.serialize(destination=str(pathlib.Path.cwd() / 'FIAFcore.ttl'), format="turtle") | |
- name: push graph | |
# if: github.event_name == 'push' | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add * | |
git commit -a -m "ontology compiled" | |
git push |