Skip to content

Commit

Permalink
Version control line
Browse files Browse the repository at this point in the history
  • Loading branch information
steveraysteveray committed Jan 13, 2025
1 parent 69993ea commit 5e6c12e
Show file tree
Hide file tree
Showing 33 changed files with 1,401 additions and 450 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Thanks for considering helping us in making QUDT better. Please review the Issues list for something that catches your interest, or
Thanks for considering helping us in making QUDT better. Please review the Issues list for something that catches your interest, or
see our <a href="https://github.com/qudt/qudt-public-repo/wiki"> Wiki</a> for detailed guidelines on adding content to the models.
65 changes: 65 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Format sources and commit to branch
on:
workflow_dispatch:

jobs:
format:
# setting the environment on the job is mandatory, otherwise it cannot access environment secrets.
runs-on: ubuntu-latest

steps:
- name: Check write access to repo
run: |
token_login=$(curl -H "Authorization: Bearer ${token}" https://api.github.com/user | jq -r '.login')
echo token login is ${token_login}
echo $(curl -H "Authorization: Bearer ${token}" https://api.github.com/repos/${repo}/collaborators/${token_login}/permission) > result
cat result | jq '.permission == "admin" // .permission == "write"' > /dev/null || ( echo "Token does not have write access to ${repo}" >> ${GITHUB_STEP_SUMMARY}; exit 1)
curl -sS -f -I -H "Authorization: Bearer ${token}" https://api.github.com | grep 'x-oauth-scopes:' | grep 'repo' > /dev/null && exit 0 || echo "Token does not have repo scope on ${repo}" >> ${GITHUB_STEP_SUMMARY}
env:
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}

# Set up java with maven cache
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

# configure git
- name: Setup git config
run: |
git config user.name ${{ github.actor }}
git config user.email "<>"
# Check formatting and exit early (with success) if format is ok
- name: Check formatting
run: |
if mvn spotless:check; then
echo "Source was already formatted, nothing was touched." >> $GITHUB_STEP_SUMMARY
exit 0
else
echo "Sources need formatting, we'll do that now"
fi
# Apply formatting (changelog was touched)
- name: Apply formatting
run: mvn spotless:apply

# Commit changes
- name: Commit changes
run: |
git add --all
git commit -m "Apply formatting rules"
# Push changes to branch
- name: Push changes to branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin

# print the summary
- name: Print summary
run: echo "Successfully formatted the source files and made a commit." >> $GITHUB_STEP_SUMMARY
88 changes: 79 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven
name: CI Build

on:
push:
pull_request:
pull_request_target:
branches:
- main
types:
- closed
branches: [ "main" ]
pull_request:
branches:
- main
workflow_dispatch:
inputs:
force_snapshot_release:
description: 'Update the snapshot release on github'
required: false
type: boolean

jobs:
build:
Expand All @@ -24,26 +33,87 @@ jobs:
distribution: 'temurin'
cache: maven


- name: Check if a snapshot release should be made and set environment variable
run: echo "MAKE_SNAPSHOT_RELEASE=${{ inputs.force_snapshot_release || (github.event.pull_request.base.ref == 'main' && github.event.action == 'closed' && github.event.pull_request.merged == true) }}" >> $GITHUB_ENV

# configure git
- name: setup git config
run: |
git config user.name ${{ github.actor }}
git config user.email "<>"
- name: Fetch branches (unless PR was merged)
if: ${{ env.MAKE_SNAPSHOT_RELEASE == 'false' }}
run: |
# as we aren't building main, let's fetch it
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
# Fetch from contributor’s fork
git remote add fork ${{ github.event.pull_request.head.repo.clone_url }}
git fetch fork ${{ github.event.pull_request.head.ref }}:${{ github.head_ref }}
else
# Fetch from the same repo
git fetch origin ${{ github.head_ref }}:${{ github.head_ref }}
fi
- name: Fail if src/main has changes but CHANGELOG.md does not (unless PR was merged)
if: ${{ env.MAKE_SNAPSHOT_RELEASE == 'false' }}
run: |
set -e
CHANGED_FILES=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }})
if echo "$CHANGED_FILES" | grep -q '^src/main' && ! echo "$CHANGED_FILES" | grep -q '^CHANGELOG.md$'; then
echo "Directory src/main changed without an update of CHANGELOG.md, this is not allowed. Please update CHANGELOG.md"
exit 1
fi
# Read version changelog before anything else - if there is a formatting error
# in the changelog (which happens), we fail fast
# Do this even if we will not make the snapshot release, so the changelog is checked as part of a normal
# ci run.

- name: Check Changelog formatting
id: get-changelog
uses: superfaceai/release-changelog-action@v1
with:
path-to-changelog: CHANGELOG.md
version: ${{ inputs.release_version }}
operation: read

- name: Build with Maven
run: mvn -Pzip install

# delete the snapshot release (the release action does not update the
# body, so we have to delete the whole thing)
- name: Delete Snapshot Release
if: ${{ env.MAKE_SNAPSHOT_RELEASE == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release delete snapshot --cleanup-tag --yes || echo "Error deleting snapshot release - continuing anyway"

- name: change tag 'snapshot' to current commit
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.action == 'closed' && github.event.pull_request.merged == true}} # only make snapshot release if it is a push to main
if: ${{ env.MAKE_SNAPSHOT_RELEASE == 'true' }}
run: |
git tag -f snapshot
git push -f origin --tags
- name: Make Release Body
if: ${{ env.MAKE_SNAPSHOT_RELEASE == 'true' }}
run: |
git tag -f snapshot
git push -f origin --tags
cat src/build/snapshot-release/release-body-header.md > target/release-body.md
echo "# Changes" >> target/release-body.md
cat <<'EOF' >> target/release-body.md
${{ steps.get-changelog.outputs.changelog }}
EOF
cat src/build/snapshot-release/release-body-footer.md >> target/release-body.md
# Make github release
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.action == 'closed' && github.event.pull_request.merged == true}} # only make snapshot release if it is a push to main
if: ${{ env.MAKE_SNAPSHOT_RELEASE == 'true' }}
with:
name: Latest snapshot release
tag_name: snapshot
body_path: src/build/release/release-body.md
body_path: target/release-body.md
files: target/qudt-public-repo-*.zip
prerelease: true
30 changes: 22 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,6 @@ jobs:
env:
password: ${{ secrets.GITHUB_TOKEN }}

# Make github release
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.release_version }}
body_path: src/build/release/release-body.md
files: target/checkout/target/qudt-public-repo-*.zip

# Read version changelog
- id: get-changelog
name: Get version changelog
Expand All @@ -137,6 +129,22 @@ jobs:
version: ${{ inputs.release_version }}
operation: read

# Make github release
- name: Make Release Body
run: |
cat src/build/release/release-body-header.md > target/release-body.md
echo "# Changes" >> target/release-body.md
cat <<'EOF' >> target/release-body.md
${{ steps.get-changelog.outputs.changelog }}
EOF
cat src/build/release/release-body-footer.md >> target/release-body.md
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.release_version }}
body_path: target/release-body.md
files: target/checkout/target/qudt-public-repo-*.zip

# create the pull request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
Expand All @@ -162,6 +170,12 @@ jobs:
Please rebase this PR on top of `main` after verifying the release is ok.
# delete the snapshot release (so we do not accumulate snapshots of all versions over time)
- name: Delete Snapshot Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release delete snapshot --cleanup-tag --yes || echo "Error deleting snapshot release - continuing anyway"

# print the summary
- name: Print summary
run: echo "Release ${{ inputs.release_version }} was built and published on GitHub." >> $GITHUB_STEP_SUMMARY
70 changes: 66 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,73 @@ and this project is in the process of adopting [Semantic Versioning](https://sem

### Added

- Add the qudt:altSymbol relation
- Add "mph" and "kph" as `qudt:altSymbol`
- New QuantityKinds
- `qk:OsmoticConcentration` by [Toby Broom](https://github.com/Toby-Broom/)
- `qk:AmountOfCloudCover` by [Jeffrey Vervoort](https://github.com/Jeffrey-Vervoort-KNMI)
- New Units
- `unit:MegaTONNE-PER-YR` by [Jurek Müller](https://github.com/JurekMueller)
- `unit:OSM` by [Toby Broom](https://github.com/Toby-Broom/)
- `unit:MilliOSM-PER-KiloGM` by [Toby Broom](https://github.com/Toby-Broom/)
- `unit:OKTA` by [Jeffrey Vervoort](https://github.com/Jeffrey-Vervoort-KNMI)
- New QA Tests
- Added SHACL shapes for checking content under `src/` only

### Changed

- Removed the vaem:revision triples that were causing retention of v2.1 strings in the URIs
- `qudt:informativeReference` triples added/replaced by a link to IEC CDD generated based on `qudt:iec61360Code` triples by [Vladimir Alexiev](https://github.com/VladimirAlexiev)

### Fixed

- Corrected the `qudt:ucumCode` of `unit:TeraW-HR-PER-YR` to "TW.h/a" by [Jurek Müller](https://github.com/JurekMueller)
- Fixed non-working informativeReference links in units vocabulary [Phil Blackwood](https://github.com/philblackwood)

## [2.1.46] - 2024-12-09

### Added

- QUDT Schema
- Add the `qudt:altSymbol` property to support using multiple symbols with a unit/quantitykind alongside
the primary one, which is`qudt:symbol`
- New QuantityKinds
- `qk:AmountOfSubstanceIonConcentration` as a narrower kind of `qk:Concentration`.
- `qk:CoefficientOfPerformance` by [lazlop](https://github.com/lazlop)
- `qk:CompoundPlaneAngle`
- `qk:CountRate` ( units: `unit:NUM-PER-SEC`, `unit:NUM-PER-HR`, `unit:NUM-PER-YR`)
- `qk:CurrentOfTheAmountOfSubstance` (replaces`qk:CurrentOfTheAmountOfSubtance`)
- `qk:RotationalFrequency` (units: `unit:Hz`, `unit:REV-PER-MIN`, `unit:REV-PER-HR`, `unit:REV-PER-SEC`)
- `qk:VaporPermeability` (unit: `unit:KiloGM-PER-PA-SEC-M`)
- `qk:VaporPermeance` (for what used to be `qk:VaporPermeability`, see 'Changed')
- New Units
- `unit:CYC-PER-SEC`
- `unit:KiloLM`
- `unit:CD-PER-KiloLM`
- `unit:CI` (replaces `unit:Ci`)
- `unit:FLIGHT` (replaces `unit:Flight`)
- Other Additions
- Add "mph" as `qudt:altSymbol` of `unit:M-PER-HR` from [Toby Broom](https://github.com/Toby-Broom/)
- Add "kph" as `qudt:altSymbol` of `unit:KiloM-PER-HR` from [Toby Broom](https://github.com/Toby-Broom/)
- SHACL validation of SHACL shapes by [Dimitris Kontokostas](https://github.com/jimkont)

### Changed

- Enforce at most a single qudt:symbol for all instances.
- Delete spurious qudt:symbol values in a number of quantity kinds
- Correct the conversion offset for MilliDEG_C
- Rename `qk:VaporPermeability` to `qk:VaporPermeance` and change all unit associations accordingly.
- Unify `PER-X` symbols to the 15:1 majority pattern, `"/x"` where `"1/x"` is used
- Unify `NUM-PER-X` symbols to always represent `NUM` as `#` (as has already been used in `unit:NUM`)
- Remove `qk:NumberDensity` from `unit:PER-M3`
- Make `qk:RotationalFrequency` exactMatch of `qk:RotationalVelocity`, remove broader qk
- Make `qk:AngularFrequency` exactMatch of `qk:AngularVelocity`, remove broader qk

### Deprecated

- `unit:Ci` (replaced by: `unit:CI`)
- `unit:Flight` (replaced by: `unit:FLIGHT`)
- `qk:CurrentOfTheAmountOfSubtance` (replaced by `qk:CurrentOfTheAmountOfSubstance`)
- `unit:CFU` (replaced by: `unit:NUM`) - The CFU (colony forming unit) is a context-dependent unit that should
be part of an ontology with narrower scope than QUDT.

## [2.1.45] - 2024-11-15

Expand Down Expand Up @@ -50,8 +110,10 @@ and this project is in the process of adopting [Semantic Versioning](https://sem
integer. This makes sense because it is not used for computation - it is a code in the true
sense. (Thanks for this fix, @fkleedorfer)
- A number of units now point to quantitykind:MassConcentration in addition to MassDensity and Density.
(thanks @J-meirlaen). (MassDensity and Density are already declared as qudt:exactMatch.
(thanks @J-meirlaen). (MassDensity and Density are already declared as qudt:exactMatch.
MassConcentration will be included in these declarations in the future.)

[Unreleased]: https://github.com/qudt/qudt-public-repo/compare/v2.1.45...HEAD
[Unreleased]: https://github.com/qudt/qudt-public-repo/compare/v2.1.46...HEAD
[2.1.46]: https://github.com/qudt/qudt-public-repo/compare/v2.1.45...v2.1.46
[2.1.45]: https://github.com/qudt/qudt-public-repo/compare/v2.1.44...v2.1.45

15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ QUDT - Quantities, Units, Dimensions and dataTypes - public repository
======================================================================

## Quick-Start Guide

There are three ways to bring the QUDT ontology into your environment.
1. Download the latest GitHub Release [here](https://github.com/qudt/qudt-public-repo/releases).
2. Use the resolved graph and instance URIs available [here](https://www.qudt.org/2.1/catalog/qudt-catalog.html).
Expand All @@ -14,7 +15,6 @@ This QUDT<sup>1</sup> public repository contains the schema and vocabulary sourc

DOI reference for citations: https://doi.org/10.25504/FAIRsharing.d3pqw7


Here is the core design pattern of the QUDT ontology:

![QUDT Triad Pattern](https://github.com/qudt/qudt-public-repo/wiki/Quantity_Triad_Pattern.png)
Expand All @@ -37,7 +37,7 @@ Installation instructions
[Installing QUDT for Contributors](https://github.com/qudt/qudt-public-repo/wiki/Installing-QUDT-for-Contributors)

Configuration instructions
-----------------------------------------
--------------------------

The QUDT ontology is provided in two forms: OWL and SHACL. By default, the vocabularies are configured to use the SHACL schema. To configure it to use the OWL schema instead, just make the following single change in the file schema/SDHEMA-FACADE_QUDT.ttl. You can see in the imports closure diagram above how all the vocabularies import this single "facade" file to make it easy to switch the ontology.

Expand Down Expand Up @@ -77,18 +77,20 @@ Change this line:
To:
# imports: http://qudt.org/2.1/collection/usertest
```

Currently, the tests in the usertest graph check for references to deprecated instances or properties and recommend the updated instance or property.

Protege Users
-----------------------------
-------------

The QUDT ontologies have been tested to load without error in Protege 5.6.4.

To load QUDT into Protege, choose "Open from URI" from the file menu, and enter http://qudt.org/2.1/vocab/unit

(The "facade" file that is resolvable on the web (http://qudt.org/2.1/schema/facade/qudt) is already configured to load the OWL schema rather than the SHACL schema, so Protege users will be in the OWL world using this method.)

Ontology libraries
-----------------------------
------------------

Please note that various libraries exhibit different behaviors when importing the QUDT ontology, see this [discussion](https://github.com/qudt/qudt-public-repo/issues/842#issuecomment-1879114604).

Expand All @@ -97,18 +99,13 @@ Status

Please see the [New Features and Releases](https://github.com/qudt/qudt-public-repo/discussions/315) topic in the Discussions section for status updates.



<hr/>
<p style="font-size:xx-small;"><sup>1</sup> QUDT.org is a 501(c)(3) not-for-profit organization founded to provide semantic specifications for units of measure, quantity kind, dimensions and data types. QUDT is an advocate for the development and implementation of standards to quantify data expressed in RDF and JSON. Our mission is to improve interoperability of data and the specification of information structures through industry standards for Units of Measure, Quantity Kinds, Dimensions and Data Types. <a href="https://github.com/sponsors/qudt">Sponsorships</a> are greatly appreciated!

QUDT.org is a member of the World Wide Web Consortium (W3C)



<hr/>


Last updated by: Steve Ray ([email protected])

Last updated: November 14, 2024
Loading

0 comments on commit 5e6c12e

Please sign in to comment.