Repository navigation
fix(export): check sysx:conjugatedTyping against the typing element only - #1485
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
The RDF decoder compared every materialized relationship a feature owns against the owner's sysx:conjugatedTyping flag, so a conjugated port with an explicit subsets, redefines or references clause was refused as a disagreement. The flag qualifies the typing alone: measure it against FeatureTyping and ConjugatedPortTyping and leave the other relationship elements to the ordinary collapsed-end checks. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…atchets Both corpus round-trip ratchets move the file from unwritable to stable; no other verdict moves (831 stable, 7 whitespace-only, 38 refused:syntax of 876). Refresh the record's corpus table and baselines for the spec-examples roots and add the changelog fragment. Co-Authored-By: jason.han <hanhuijun@gmail.com>
… edited writer package The baseline digests internal/translate/export; the decoder fix moved the digest and nothing else (929 files, 91774 elements matched, same buckets). Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
… edit Only the api-json-writer sourceDigest moves; counts and date are unchanged. Co-Authored-By: jason.han <hanhuijun@gmail.com>
5 of 6 tasks
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The RDF decoder (
internal/translate/export/rdf_in_normative.go,decoder.impliedRelationship) compared every materialized relationship element a feature owns against the owner'ssysx:conjugatedTypingflag. A conjugated port with an explicitsubsets,redefinesorreferencesclause (port p2 : ~Pd subsets Parts::Part::ownedPorts;) was therefore refused when read back from Turtle: itsSubsettingis not aConjugatedPortTyping, so it "disagreed" with the flag. The flag qualifies the typing alone, so the comparison now applies only to typing elements (FeatureTyping/ConjugatedPortTyping, i.e. the metaclasses whose collapsed kind isRelTyping); the other relationship elements keep going through the ordinary collapsed-end checks.This was the only
unwritablemodel in the RDF corpus ratchet (spec-examples/sysml/8.4.12.1/3.sysml).Specification basis
SysML v2 textual notation:
ConjugatedPortTypingis the typing of a port by~P(SysML 8.4.12.1); it says nothing about the port's subsettings, redefinitions or reference subsettings. Nospec-compliance.mdrow moves.How it was verified
internal/translate/export/rdf_conjugated_typing_test.go(new): from the graph alone (source text and source ranges stripped) a conjugated port withsubsets, withredefines, withreferences, with a multiplicity, and a plain-typed port withsubsetsall read back, and a second Turtle hop is byte-identical; a genuine disagreement (plain typing under asysx:conjugatedTypingflag, conjugated typing without the flag) is still refused with anUnsupportedErrornaming the flag and the owner. Both tests fail ondevelop.By hand:
sysml examples/spec-examples/sysml/8.4.12.1/3.sysml -convert ttl→-convert sysml→-convert ttlis byte-identical to the first Turtle (cmp); the same for the minimal modelpackage M { port def Pd; part def Q specializes Parts::Part { port p3 : ~Pd subsets Parts::Part::ownedPorts; } }.Corpus ratchets, all require variables set, downloaded corpora (
download-training-examples.sh,download-pilot-corpora.sh,download-spec-examples.sh), 876 files:stablewhitespace-onlyunwritablerefused:syntaxgraph-diff/unparseableThe only movement in either file is
spec-examples/sysml/8.4.12.1/3.sysml:unwritable→stable. Regenerated with-update-corpus-roundtrip -update-api-json-roundtrip, run twice, second run byte-identical. All 838 corpus files that parse now round-trip in both forms.docs/project/rdf-corpus-roundtrip.md: corpus table and both baseline tables brought to the current roots (the spec-examples roots had not been recorded), theunwritablefix noted.docs/project/api-json-differential-baseline.json: re-recorded withgo run -C tools ./cmd/pilot-apijson-diff -updatebecause the baseline digestsinternal/translate/export; only the writer digest and the recording date moved (929 files, 91774 elements matched, same buckets).make docs-countspasses.go build ./...,go vet ./...,gofmt -l .(empty),make lint(staticcheck + gosec: "Lint passed"),go test -count=1 ./...with the require variables set: all packagesok(cmd/sysmlandtests/codegenhit the 10 min default timeout while the 22 min differential re-record ran beside them; alone with-timeout 40mboth pass in under 6 min).make docs-checkpasses throughcheck-doc-links,check-doc-ids,check-doc-figuresandchangelog.py check; its last step needs themkdocsPython package, which is not installed here.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogRequested by: @HuiJun