authoring-cli 0.1.23 → 0.1.25

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authoring-cli",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "CLI for SNOMED CT authoring against authoring-services",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -703,6 +703,111 @@ already tell you as a side effect of being safe to call unconditionally. Don't t
703
703
  are primitive" from this command as "conforms" — it isn't; run `transform-axiom` to find out for
704
704
  sure.
705
705
 
706
+ ### Property axioms (property chains, transitive/reflexive properties) — not reachable via add-axiom
707
+
708
+ `add-axiom`/`update-axiom`/`get-concept --axioms` all operate on `classAxioms` — OWL axioms whose
709
+ subject is a *class* (a defined concept) and whose content Snowstorm can render as relationships.
710
+ A **property axiom** — an OWL axiom whose subject is instead a *property/attribute concept* — is a
711
+ structurally different thing and is invisible through that whole pathway. The clearest real example
712
+ is attribute `127489000` |Has active ingredient|, which on the International Edition carries two OWL
713
+ Axiom reference set members: a plain `SubObjectPropertyOf(:127489000 :762951001)` and a
714
+ property-chain composition `SubObjectPropertyOf(ObjectPropertyChain(:127489000 :738774007)
715
+ :127489000)` (read: "has active ingredient, of something that is a modification of X, implies has
716
+ active ingredient of X" — the chain that lets a modified substance still classify under its parent
717
+ active ingredient). `get-concept --axioms` on that concept surfaces only the first member, reinterpreted
718
+ as a stated `Is a` relationship — the property-chain member doesn't appear there at all, confirmed
719
+ live. This isn't a bug to work around with `update-axiom`; Snowstorm's browser-concept view genuinely
720
+ has no rendering for a property-chain axiom, so there is no `classAxioms`/`gciAxioms` entry to add or
721
+ edit in the first place.
722
+
723
+ **Seeing what's actually there: `get-property-axioms`.** Before assuming a property/attribute
724
+ concept has no property axioms (or trying to guess one's exact current wording before editing),
725
+ check directly — this reads the OWL Axiom reference set member list verbatim, nothing hidden:
726
+
727
+ ```
728
+ authoring-cli get-property-axioms --id 127489000
729
+ ```
730
+
731
+ ```json
732
+ {
733
+ "conceptId": "127489000",
734
+ "refsetId": "733073007",
735
+ "total": 2,
736
+ "axioms": [
737
+ { "memberId": "a24c3458-...", "active": true, "released": true, "effectiveTime": "20190731",
738
+ "moduleId": "900000000000012004", "owlExpression": "SubObjectPropertyOf(:127489000 :762951001)" },
739
+ { "memberId": "70c580eb-...", "active": true, "released": true, "effectiveTime": "20180731",
740
+ "moduleId": "900000000000012004",
741
+ "owlExpression": "SubObjectPropertyOf(ObjectPropertyChain(:127489000 :738774007) :127489000)" }
742
+ ]
743
+ }
744
+ ```
745
+
746
+ This is the one place the property-chain member shows up at all — confirmed live side-by-side with
747
+ `get-concept --axioms --id 127489000` on the same concept, which returns exactly one `classAxioms`
748
+ entry (the first member above, reinterpreted as a relationship) and nothing about the chain. It also
749
+ works on an ordinary class concept, returning the same raw `owlExpression` text `classAxioms`
750
+ otherwise reformats — useful when you want the literal OWL text rather than the resolved-relationship
751
+ view. Pass `--active-only` to drop inactive members; by default every member shows, active or not.
752
+
753
+ **Adding one: `add-property-axiom`.** Writes the raw OWL expression directly as an OWL Axiom
754
+ reference set member (`733073007`) addressed at the *property* concept, bypassing the concept view
755
+ entirely:
756
+
757
+ ```
758
+ authoring-cli add-property-axiom --property-id 127489000 \
759
+ --expression "SubObjectPropertyOf(ObjectPropertyChain(:127489000 :738774007) :127489000)" \
760
+ --project <projectKey> --task <taskKey>
761
+ ```
762
+
763
+ **Get the expression right before running this — a malformed one is a materially bigger risk here
764
+ than a normal failed write.** Confirmed live: sending a garbage expression
765
+ (`"ThisIsNotValidOwlSyntax((("`) got the expected failure back, but it also left the *entire task
766
+ branch permanently locked* — still locked hours later, blocking every subsequent write to that
767
+ branch, not just another property-axiom call. Worse, there is no self-service fix: the branch-unlock
768
+ action is admin-only, and a normal author/project-lead account gets refused outright trying it. If
769
+ this happens to you, the task is effectively stuck until a Snowstorm admin intervenes — treat it as
770
+ a reason to double- and triple-check the expression text, not as "I'll just retry." The command
771
+ itself now refuses obviously-broken input before ever sending it (unbalanced parentheses, or text
772
+ that doesn't start with a recognized OWL keyword like `SubObjectPropertyOf`/`TransitiveObjectProperty`/
773
+ etc.) — but this is a shallow syntax sanity check, not a real OWL parser, so a wrong-but-plausible
774
+ expression (right keyword, wrong structure) can still get through and, in principle, still cause this.
775
+ When the command does fail with an HTTP 500 (meaning the expression reached Snowstorm and its parser
776
+ rejected it), it prints a warning about this risk — don't dismiss that warning as boilerplate; follow
777
+ its advice and check with a plain read before assuming the branch is still usable.
778
+
779
+ Two other things this command does *not* do, unlike every other axiom-mutating command in this skill:
780
+
781
+ - **No structured validation output.** `POST /{branch}/members` (the endpoint this goes through)
782
+ has no `?validate=true` equivalent, so there's no `validationResults` to check. A syntactically
783
+ invalid expression that gets past the shallow client-side check is still rejected by Snowstorm's own
784
+ parser (see above), just as an unstructured HTTP 500 rather than every other command's clean 400 +
785
+ validationResults. What it will *not* catch is a syntactically valid but semantically wrong
786
+ expression (wrong property id, a class-axiom shape pointed at a property concept, etc.) — that's
787
+ accepted and stored, and would only surface later, e.g. as a classification failure. Run
788
+ `get-property-axioms` afterwards to confirm the new member looks right, since there's no save-time
789
+ validation summary to read instead.
790
+ - **No `axiomId` to use afterwards.** The response's `memberId` (a server-assigned UUID, also the
791
+ `memberId` `get-property-axioms` reports) is what `delete-property-axiom` (below) takes instead.
792
+
793
+ **Removing one: `delete-property-axiom`.** Only for a member that's never been released — Snowstorm
794
+ itself enforces this server-side, no client-side pre-check needed:
795
+
796
+ ```
797
+ authoring-cli delete-property-axiom --id 127489000 --member-id <memberId>
798
+ ```
799
+
800
+ Both `--id` (the property concept) and `--member-id` (from `get-property-axioms`'s output) are
801
+ required, and must actually match each other — the command refuses if `--member-id` turns out to
802
+ belong to a different concept, to guard a copy-paste mistake across two `get-property-axioms` calls.
803
+ Deleting a member that's already been released fails with a clean `HTTP 400` naming the member and
804
+ branch (not `409`, unlike `delete-axiom`/`delete-concept`'s refusal for the same situation — a
805
+ Snowstorm quirk specific to this endpoint, not a CLI inconsistency); there's no `--force` override,
806
+ since RF2 has no "delete a released component" operation. A released property axiom can only be
807
+ retired by editing its `owlExpression` directly via `PUT /{branch}/members/{uuid}` outside the CLI,
808
+ or the Authoring Workbench's own OWL axiom editor — there is no `update-property-axiom`/
809
+ `inactivate-property-axiom` command.
810
+
706
811
  ## Redundant stated Is-a relationships
707
812
 
708
813
  Adding a new stated `Is a` (`116680003`) parent to a concept that already has a broader stated