Skip to content

Commit

Permalink
Merge pull request #88 from LionWeb-io/niko/fine-tune-m1-json-export
Browse files Browse the repository at this point in the history
fine-tuned inclusion of target node ids if target node is not part of AMps2LionWebConverter
  • Loading branch information
enikao authored Jan 11, 2024
2 parents 2e943f0 + 7bff9e1 commit b28ab7a
Show file tree
Hide file tree
Showing 10 changed files with 1,927 additions and 265 deletions.
15 changes: 15 additions & 0 deletions docs/reference/converter-lang.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ closure::
Converts the listed nodes, all descendants, and all referenced nodes.
We apply this strategy until we include all Annotation, Containment, and Reference targets.


.Inclusion of nodes and ids
The following table lists for each scope whether we include the target node / target node's id into the conversion.
Example: For _descendants_ scope, we include both the target node and the target id of annotations and children; we do not include the target node of references, but we do include the target id of references.

|===
|Scope |Annotations + Children |References |Parents

|listed |no / yes |no / yes |no / yes
|descendants |yes / yes |no / yes |no / yes
|closure |yes / yes |yes / yes |no / yes

|===


=== Import Instance from JSON
Technical name: `ImportInstanceFromJson` / `MergingLionWeb2MpsConverter`

Expand Down

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions solutions/io.lionweb.mps.json.test/resources/bobs-library-closure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"serializationFormatVersion": "2023.1",
"languages": [
{
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0"
}
],
"nodes": [
{
"id": "{id-lib}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzE"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzEvMTY2MzE2NjUzNTM4OTU1NjUwNw"
},
"value": "Bob\u0027s Library"
}
],
"containments": [
{
"containment": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzEvLTYzOTI0NjgyNTk0NDA3MjQ1MzE"
},
"children": [
"{id-explorer-book}"
]
}
],
"references": [],
"annotations": [],
"parent": null
},
{
"id": "{id-explorer-book}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYx"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLy00Mzg2MTUwNjczNDI5OTQ5NTUy"
},
"value": "123"
},
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLy02NDc2MDE3NTAyOTM2MDY4MTk5"
},
"value": "Explorer Book"
}
],
"containments": [],
"references": [
{
"reference": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLzI3MDkyODE3OTA0MDA0MDk2OTQ"
},
"targets": [
{
"resolveInfo": null,
"reference": "{id-jack-london}"
}
]
}
],
"annotations": [],
"parent": "{id-lib}"
},
{
"id": "{id-jack-london}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzU1ODIwOTMzOTQ1NTE3NDM0MTc"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy02MzA4OTk2OTY0NjI5MTg1MTYzLzY0Njg3ODM4NDUzODY0MzUxNjY"
},
"value": "Jack London"
},
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzU1ODIwOTMzOTQ1NTE3NDM0MTcvLTQ0MDQ1Mzk3MTU3MTg0MzkyNjM"
},
"value": "Alaska"
}
],
"containments": [],
"references": [],
"annotations": [],
"parent": "{id-container}"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"serializationFormatVersion": "2023.1",
"languages": [
{
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0"
}
],
"nodes": [
{
"id": "{id-lib}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzE"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzEvMTY2MzE2NjUzNTM4OTU1NjUwNw"
},
"value": "Bob\u0027s Library"
}
],
"containments": [
{
"containment": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzEvLTYzOTI0NjgyNTk0NDA3MjQ1MzE"
},
"children": [
"{id-explorer-book}"
]
}
],
"references": [],
"annotations": [],
"parent": null
},
{
"id": "{id-explorer-book}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYx"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLy00Mzg2MTUwNjczNDI5OTQ5NTUy"
},
"value": "123"
},
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLy02NDc2MDE3NTAyOTM2MDY4MTk5"
},
"value": "Explorer Book"
}
],
"containments": [],
"references": [
{
"reference": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLzI3MDkyODE3OTA0MDA0MDk2OTQ"
},
"targets": [
{
"resolveInfo": null,
"reference": "{id-jack-london}"
}
]
}
],
"annotations": [],
"parent": "{id-lib}"
},
{
"id": "{id-jack-london}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzU1ODIwOTMzOTQ1NTE3NDM0MTc"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy02MzA4OTk2OTY0NjI5MTg1MTYzLzY0Njg3ODM4NDUzODY0MzUxNjY"
},
"value": "Jack London"
},
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzU1ODIwOTMzOTQ1NTE3NDM0MTcvLTQ0MDQ1Mzk3MTU3MTg0MzkyNjM"
},
"value": "Alaska"
}
],
"containments": [],
"references": [],
"annotations": [],
"parent": "{id-container}"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"serializationFormatVersion": "2023.1",
"languages": [
{
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0"
}
],
"nodes": [
{
"id": "{id-lib}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzE"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzEvMTY2MzE2NjUzNTM4OTU1NjUwNw"
},
"value": "Bob\u0027s Library"
}
],
"containments": [
{
"containment": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLzg2OTkxNDExNTA2MzkyMDA3NzEvLTYzOTI0NjgyNTk0NDA3MjQ1MzE"
},
"children": [
"{id-explorer-book}"
]
}
],
"references": [],
"annotations": [],
"parent": null
},
{
"id": "{id-explorer-book}",
"classifier": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYx"
},
"properties": [
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLy00Mzg2MTUwNjczNDI5OTQ5NTUy"
},
"value": "123"
},
{
"property": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLy02NDc2MDE3NTAyOTM2MDY4MTk5"
},
"value": "Explorer Book"
}
],
"containments": [],
"references": [
{
"reference": {
"language": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAw",
"version": "0",
"key": "NTM3ZjljYjAtMGYyNS0zYzc2LThiODYtMzA4ZjQ1MDEwMTAwLy0yNTg2Mzk4OTU5MDM1MjUwMjYxLzI3MDkyODE3OTA0MDA0MDk2OTQ"
},
"targets": [
{
"resolveInfo": null,
"reference": "{id-jack-london}"
}
]
}
],
"annotations": [],
"parent": "{id-lib}"
}
]
}
Loading

0 comments on commit b28ab7a

Please sign in to comment.