Skip to content

Add and confirm prefix customization; start doctests #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:

- name: Install Dependencies
run: |
pip -q install poetry pre-commit
pip -q install poetry pre-commit rdflib
poetry install

- name: Pre-commit Checks
run: pre-commit run --all-files

- name: Unit Tests
run: poetry run pytest
run: poetry run pytest --doctest-modules

- name: Run Example
run: poetry run python example.py > case.jsonld
Expand All @@ -44,6 +44,11 @@ jobs:
case-version: "case-1.3.0"
extension-filter: "jsonld"

- name: Convert example
run: |
rdfpipe --output-format turtle case.jsonld > case.ttl
test 0 -eq $(grep 'file:' case.ttl | wc -l) || (echo "ERROR:ci.yml:Some graph IRIs do not supply a resolving prefix. Look for the string 'file:///' in the file case.ttl (created by running 'make check') to see these instances." >&2 ; exit 1)

# Always build the package as a sanity check to ensure no issues with the build system
# exist as part of the CI process
- name: Build Package
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ __pycache__/
# Build Artifacts
build/
dist/
case.ttl
23 changes: 21 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,26 @@ case.jsonld: \
_$@
mv _$@ $@

case.ttl: \
case.jsonld
source venv/bin/activate \
&& rdfpipe \
--output-format turtle \
$< \
> _$@
source venv/bin/activate \
&& case_validate \
_$@
@# In instances where graph nodes omit use of a prefix, a 'default' prefix-base is used that incorporates the local directory as a file URL. This is likely to be an undesired behavior, so for the generated example JSON-LD in the top source directory, check that "file:///" doesn't start any of the graph individuals' IRIs.
test \
0 \
-eq \
$$(grep 'file:' _$@ | wc -l) \
|| ( echo "ERROR:Makefile:Some graph IRIs do not supply a resolving prefix. Look for the string 'file:///' in the file _$@ to see these instances." >&2 ; exit 1)
mv _$@ $@

check: \
all
all \
case.ttl
source venv/bin/activate \
&& poetry run pytest
&& poetry run pytest --doctest-modules
Loading