ontoreport 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ontoreport-0.0.1/.gitattributes +3 -0
- ontoreport-0.0.1/.github/workflows/ci.yml +61 -0
- ontoreport-0.0.1/.github/workflows/release.yml +327 -0
- ontoreport-0.0.1/.gitignore +7 -0
- ontoreport-0.0.1/Cargo.lock +186 -0
- ontoreport-0.0.1/Cargo.toml +29 -0
- ontoreport-0.0.1/LICENSE +21 -0
- ontoreport-0.0.1/PKG-INFO +74 -0
- ontoreport-0.0.1/README.md +53 -0
- ontoreport-0.0.1/npm/bin/install.js +29 -0
- ontoreport-0.0.1/npm/bin/ontoreport.js +59 -0
- ontoreport-0.0.1/npm/bin/platform.js +21 -0
- ontoreport-0.0.1/npm/package.json +40 -0
- ontoreport-0.0.1/pyproject.toml +29 -0
- ontoreport-0.0.1/scripts/npm-bootstrap.ps1 +67 -0
- ontoreport-0.0.1/scripts/npm-bootstrap.sh +56 -0
- ontoreport-0.0.1/src/lib.rs +16 -0
- ontoreport-0.0.1/src/main.rs +22 -0
- ontoreport-0.0.1/tests/cli.rs +20 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
RUST_BACKTRACE: 1
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Test (${{ matrix.os }})
|
|
16
|
+
runs-on: ${{ matrix.os }}
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Install Rust toolchain
|
|
25
|
+
uses: dtolnay/rust-toolchain@stable
|
|
26
|
+
with:
|
|
27
|
+
components: rustfmt, clippy
|
|
28
|
+
|
|
29
|
+
- name: Cache Cargo registry and build
|
|
30
|
+
uses: actions/cache@v4
|
|
31
|
+
with:
|
|
32
|
+
path: |
|
|
33
|
+
~/.cargo/registry
|
|
34
|
+
~/.cargo/git
|
|
35
|
+
target
|
|
36
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
37
|
+
restore-keys: ${{ runner.os }}-cargo-
|
|
38
|
+
|
|
39
|
+
- name: Check formatting
|
|
40
|
+
run: cargo fmt --all -- --check
|
|
41
|
+
|
|
42
|
+
- name: Clippy
|
|
43
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
44
|
+
|
|
45
|
+
- name: Run tests
|
|
46
|
+
run: cargo test --all
|
|
47
|
+
|
|
48
|
+
wheel:
|
|
49
|
+
name: Python wheel builds
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- name: Build wheel
|
|
54
|
+
uses: PyO3/maturin-action@v1
|
|
55
|
+
with:
|
|
56
|
+
command: build
|
|
57
|
+
args: --release --out dist
|
|
58
|
+
- name: Install and run the wheel
|
|
59
|
+
run: |
|
|
60
|
+
python -m pip install dist/*.whl
|
|
61
|
+
ontoreport --version
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v[0-9]*.[0-9]*.[0-9]*"
|
|
7
|
+
# Build everything without publishing (used once to bootstrap the npm packages
|
|
8
|
+
# before trusted publishing can be attached; see scripts/npm-bootstrap.sh).
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
version:
|
|
12
|
+
description: "Version to build, e.g. 0.0.1"
|
|
13
|
+
required: true
|
|
14
|
+
|
|
15
|
+
env:
|
|
16
|
+
CARGO_TERM_COLOR: always
|
|
17
|
+
PLATFORMS: linux-x64 linux-arm64 darwin-x64 darwin-arm64 win32-x64 win32-arm64
|
|
18
|
+
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
# ── 1. Native binaries for npm ──────────────────────────────────────────────
|
|
24
|
+
# While the repository is private, every target is built on x64 runners
|
|
25
|
+
# (arm64 hosted runners are not available to private repositories on the
|
|
26
|
+
# free plan): Linux arm64 through cargo-zigbuild, macOS x64 from the arm64
|
|
27
|
+
# runner, Windows arm64 with the MSVC ARM64 tools on the x64 runner.
|
|
28
|
+
build:
|
|
29
|
+
name: Build ${{ matrix.target }}
|
|
30
|
+
runs-on: ${{ matrix.runner }}
|
|
31
|
+
strategy:
|
|
32
|
+
fail-fast: false
|
|
33
|
+
matrix:
|
|
34
|
+
include:
|
|
35
|
+
- { target: x86_64-unknown-linux-gnu, runner: ubuntu-latest, npm_platform: linux-x64, binary: ontoreport, zig: false }
|
|
36
|
+
- { target: aarch64-unknown-linux-gnu, runner: ubuntu-latest, npm_platform: linux-arm64, binary: ontoreport, zig: true }
|
|
37
|
+
- { target: x86_64-apple-darwin, runner: macos-latest, npm_platform: darwin-x64, binary: ontoreport, zig: false }
|
|
38
|
+
- { target: aarch64-apple-darwin, runner: macos-latest, npm_platform: darwin-arm64, binary: ontoreport, zig: false }
|
|
39
|
+
- { target: x86_64-pc-windows-msvc, runner: windows-latest, npm_platform: win32-x64, binary: ontoreport.exe, zig: false }
|
|
40
|
+
- { target: aarch64-pc-windows-msvc, runner: windows-latest, npm_platform: win32-arm64, binary: ontoreport.exe, zig: false }
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- name: Install Rust toolchain
|
|
45
|
+
uses: dtolnay/rust-toolchain@stable
|
|
46
|
+
with:
|
|
47
|
+
targets: ${{ matrix.target }}
|
|
48
|
+
|
|
49
|
+
- name: Cache Cargo registry and build
|
|
50
|
+
uses: actions/cache@v4
|
|
51
|
+
with:
|
|
52
|
+
path: |
|
|
53
|
+
~/.cargo/registry
|
|
54
|
+
~/.cargo/git
|
|
55
|
+
target
|
|
56
|
+
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
57
|
+
restore-keys: ${{ runner.os }}-${{ matrix.target }}-cargo-
|
|
58
|
+
|
|
59
|
+
- name: Set Cargo.toml version
|
|
60
|
+
shell: bash
|
|
61
|
+
env:
|
|
62
|
+
INPUT_VERSION: ${{ inputs.version }}
|
|
63
|
+
run: |
|
|
64
|
+
VERSION="${INPUT_VERSION:-${GITHUB_REF_NAME#v}}"
|
|
65
|
+
sed -i.bak "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
|
|
66
|
+
rm -f Cargo.toml.bak
|
|
67
|
+
|
|
68
|
+
- name: Build
|
|
69
|
+
if: ${{ !matrix.zig }}
|
|
70
|
+
run: cargo build --release --target ${{ matrix.target }}
|
|
71
|
+
|
|
72
|
+
- name: Build (cargo-zigbuild)
|
|
73
|
+
if: ${{ matrix.zig }}
|
|
74
|
+
run: |
|
|
75
|
+
python3 -m pip install --user ziglang cargo-zigbuild
|
|
76
|
+
cargo zigbuild --release --target ${{ matrix.target }}
|
|
77
|
+
|
|
78
|
+
- name: Stage binary
|
|
79
|
+
shell: bash
|
|
80
|
+
run: |
|
|
81
|
+
mkdir -p staging
|
|
82
|
+
cp target/${{ matrix.target }}/release/${{ matrix.binary }} staging/
|
|
83
|
+
|
|
84
|
+
- name: Upload binary artifact
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: binary-${{ matrix.npm_platform }}
|
|
88
|
+
path: staging/${{ matrix.binary }}
|
|
89
|
+
if-no-files-found: error
|
|
90
|
+
|
|
91
|
+
# ── 2. Assemble npm packages (tarballs keep the executable bit) ─────────────
|
|
92
|
+
# Platform packages live in the @ontoreport org (npm's spam filter blocks
|
|
93
|
+
# new unscoped "*-win32-x64" names); `npm pack` names them ontoreport-ontoreport-<platform>-<v>.tgz.
|
|
94
|
+
package-npm:
|
|
95
|
+
name: Package (npm)
|
|
96
|
+
needs: build
|
|
97
|
+
runs-on: ubuntu-latest
|
|
98
|
+
outputs:
|
|
99
|
+
version: ${{ steps.version.outputs.VERSION }}
|
|
100
|
+
steps:
|
|
101
|
+
- uses: actions/checkout@v4
|
|
102
|
+
|
|
103
|
+
- uses: actions/setup-node@v4
|
|
104
|
+
with:
|
|
105
|
+
node-version: "24"
|
|
106
|
+
|
|
107
|
+
- name: Derive version
|
|
108
|
+
id: version
|
|
109
|
+
env:
|
|
110
|
+
INPUT_VERSION: ${{ inputs.version }}
|
|
111
|
+
run: echo "VERSION=${INPUT_VERSION:-${GITHUB_REF_NAME#v}}" >> "$GITHUB_OUTPUT"
|
|
112
|
+
|
|
113
|
+
- name: Download all binary artifacts
|
|
114
|
+
uses: actions/download-artifact@v4
|
|
115
|
+
with:
|
|
116
|
+
pattern: binary-*
|
|
117
|
+
path: artifacts
|
|
118
|
+
|
|
119
|
+
- name: Build platform and main packages
|
|
120
|
+
shell: bash
|
|
121
|
+
env:
|
|
122
|
+
VERSION: ${{ steps.version.outputs.VERSION }}
|
|
123
|
+
run: |
|
|
124
|
+
set -euo pipefail
|
|
125
|
+
mkdir -p dist
|
|
126
|
+
for PLATFORM in $PLATFORMS; do
|
|
127
|
+
OS="${PLATFORM%-*}"; CPU="${PLATFORM#*-}"
|
|
128
|
+
BINARY="ontoreport"; [ "$OS" = "win32" ] && BINARY="ontoreport.exe"
|
|
129
|
+
DIR="pkg/ontoreport-${PLATFORM}"
|
|
130
|
+
mkdir -p "$DIR/bin"
|
|
131
|
+
cp "artifacts/binary-${PLATFORM}/${BINARY}" "$DIR/bin/${BINARY}"
|
|
132
|
+
chmod 755 "$DIR/bin/${BINARY}"
|
|
133
|
+
cat > "$DIR/package.json" <<PKGJSON
|
|
134
|
+
{
|
|
135
|
+
"name": "@ontoreport/ontoreport-${PLATFORM}",
|
|
136
|
+
"version": "${VERSION}",
|
|
137
|
+
"description": "ontoreport native binary for ${OS}/${CPU}",
|
|
138
|
+
"os": ["${OS}"],
|
|
139
|
+
"cpu": ["${CPU}"],
|
|
140
|
+
"license": "MIT",
|
|
141
|
+
"files": ["bin"],
|
|
142
|
+
"repository": { "type": "git", "url": "https://github.com/Minitour/ontoreport.git" }
|
|
143
|
+
}
|
|
144
|
+
PKGJSON
|
|
145
|
+
(cd dist && npm pack "../$DIR")
|
|
146
|
+
done
|
|
147
|
+
|
|
148
|
+
cp README.md npm/README.md
|
|
149
|
+
node -e "
|
|
150
|
+
const fs = require('fs');
|
|
151
|
+
const pkg = JSON.parse(fs.readFileSync('npm/package.json', 'utf8'));
|
|
152
|
+
pkg.version = process.env.VERSION;
|
|
153
|
+
for (const k of Object.keys(pkg.optionalDependencies || {})) pkg.optionalDependencies[k] = process.env.VERSION;
|
|
154
|
+
fs.writeFileSync('npm/package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
155
|
+
"
|
|
156
|
+
(cd dist && npm pack ../npm)
|
|
157
|
+
ls -la dist
|
|
158
|
+
|
|
159
|
+
- name: Upload npm packages
|
|
160
|
+
uses: actions/upload-artifact@v4
|
|
161
|
+
with:
|
|
162
|
+
name: npm-packages
|
|
163
|
+
path: dist/*.tgz
|
|
164
|
+
if-no-files-found: error
|
|
165
|
+
|
|
166
|
+
# ── 3. Python wheels (the binary packaged with maturin, bindings = "bin") ───
|
|
167
|
+
wheels:
|
|
168
|
+
name: Wheel ${{ matrix.target }}
|
|
169
|
+
runs-on: ${{ matrix.runner }}
|
|
170
|
+
strategy:
|
|
171
|
+
fail-fast: false
|
|
172
|
+
matrix:
|
|
173
|
+
include:
|
|
174
|
+
- { runner: ubuntu-latest, target: x86_64, manylinux: auto }
|
|
175
|
+
- { runner: ubuntu-latest, target: aarch64, manylinux: auto }
|
|
176
|
+
- { runner: macos-latest, target: x86_64, manylinux: "" }
|
|
177
|
+
- { runner: macos-latest, target: aarch64, manylinux: "" }
|
|
178
|
+
- { runner: windows-latest, target: x64, manylinux: "" }
|
|
179
|
+
- { runner: windows-latest, target: aarch64, manylinux: "" }
|
|
180
|
+
steps:
|
|
181
|
+
- uses: actions/checkout@v4
|
|
182
|
+
|
|
183
|
+
- name: Set Cargo.toml version
|
|
184
|
+
shell: bash
|
|
185
|
+
env:
|
|
186
|
+
INPUT_VERSION: ${{ inputs.version }}
|
|
187
|
+
run: |
|
|
188
|
+
VERSION="${INPUT_VERSION:-${GITHUB_REF_NAME#v}}"
|
|
189
|
+
sed -i.bak "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
|
|
190
|
+
rm -f Cargo.toml.bak
|
|
191
|
+
|
|
192
|
+
- name: Build wheel
|
|
193
|
+
uses: PyO3/maturin-action@v1
|
|
194
|
+
with:
|
|
195
|
+
target: ${{ matrix.target }}
|
|
196
|
+
manylinux: ${{ matrix.manylinux }}
|
|
197
|
+
args: --release --out dist
|
|
198
|
+
|
|
199
|
+
- name: Upload wheel
|
|
200
|
+
uses: actions/upload-artifact@v4
|
|
201
|
+
with:
|
|
202
|
+
name: wheels-${{ runner.os }}-${{ matrix.target }}
|
|
203
|
+
path: dist/*.whl
|
|
204
|
+
if-no-files-found: error
|
|
205
|
+
|
|
206
|
+
sdist:
|
|
207
|
+
name: Source distribution
|
|
208
|
+
runs-on: ubuntu-latest
|
|
209
|
+
steps:
|
|
210
|
+
- uses: actions/checkout@v4
|
|
211
|
+
|
|
212
|
+
- name: Set Cargo.toml version
|
|
213
|
+
shell: bash
|
|
214
|
+
env:
|
|
215
|
+
INPUT_VERSION: ${{ inputs.version }}
|
|
216
|
+
run: |
|
|
217
|
+
VERSION="${INPUT_VERSION:-${GITHUB_REF_NAME#v}}"
|
|
218
|
+
sed -i.bak "s/^version = \".*\"/version = \"${VERSION}\"/" Cargo.toml
|
|
219
|
+
rm -f Cargo.toml.bak
|
|
220
|
+
|
|
221
|
+
- name: Build sdist
|
|
222
|
+
uses: PyO3/maturin-action@v1
|
|
223
|
+
with:
|
|
224
|
+
command: sdist
|
|
225
|
+
args: --out dist
|
|
226
|
+
|
|
227
|
+
- name: Upload sdist
|
|
228
|
+
uses: actions/upload-artifact@v4
|
|
229
|
+
with:
|
|
230
|
+
name: wheels-sdist
|
|
231
|
+
path: dist/*.tar.gz
|
|
232
|
+
if-no-files-found: error
|
|
233
|
+
|
|
234
|
+
# ── 4. Publish to npm via trusted publishing (no npm token anywhere) ────────
|
|
235
|
+
publish-npm:
|
|
236
|
+
name: Publish (npm)
|
|
237
|
+
needs: package-npm
|
|
238
|
+
if: github.event_name == 'push'
|
|
239
|
+
runs-on: ubuntu-latest
|
|
240
|
+
permissions:
|
|
241
|
+
id-token: write # npm trusted publishing (OIDC)
|
|
242
|
+
steps:
|
|
243
|
+
- uses: actions/setup-node@v4
|
|
244
|
+
with:
|
|
245
|
+
node-version: "24"
|
|
246
|
+
registry-url: "https://registry.npmjs.org"
|
|
247
|
+
|
|
248
|
+
# trusted publishing needs npm >= 11.5.1 (pinned to 11: npm 12 needs a newer Node)
|
|
249
|
+
- name: Update npm
|
|
250
|
+
run: npm install -g "npm@^11.15.0"
|
|
251
|
+
|
|
252
|
+
- name: Download npm packages
|
|
253
|
+
uses: actions/download-artifact@v4
|
|
254
|
+
with:
|
|
255
|
+
name: npm-packages
|
|
256
|
+
path: dist
|
|
257
|
+
|
|
258
|
+
- name: Publish (platform packages first, then ontoreport)
|
|
259
|
+
shell: bash
|
|
260
|
+
env:
|
|
261
|
+
VERSION: ${{ needs.package-npm.outputs.version }}
|
|
262
|
+
run: |
|
|
263
|
+
set -euo pipefail
|
|
264
|
+
# no token: npm authenticates with the GitHub OIDC identity
|
|
265
|
+
unset NODE_AUTH_TOKEN || true
|
|
266
|
+
publish() {
|
|
267
|
+
set +e
|
|
268
|
+
OUTPUT=$(npm publish "$1" --access public 2>&1); CODE=$?
|
|
269
|
+
set -e
|
|
270
|
+
if [ $CODE -ne 0 ]; then
|
|
271
|
+
if echo "$OUTPUT" | grep -qi "previously published"; then
|
|
272
|
+
echo "skip $1 (already published)"
|
|
273
|
+
else
|
|
274
|
+
echo "$OUTPUT" >&2; exit $CODE
|
|
275
|
+
fi
|
|
276
|
+
else
|
|
277
|
+
echo "$OUTPUT"
|
|
278
|
+
fi
|
|
279
|
+
}
|
|
280
|
+
for PLATFORM in $PLATFORMS; do
|
|
281
|
+
publish "./dist/ontoreport-ontoreport-${PLATFORM}-${VERSION}.tgz"
|
|
282
|
+
done
|
|
283
|
+
publish "./dist/ontoreport-${VERSION}.tgz"
|
|
284
|
+
|
|
285
|
+
# ── 5. Publish to PyPI via a trusted publisher (no PyPI token anywhere) ─────
|
|
286
|
+
# Needs a (pending) trusted publisher on pypi.org: project "ontoreport",
|
|
287
|
+
# owner Minitour, repository ontoreport, workflow release.yml, environment pypi.
|
|
288
|
+
publish-pypi:
|
|
289
|
+
name: Publish (PyPI)
|
|
290
|
+
needs: [wheels, sdist]
|
|
291
|
+
if: github.event_name == 'push'
|
|
292
|
+
runs-on: ubuntu-latest
|
|
293
|
+
environment:
|
|
294
|
+
name: pypi
|
|
295
|
+
url: https://pypi.org/p/ontoreport
|
|
296
|
+
permissions:
|
|
297
|
+
id-token: write # PyPI trusted publishing (OIDC)
|
|
298
|
+
steps:
|
|
299
|
+
- name: Download wheels and sdist
|
|
300
|
+
uses: actions/download-artifact@v4
|
|
301
|
+
with:
|
|
302
|
+
pattern: wheels-*
|
|
303
|
+
path: dist
|
|
304
|
+
merge-multiple: true
|
|
305
|
+
|
|
306
|
+
- name: Publish
|
|
307
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
308
|
+
with:
|
|
309
|
+
# Digital attestations publish the repository identity to a public
|
|
310
|
+
# transparency log; switch this on when the repository goes public.
|
|
311
|
+
attestations: false
|
|
312
|
+
skip-existing: true
|
|
313
|
+
|
|
314
|
+
# ── 6. GitHub release ───────────────────────────────────────────────────────
|
|
315
|
+
release:
|
|
316
|
+
name: GitHub release
|
|
317
|
+
needs: [package-npm, publish-npm, publish-pypi]
|
|
318
|
+
if: github.event_name == 'push'
|
|
319
|
+
runs-on: ubuntu-latest
|
|
320
|
+
permissions:
|
|
321
|
+
contents: write
|
|
322
|
+
steps:
|
|
323
|
+
- name: Create GitHub Release
|
|
324
|
+
uses: softprops/action-gh-release@v2
|
|
325
|
+
with:
|
|
326
|
+
name: "v${{ needs.package-npm.outputs.version }}"
|
|
327
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "anstream"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"anstyle",
|
|
12
|
+
"anstyle-parse",
|
|
13
|
+
"anstyle-query",
|
|
14
|
+
"anstyle-wincon",
|
|
15
|
+
"colorchoice",
|
|
16
|
+
"is_terminal_polyfill",
|
|
17
|
+
"utf8parse",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[[package]]
|
|
21
|
+
name = "anstyle"
|
|
22
|
+
version = "1.0.14"
|
|
23
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
+
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
|
|
25
|
+
|
|
26
|
+
[[package]]
|
|
27
|
+
name = "anstyle-parse"
|
|
28
|
+
version = "1.0.0"
|
|
29
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
30
|
+
checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
|
|
31
|
+
dependencies = [
|
|
32
|
+
"utf8parse",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "anstyle-query"
|
|
37
|
+
version = "1.1.5"
|
|
38
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
+
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
|
|
40
|
+
dependencies = [
|
|
41
|
+
"windows-sys",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[[package]]
|
|
45
|
+
name = "anstyle-wincon"
|
|
46
|
+
version = "3.0.11"
|
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
+
checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
|
|
49
|
+
dependencies = [
|
|
50
|
+
"anstyle",
|
|
51
|
+
"once_cell_polyfill",
|
|
52
|
+
"windows-sys",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[[package]]
|
|
56
|
+
name = "clap"
|
|
57
|
+
version = "4.6.7"
|
|
58
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
59
|
+
checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"
|
|
60
|
+
dependencies = [
|
|
61
|
+
"clap_builder",
|
|
62
|
+
"clap_derive",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[[package]]
|
|
66
|
+
name = "clap_builder"
|
|
67
|
+
version = "4.6.7"
|
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
69
|
+
checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"
|
|
70
|
+
dependencies = [
|
|
71
|
+
"anstream",
|
|
72
|
+
"anstyle",
|
|
73
|
+
"clap_lex",
|
|
74
|
+
"strsim",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[[package]]
|
|
78
|
+
name = "clap_derive"
|
|
79
|
+
version = "4.6.7"
|
|
80
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
81
|
+
checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0"
|
|
82
|
+
dependencies = [
|
|
83
|
+
"heck",
|
|
84
|
+
"proc-macro2",
|
|
85
|
+
"quote",
|
|
86
|
+
"syn",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[[package]]
|
|
90
|
+
name = "clap_lex"
|
|
91
|
+
version = "1.1.1"
|
|
92
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
+
checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"
|
|
94
|
+
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "colorchoice"
|
|
97
|
+
version = "1.0.5"
|
|
98
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
+
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
100
|
+
|
|
101
|
+
[[package]]
|
|
102
|
+
name = "heck"
|
|
103
|
+
version = "0.5.0"
|
|
104
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
105
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
106
|
+
|
|
107
|
+
[[package]]
|
|
108
|
+
name = "is_terminal_polyfill"
|
|
109
|
+
version = "1.70.2"
|
|
110
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
111
|
+
checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
|
|
112
|
+
|
|
113
|
+
[[package]]
|
|
114
|
+
name = "once_cell_polyfill"
|
|
115
|
+
version = "1.70.2"
|
|
116
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
117
|
+
checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
|
|
118
|
+
|
|
119
|
+
[[package]]
|
|
120
|
+
name = "ontoreport"
|
|
121
|
+
version = "0.0.1"
|
|
122
|
+
dependencies = [
|
|
123
|
+
"clap",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "proc-macro2"
|
|
128
|
+
version = "1.0.107"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"unicode-ident",
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
[[package]]
|
|
136
|
+
name = "quote"
|
|
137
|
+
version = "1.0.47"
|
|
138
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
139
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
140
|
+
dependencies = [
|
|
141
|
+
"proc-macro2",
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
[[package]]
|
|
145
|
+
name = "strsim"
|
|
146
|
+
version = "0.11.1"
|
|
147
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
148
|
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
|
149
|
+
|
|
150
|
+
[[package]]
|
|
151
|
+
name = "syn"
|
|
152
|
+
version = "3.0.9"
|
|
153
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
154
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
155
|
+
dependencies = [
|
|
156
|
+
"proc-macro2",
|
|
157
|
+
"quote",
|
|
158
|
+
"unicode-ident",
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
[[package]]
|
|
162
|
+
name = "unicode-ident"
|
|
163
|
+
version = "1.0.27"
|
|
164
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
165
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
|
166
|
+
|
|
167
|
+
[[package]]
|
|
168
|
+
name = "utf8parse"
|
|
169
|
+
version = "0.2.2"
|
|
170
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
171
|
+
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|
172
|
+
|
|
173
|
+
[[package]]
|
|
174
|
+
name = "windows-link"
|
|
175
|
+
version = "0.2.1"
|
|
176
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
177
|
+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
178
|
+
|
|
179
|
+
[[package]]
|
|
180
|
+
name = "windows-sys"
|
|
181
|
+
version = "0.61.2"
|
|
182
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
183
|
+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
|
184
|
+
dependencies = [
|
|
185
|
+
"windows-link",
|
|
186
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "ontoreport"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
rust-version = "1.88"
|
|
6
|
+
description = "Quality report for OWL ontologies built from the project record: structure, reuse fidelity, traceability, provenance, requirements and review status"
|
|
7
|
+
authors = ["Antonio Zaitoun <antonio@zaitoun.dev>"]
|
|
8
|
+
license = "MIT"
|
|
9
|
+
repository = "https://github.com/Minitour/ontoreport"
|
|
10
|
+
homepage = "https://github.com/Minitour/ontoreport"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
keywords = ["ontology", "owl", "evaluation", "quality", "report"]
|
|
13
|
+
categories = ["command-line-utilities", "science"]
|
|
14
|
+
|
|
15
|
+
[[bin]]
|
|
16
|
+
name = "ontoreport"
|
|
17
|
+
path = "src/main.rs"
|
|
18
|
+
|
|
19
|
+
[lib]
|
|
20
|
+
name = "ontoreport"
|
|
21
|
+
path = "src/lib.rs"
|
|
22
|
+
|
|
23
|
+
[dependencies]
|
|
24
|
+
clap = { version = "4", features = ["derive"] }
|
|
25
|
+
|
|
26
|
+
[profile.release]
|
|
27
|
+
lto = true
|
|
28
|
+
codegen-units = 1
|
|
29
|
+
strip = true
|
ontoreport-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Antonio Zaitoun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ontoreport
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Classifier: Development Status :: 1 - Planning
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Science/Research
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Programming Language :: Rust
|
|
9
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Summary: Quality report for OWL ontologies built from the project record
|
|
12
|
+
Keywords: ontology,owl,evaluation,quality,report
|
|
13
|
+
Home-Page: https://github.com/Minitour/ontoreport
|
|
14
|
+
Author-email: Antonio Zaitoun <antonio@zaitoun.dev>
|
|
15
|
+
License: MIT
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
18
|
+
Project-URL: Homepage, https://github.com/Minitour/ontoreport
|
|
19
|
+
Project-URL: Repository, https://github.com/Minitour/ontoreport
|
|
20
|
+
|
|
21
|
+
# ontoreport
|
|
22
|
+
|
|
23
|
+
[](https://github.com/Minitour/ontoreport/actions/workflows/ci.yml)
|
|
24
|
+
[](https://opensource.org/licenses/MIT)
|
|
25
|
+
|
|
26
|
+
A quality report for OWL ontologies that reads the **project record** as well as the ontology:
|
|
27
|
+
whether every term traces to a requirement, every definition to a cited source, every reused term
|
|
28
|
+
to its source release, and how much of the ontology has been reviewed. One native binary per
|
|
29
|
+
platform, written in Rust, distributed on npm and PyPI.
|
|
30
|
+
|
|
31
|
+
> **Status: placeholder release.** Versions 0.0.x reserve the package names. The report is under
|
|
32
|
+
> development; running it prints a notice and exits with code 2.
|
|
33
|
+
|
|
34
|
+
## Planned sections
|
|
35
|
+
|
|
36
|
+
| Section | What it reports |
|
|
37
|
+
|---|---|
|
|
38
|
+
| Structure | Consistency, unsatisfiable classes, pitfalls with their recorded decisions, classes without a path to the top class |
|
|
39
|
+
| Reuse fidelity | Reused identifiers that are missing, deprecated or obsolete; labels and definitions that differ from the source release; exact matches that are not exact |
|
|
40
|
+
| Traceability | Terms with no competency question, use case or goal; planned-answer terms missing from the ontology |
|
|
41
|
+
| Provenance | Definitions without a cited source or locator; sources missing from the bibliography; identifiers that do not resolve |
|
|
42
|
+
| Requirements coverage | Competency questions per module; modules without questions; questions answered by SPARQL |
|
|
43
|
+
| Review status | Statements approved, debatable, removed or not yet reviewed |
|
|
44
|
+
| Corpus fit (optional) | Domain coverage, relevance and concept-family coherence against a domain corpus |
|
|
45
|
+
|
|
46
|
+
The report is deterministic: the same project gives the same findings. It is written twice, as a
|
|
47
|
+
self-contained HTML page for people and as JSON for agents.
|
|
48
|
+
|
|
49
|
+
## Install
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx ontoreport --version
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pipx run ontoreport --version
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or build from source:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cargo install --git https://github.com/Minitour/ontoreport
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Releasing
|
|
66
|
+
|
|
67
|
+
Releases are published by `.github/workflows/release.yml` from a version tag, with no stored
|
|
68
|
+
tokens: npm through trusted publishing (GitHub OIDC) and PyPI through a trusted publisher. The
|
|
69
|
+
first npm version has to be published once by hand; see `scripts/npm-bootstrap.sh`.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
|
74
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ontoreport
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Minitour/ontoreport/actions/workflows/ci.yml)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
A quality report for OWL ontologies that reads the **project record** as well as the ontology:
|
|
7
|
+
whether every term traces to a requirement, every definition to a cited source, every reused term
|
|
8
|
+
to its source release, and how much of the ontology has been reviewed. One native binary per
|
|
9
|
+
platform, written in Rust, distributed on npm and PyPI.
|
|
10
|
+
|
|
11
|
+
> **Status: placeholder release.** Versions 0.0.x reserve the package names. The report is under
|
|
12
|
+
> development; running it prints a notice and exits with code 2.
|
|
13
|
+
|
|
14
|
+
## Planned sections
|
|
15
|
+
|
|
16
|
+
| Section | What it reports |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Structure | Consistency, unsatisfiable classes, pitfalls with their recorded decisions, classes without a path to the top class |
|
|
19
|
+
| Reuse fidelity | Reused identifiers that are missing, deprecated or obsolete; labels and definitions that differ from the source release; exact matches that are not exact |
|
|
20
|
+
| Traceability | Terms with no competency question, use case or goal; planned-answer terms missing from the ontology |
|
|
21
|
+
| Provenance | Definitions without a cited source or locator; sources missing from the bibliography; identifiers that do not resolve |
|
|
22
|
+
| Requirements coverage | Competency questions per module; modules without questions; questions answered by SPARQL |
|
|
23
|
+
| Review status | Statements approved, debatable, removed or not yet reviewed |
|
|
24
|
+
| Corpus fit (optional) | Domain coverage, relevance and concept-family coherence against a domain corpus |
|
|
25
|
+
|
|
26
|
+
The report is deterministic: the same project gives the same findings. It is written twice, as a
|
|
27
|
+
self-contained HTML page for people and as JSON for agents.
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx ontoreport --version
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pipx run ontoreport --version
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Or build from source:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
cargo install --git https://github.com/Minitour/ontoreport
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Releasing
|
|
46
|
+
|
|
47
|
+
Releases are published by `.github/workflows/release.yml` from a version tag, with no stored
|
|
48
|
+
tokens: npm through trusted publishing (GitHub OIDC) and PyPI through a trusted publisher. The
|
|
49
|
+
first npm version has to be published once by hand; see `scripts/npm-bootstrap.sh`.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Postinstall check: verifies that the platform binary was installed. Never fails
|
|
4
|
+
* the install (unsupported platforms can still build from source).
|
|
5
|
+
*/
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const { BINARY_NAME, platformKey, packageName } = require("./platform");
|
|
9
|
+
|
|
10
|
+
if (!packageName) {
|
|
11
|
+
console.warn(
|
|
12
|
+
`ontoreport: platform '${platformKey}' is not officially supported.\n` +
|
|
13
|
+
"Build from source: cargo install --git https://github.com/Minitour/ontoreport"
|
|
14
|
+
);
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
const pkgDir = path.dirname(require.resolve(`${packageName}/package.json`));
|
|
20
|
+
const candidate = path.join(pkgDir, "bin", BINARY_NAME);
|
|
21
|
+
if (!fs.existsSync(candidate)) {
|
|
22
|
+
console.warn(`ontoreport: optional package found but binary missing at ${candidate}`);
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
console.warn(
|
|
26
|
+
`ontoreport: platform package '${packageName}' was not installed (optional).\n` +
|
|
27
|
+
"Reinstall without --no-optional, or build from source."
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Entry point for `npx ontoreport` / `ontoreport`.
|
|
4
|
+
* Resolves the platform-specific native binary (optionalDependencies), falling
|
|
5
|
+
* back to a locally built binary, and runs it with the same arguments and stdio.
|
|
6
|
+
*/
|
|
7
|
+
const { spawnSync } = require("child_process");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const { BINARY_NAME, platformKey, packageName } = require("./platform");
|
|
11
|
+
|
|
12
|
+
function resolveBinary() {
|
|
13
|
+
if (process.env.ONTOREPORT_BINARY && fs.existsSync(process.env.ONTOREPORT_BINARY)) {
|
|
14
|
+
return process.env.ONTOREPORT_BINARY;
|
|
15
|
+
}
|
|
16
|
+
if (packageName) {
|
|
17
|
+
try {
|
|
18
|
+
const pkgDir = path.dirname(require.resolve(`${packageName}/package.json`));
|
|
19
|
+
const candidate = path.join(pkgDir, "bin", BINARY_NAME);
|
|
20
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
21
|
+
} catch {
|
|
22
|
+
// optional package not installed
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
for (const profile of ["release", "debug"]) {
|
|
26
|
+
const candidate = path.join(__dirname, "..", "..", "target", profile, BINARY_NAME);
|
|
27
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const binary = resolveBinary();
|
|
33
|
+
if (!binary) {
|
|
34
|
+
console.error(
|
|
35
|
+
`ontoreport: no pre-built binary found for platform '${platformKey}'.\n` +
|
|
36
|
+
"Build from source: cargo install --git https://github.com/Minitour/ontoreport"
|
|
37
|
+
);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Ensure the native binary is executable (some unpackers drop the mode bits).
|
|
42
|
+
if (process.platform !== "win32") {
|
|
43
|
+
try {
|
|
44
|
+
fs.accessSync(binary, fs.constants.X_OK);
|
|
45
|
+
} catch {
|
|
46
|
+
try {
|
|
47
|
+
fs.chmodSync(binary, 0o755);
|
|
48
|
+
} catch {
|
|
49
|
+
// fall through; spawn will report the error
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit", env: process.env });
|
|
55
|
+
if (result.error) {
|
|
56
|
+
console.error("ontoreport: failed to start:", result.error.message);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
process.exit(result.status ?? 0);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared platform -> package resolution for the launcher and the postinstall check.
|
|
3
|
+
*/
|
|
4
|
+
const PLATFORM_PACKAGES = {
|
|
5
|
+
"linux-x64": "@ontoreport/ontoreport-linux-x64",
|
|
6
|
+
"linux-arm64": "@ontoreport/ontoreport-linux-arm64",
|
|
7
|
+
"darwin-x64": "@ontoreport/ontoreport-darwin-x64",
|
|
8
|
+
"darwin-arm64": "@ontoreport/ontoreport-darwin-arm64",
|
|
9
|
+
"win32-x64": "@ontoreport/ontoreport-win32-x64",
|
|
10
|
+
"win32-arm64": "@ontoreport/ontoreport-win32-arm64",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const BINARY_NAME = process.platform === "win32" ? "ontoreport.exe" : "ontoreport";
|
|
14
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
15
|
+
|
|
16
|
+
module.exports = {
|
|
17
|
+
PLATFORM_PACKAGES,
|
|
18
|
+
BINARY_NAME,
|
|
19
|
+
platformKey,
|
|
20
|
+
packageName: PLATFORM_PACKAGES[platformKey],
|
|
21
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ontoreport",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Quality report for OWL ontologies built from the project record",
|
|
5
|
+
"homepage": "https://github.com/Minitour/ontoreport",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/Minitour/ontoreport.git"
|
|
9
|
+
},
|
|
10
|
+
"author": "Antonio Zaitoun <antonio@zaitoun.dev>",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"ontology",
|
|
14
|
+
"owl",
|
|
15
|
+
"ontology-evaluation",
|
|
16
|
+
"quality",
|
|
17
|
+
"report"
|
|
18
|
+
],
|
|
19
|
+
"files": [
|
|
20
|
+
"bin",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"ontoreport": "./bin/ontoreport.js"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"postinstall": "node ./bin/install.js"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"@ontoreport/ontoreport-linux-x64": "0.0.1",
|
|
31
|
+
"@ontoreport/ontoreport-linux-arm64": "0.0.1",
|
|
32
|
+
"@ontoreport/ontoreport-darwin-x64": "0.0.1",
|
|
33
|
+
"@ontoreport/ontoreport-darwin-arm64": "0.0.1",
|
|
34
|
+
"@ontoreport/ontoreport-win32-x64": "0.0.1",
|
|
35
|
+
"@ontoreport/ontoreport-win32-arm64": "0.0.1"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.5,<2"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ontoreport"
|
|
7
|
+
description = "Quality report for OWL ontologies built from the project record"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.8"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [{ name = "Antonio Zaitoun", email = "antonio@zaitoun.dev" }]
|
|
12
|
+
keywords = ["ontology", "owl", "evaluation", "quality", "report"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 1 - Planning",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Rust",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
20
|
+
]
|
|
21
|
+
dynamic = ["version"]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://github.com/Minitour/ontoreport"
|
|
25
|
+
Repository = "https://github.com/Minitour/ontoreport"
|
|
26
|
+
|
|
27
|
+
[tool.maturin]
|
|
28
|
+
bindings = "bin"
|
|
29
|
+
strip = true
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# One-time npm bootstrap for Windows PowerShell (same steps as npm-bootstrap.sh).
|
|
2
|
+
#
|
|
3
|
+
# npm only lets you attach a trusted publisher (GitHub OIDC) to a package that
|
|
4
|
+
# already exists, so the very first version is published from YOUR npm session
|
|
5
|
+
# (`npm login`: browser + 2FA, no long-lived token). After that every release is
|
|
6
|
+
# published by .github/workflows/release.yml through OIDC; no npm token is stored.
|
|
7
|
+
#
|
|
8
|
+
# Usage (from anywhere):
|
|
9
|
+
# powershell -ExecutionPolicy Bypass -File <repo>\scripts\npm-bootstrap.ps1 <release-run-id>
|
|
10
|
+
param(
|
|
11
|
+
[Parameter(Mandatory = $true)][string]$RunId
|
|
12
|
+
)
|
|
13
|
+
# 'Continue': in Windows PowerShell 5.1 'Stop' turns any stderr output of native
|
|
14
|
+
# commands (npm prints notices there) into a terminating error. Failures are
|
|
15
|
+
# detected through $LASTEXITCODE instead (Invoke-Checked).
|
|
16
|
+
$ErrorActionPreference = 'Continue'
|
|
17
|
+
|
|
18
|
+
$Repo = 'Minitour/ontoreport'
|
|
19
|
+
$Workflow = 'release.yml'
|
|
20
|
+
$Platforms = 'linux-x64', 'linux-arm64', 'darwin-x64', 'darwin-arm64', 'win32-x64', 'win32-arm64'
|
|
21
|
+
$Packages = @($Platforms | ForEach-Object { "@ontoreport/ontoreport-$_" }) + 'ontoreport'
|
|
22
|
+
|
|
23
|
+
function Invoke-Checked([string]$What, [scriptblock]$Block) {
|
|
24
|
+
& $Block
|
|
25
|
+
if ($LASTEXITCODE -ne 0) { throw "$What failed (exit code $LASTEXITCODE)" }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
$dir = Join-Path ([System.IO.Path]::GetTempPath()) ("ontoreport-npm-" + [guid]::NewGuid().ToString('N'))
|
|
29
|
+
New-Item -ItemType Directory -Path $dir | Out-Null
|
|
30
|
+
Write-Host "Downloading npm packages from run $RunId ..."
|
|
31
|
+
Invoke-Checked 'gh run download' { gh run download $RunId -R $Repo -n npm-packages -D $dir }
|
|
32
|
+
Get-ChildItem $dir | ForEach-Object { Write-Host " $($_.Name)" }
|
|
33
|
+
|
|
34
|
+
$null = npm whoami 2>&1
|
|
35
|
+
if ($LASTEXITCODE -ne 0) {
|
|
36
|
+
Write-Host 'Log in to npm (interactive; uses your 2FA):'
|
|
37
|
+
Invoke-Checked 'npm login' { npm login }
|
|
38
|
+
}
|
|
39
|
+
$user = npm whoami
|
|
40
|
+
Write-Host "Publishing as $user"
|
|
41
|
+
|
|
42
|
+
foreach ($p in $Packages) {
|
|
43
|
+
# npm pack file name: '@scope/name' -> 'scope-name-<version>.tgz'
|
|
44
|
+
$file = ($p -replace '^@', '') -replace '/', '-'
|
|
45
|
+
$tgz = Get-ChildItem $dir -File | Where-Object { $_.Name -like "$file-[0-9]*.tgz" } | Select-Object -First 1
|
|
46
|
+
if (-not $tgz) { throw "package tarball for $p not found in $dir" }
|
|
47
|
+
# resumable: skip versions that are already on the registry
|
|
48
|
+
$version = $tgz.BaseName.Substring($file.Length + 1)
|
|
49
|
+
$existing = npm view "$p@$version" version 2>&1
|
|
50
|
+
if ($LASTEXITCODE -eq 0 -and "$existing".Trim() -eq $version) {
|
|
51
|
+
Write-Host "== skip $p@$version (already published)"
|
|
52
|
+
continue
|
|
53
|
+
}
|
|
54
|
+
Write-Host "== npm publish $($tgz.Name)"
|
|
55
|
+
Invoke-Checked "npm publish $($tgz.Name)" { npm publish $tgz.FullName --access public }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
# `npm trust` needs npm >= 11.15; run it through npx (npm 11; npm 12 needs a newer Node) so the global npm is untouched.
|
|
59
|
+
foreach ($p in $Packages) {
|
|
60
|
+
Write-Host "== trusted publisher for $p -> $Repo / $Workflow"
|
|
61
|
+
Invoke-Checked "npm trust $p" { npx -y npm@^11.15.0 trust github $p --repo $Repo --file $Workflow --allow-publish --yes }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Write-Host ''
|
|
65
|
+
Write-Host 'Done. Verify with: npx -y npm@^11.15.0 trust list ontoreport'
|
|
66
|
+
Write-Host "Optional: on npmjs.com set each package's publishing access to"
|
|
67
|
+
Write-Host "'require 2FA and disallow tokens' so only the GitHub workflow can publish."
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# One-time npm bootstrap (same approach as owl-mcp).
|
|
3
|
+
#
|
|
4
|
+
# npm only lets you attach a trusted publisher (GitHub OIDC) to a package that
|
|
5
|
+
# already exists, so the very first version is published from YOUR npm session
|
|
6
|
+
# (`npm login`: browser + 2FA, no long-lived token). After that every release is
|
|
7
|
+
# published by .github/workflows/release.yml through OIDC; no npm token is stored.
|
|
8
|
+
#
|
|
9
|
+
# 1. Build the packages in CI without publishing:
|
|
10
|
+
# gh workflow run release.yml -R Minitour/ontoreport -f version=0.0.1
|
|
11
|
+
# 2. When it finishes:
|
|
12
|
+
# scripts/npm-bootstrap.sh <run-id> (gh run list -w release.yml shows the id)
|
|
13
|
+
# 3. Later releases: git tag v0.0.2 && git push origin v0.0.2
|
|
14
|
+
set -euo pipefail
|
|
15
|
+
|
|
16
|
+
REPO="Minitour/ontoreport"
|
|
17
|
+
WORKFLOW="release.yml"
|
|
18
|
+
RUN="${1:?usage: scripts/npm-bootstrap.sh <release workflow run id>}"
|
|
19
|
+
PLATFORMS="linux-x64 linux-arm64 darwin-x64 darwin-arm64 win32-x64 win32-arm64"
|
|
20
|
+
PACKAGES="$(for p in $PLATFORMS; do printf '@ontoreport/ontoreport-%s ' "$p"; done)ontoreport"
|
|
21
|
+
|
|
22
|
+
dir="$(mktemp -d)"
|
|
23
|
+
echo "Downloading npm packages from run $RUN ..."
|
|
24
|
+
gh run download "$RUN" -R "$REPO" -n npm-packages -D "$dir"
|
|
25
|
+
ls "$dir"
|
|
26
|
+
|
|
27
|
+
if ! npm whoami >/dev/null 2>&1; then
|
|
28
|
+
echo "Log in to npm (interactive; uses your 2FA):"
|
|
29
|
+
npm login
|
|
30
|
+
fi
|
|
31
|
+
echo "Publishing as $(npm whoami)"
|
|
32
|
+
|
|
33
|
+
for p in $PACKAGES; do
|
|
34
|
+
# npm pack file name: '@scope/name' -> 'scope-name-<version>.tgz'
|
|
35
|
+
file="${p#@}"; file="${file/\//-}"
|
|
36
|
+
tgz="$(ls "$dir"/"$file"-[0-9]*.tgz)"
|
|
37
|
+
version="$(basename "$tgz" .tgz)"; version="${version#"$file"-}"
|
|
38
|
+
# resumable: skip versions that are already on the registry
|
|
39
|
+
if [ "$(npm view "$p@$version" version 2>/dev/null)" = "$version" ]; then
|
|
40
|
+
echo "== skip $p@$version (already published)"
|
|
41
|
+
continue
|
|
42
|
+
fi
|
|
43
|
+
echo "== npm publish $(basename "$tgz")"
|
|
44
|
+
npm publish "$tgz" --access public
|
|
45
|
+
done
|
|
46
|
+
|
|
47
|
+
# `npm trust` needs npm >= 11.15; run it through npx (npm 11; npm 12 needs a newer Node) so the global npm is untouched.
|
|
48
|
+
for p in $PACKAGES; do
|
|
49
|
+
echo "== trusted publisher for $p -> $REPO / $WORKFLOW"
|
|
50
|
+
npx -y "npm@^11.15.0" trust github "$p" --repo "$REPO" --file "$WORKFLOW" --allow-publish --yes
|
|
51
|
+
done
|
|
52
|
+
|
|
53
|
+
echo
|
|
54
|
+
echo "Done. Verify with: npx -y "npm@^11.15.0" trust list ontoreport"
|
|
55
|
+
echo "Optional: on npmjs.com set each package's publishing access to"
|
|
56
|
+
echo "'require 2FA and disallow tokens' so only the GitHub workflow can publish."
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//! ontoreport: a quality report for OWL ontologies built from the project record.
|
|
2
|
+
//!
|
|
3
|
+
//! This is a placeholder release that reserves the package name. The report itself
|
|
4
|
+
//! (structure, reuse fidelity, traceability, provenance, requirements coverage and
|
|
5
|
+
//! review status) is under development.
|
|
6
|
+
|
|
7
|
+
/// The crate version, as published.
|
|
8
|
+
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
9
|
+
|
|
10
|
+
/// Message printed when the report is requested from a placeholder release.
|
|
11
|
+
pub fn placeholder_message() -> String {
|
|
12
|
+
format!(
|
|
13
|
+
"ontoreport {VERSION} is a placeholder release; the quality report is under development.\n\
|
|
14
|
+
See https://github.com/Minitour/ontoreport"
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
use std::path::PathBuf;
|
|
2
|
+
use std::process::ExitCode;
|
|
3
|
+
|
|
4
|
+
use clap::Parser;
|
|
5
|
+
|
|
6
|
+
/// Quality report for OWL ontologies built from the project record.
|
|
7
|
+
#[derive(Parser, Debug)]
|
|
8
|
+
#[command(name = "ontoreport", version, about)]
|
|
9
|
+
struct Cli {
|
|
10
|
+
/// Project folder (or OWL/TTL file) to report on.
|
|
11
|
+
project: Option<PathBuf>,
|
|
12
|
+
|
|
13
|
+
/// Where to write the HTML report (the JSON report is written next to it).
|
|
14
|
+
#[arg(long, default_value = "report.html")]
|
|
15
|
+
out: PathBuf,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
fn main() -> ExitCode {
|
|
19
|
+
let _cli = Cli::parse();
|
|
20
|
+
eprintln!("{}", ontoreport::placeholder_message());
|
|
21
|
+
ExitCode::from(2)
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
use std::process::Command;
|
|
2
|
+
|
|
3
|
+
fn bin() -> Command {
|
|
4
|
+
Command::new(env!("CARGO_BIN_EXE_ontoreport"))
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
#[test]
|
|
8
|
+
fn prints_version() {
|
|
9
|
+
let out = bin().arg("--version").output().expect("run ontoreport");
|
|
10
|
+
assert!(out.status.success());
|
|
11
|
+
let text = String::from_utf8_lossy(&out.stdout);
|
|
12
|
+
assert!(text.contains(env!("CARGO_PKG_VERSION")), "{text}");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#[test]
|
|
16
|
+
fn placeholder_exits_with_message() {
|
|
17
|
+
let out = bin().arg(".").output().expect("run ontoreport");
|
|
18
|
+
assert_eq!(out.status.code(), Some(2));
|
|
19
|
+
assert!(String::from_utf8_lossy(&out.stderr).contains("placeholder release"));
|
|
20
|
+
}
|