Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- A `then x;` succession whose source is the member before it owns its two end features on the native walk as the RDF writer mints them (SysML.xtext TargetSuccession): nameless `ReferenceUsage`s through an `EndFeatureMembership` each, `isEnd`, named `earlierOccurrence` and `laterOccurrence` by the `happensBeforeLinks` end they redefine, the target end reference-subsetting the member the succession reaches — so the semantic model, the symbol structure and the query leg's `ownedRelationship`, `relatedFeature`, `sourceFeature` and `targetFeature` answer them as the conversion writes them; `then idle;` after a bare `entry;` owns none, as the writer writes none.
27 changes: 27 additions & 0 deletions internal/doc/queryexec/elementids.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ func defaultMultiplicityOwner(sym *symbols.Symbol) (ast.Node, bool) {
return spanNode{sym.DeclSpan}, true
}

// successionEndSlot is the `then` succession edge and the slot (end0, end1) the conversion mints
// the end feature sym under (encodeSuccessionEdge).
func successionEndSlot(sym *symbols.Symbol) (ast.Node, string, bool) {
i, ok := symbols.ImpliedSuccessionEndIndex(sym)
if !ok {
return nil, "", false
}
decl, _ := symbols.ImpliedDeclOf(sym)
return decl.Of, fmt.Sprintf("end%d", i), true
}

// expressionPartSlot is the slot the conversion names a synthesized
// expression parameter by: `in%d` for an operand's or type argument's
// parameter, `out` for the result.
Expand Down Expand Up @@ -121,6 +132,11 @@ func ElementIDOf(read ElementIDReader, idx *symbols.Index, sym *symbols.Symbol)
element, _, err := read.ReadExpressionPart(sym.DocName, owner, defaultMultiplicitySlot)
return element, err
}
if edge, slot, ok := successionEndSlot(sym); ok {
// A `then` succession's end is minted under the edge at end0/end1 (encodeSuccessionEdge).
element, _, err := read.ReadExpressionPart(sym.DocName, edge, slot)
return element, err
}
if end, ok := connectorEndChain(sym); ok {
// The chain Feature a connector end's ReferenceSubsetting owns is minted under the end.
element, _, err := read.ReadExpressionPart(sym.DocName, end, "chain")
Expand Down Expand Up @@ -181,6 +197,13 @@ func implicitRelationshipID(read ElementIDReader, idx *symbols.Index, sym *symbo
return id, true, err
}
return "", true, nil
case symbols.ImplicitSuccessionEndReference:
// The target end's ReferenceSubsetting is minted under the end as its `rs` (referenceSubsetting).
if edge, slot, ok := successionEndSlot(rel.Owner); ok {
element, _, err := read.ReadExpressionPart(rel.Owner.DocName, edge, slot+".rs")
return element, true, err
}
return "", true, nil
case symbols.ImplicitPortConjugation, symbols.ImplicitMetadataBodyRedefinition:
// The conversion keys a relationship the declaration states without a clause by the declaration.
if rel.Owner != nil && rel.Owner.Decl != nil {
Expand All @@ -207,6 +230,10 @@ func implicitMembershipID(read ElementIDReader, idx *symbols.Index, member *symb
_, membership, err := read.ReadExpressionPart(member.DocName, owner, defaultMultiplicitySlot)
return membership, true, err
}
if edge, slot, ok := successionEndSlot(member); ok {
_, membership, err := read.ReadExpressionPart(member.DocName, edge, slot)
return membership, true, err
}
if member != nil {
id, err = read.ReadOwningMembership(member.DocName, member.Decl, query.QualifiedIdentity(idx, member))
return id, true, err
Expand Down
24 changes: 12 additions & 12 deletions internal/semantic/metamodel/derived_census_baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
"dir": "examples/sysml-v2-training",
"files": 100,
"rejected": 0,
"elements": 8038,
"implied": 4678,
"elements": 8268,
"implied": 4816,
"pilotElements": 11906,
"pilotImplied": 0,
"pilotDuplicates": 5797,
Expand All @@ -111,8 +111,8 @@
"dir": "examples/pilot-corpora/sysml-examples",
"files": 99,
"rejected": 0,
"elements": 31382,
"implied": 18384,
"elements": 31822,
"implied": 18648,
"pilotElements": 40642,
"pilotImplied": 0,
"pilotDuplicates": 10940,
Expand All @@ -123,8 +123,8 @@
"dir": "examples/pilot-corpora/sysml-validation",
"files": 56,
"rejected": 0,
"elements": 10758,
"implied": 6306,
"elements": 10858,
"implied": 6366,
"pilotElements": 14222,
"pilotImplied": 0,
"pilotDuplicates": 3066,
Expand All @@ -147,8 +147,8 @@
"dir": "examples/spec-examples",
"files": 511,
"rejected": 38,
"elements": 8425,
"implied": 4777,
"elements": 8585,
"implied": 4873,
"pilotElements": 12233,
"pilotImplied": 0,
"pilotDuplicates": 37,
Expand All @@ -159,8 +159,8 @@
"dir": "tests/testdata",
"files": 40,
"rejected": 0,
"elements": 1552,
"implied": 844,
"elements": 1572,
"implied": 856,
"pilotElements": 2284,
"pilotImplied": 0,
"pilotDuplicates": 52,
Expand All @@ -171,8 +171,8 @@
"dir": "examples",
"files": 56,
"rejected": 0,
"elements": 32771,
"implied": 19067,
"elements": 33106,
"implied": 19268,
"pilotElements": 51722,
"pilotImplied": 0,
"pilotDuplicates": 82277,
Expand Down
Loading
Loading