@bpmn-ld/bpmn-ld 0.0.0-stage → 0.1.0

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.
Files changed (319) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +125 -2
  3. package/contexts/combined.jsonld +3 -0
  4. package/contexts/core.jsonld +170 -0
  5. package/contexts/di.jsonld +37 -0
  6. package/dist/analyze/analyze.d.ts +3 -0
  7. package/dist/analyze/analyze.js +11 -0
  8. package/dist/analyze/findings.d.ts +8 -0
  9. package/dist/analyze/findings.js +1 -0
  10. package/dist/analyze/report.d.ts +3 -0
  11. package/dist/analyze/report.js +9 -0
  12. package/dist/analyze/rules/ad-hoc-completion-condition.d.ts +2 -0
  13. package/dist/analyze/rules/ad-hoc-completion-condition.js +7 -0
  14. package/dist/analyze/rules/cannot-reach-end.d.ts +2 -0
  15. package/dist/analyze/rules/cannot-reach-end.js +28 -0
  16. package/dist/analyze/rules/compensation-association.d.ts +2 -0
  17. package/dist/analyze/rules/compensation-association.js +13 -0
  18. package/dist/analyze/rules/dead-end.d.ts +2 -0
  19. package/dist/analyze/rules/dead-end.js +13 -0
  20. package/dist/analyze/rules/end-event.d.ts +2 -0
  21. package/dist/analyze/rules/end-event.js +8 -0
  22. package/dist/analyze/rules/error-catch.d.ts +2 -0
  23. package/dist/analyze/rules/error-catch.js +14 -0
  24. package/dist/analyze/rules/escalation-catch.d.ts +2 -0
  25. package/dist/analyze/rules/escalation-catch.js +14 -0
  26. package/dist/analyze/rules/gateway-cardinality.d.ts +3 -0
  27. package/dist/analyze/rules/gateway-cardinality.js +17 -0
  28. package/dist/analyze/rules/index.d.ts +4 -0
  29. package/dist/analyze/rules/index.js +21 -0
  30. package/dist/analyze/rules/instantiating-gateway.d.ts +2 -0
  31. package/dist/analyze/rules/instantiating-gateway.js +14 -0
  32. package/dist/analyze/rules/non-interrupting-start.d.ts +2 -0
  33. package/dist/analyze/rules/non-interrupting-start.js +14 -0
  34. package/dist/analyze/rules/reachability.d.ts +2 -0
  35. package/dist/analyze/rules/reachability.js +25 -0
  36. package/dist/analyze/rules/rule.d.ts +7 -0
  37. package/dist/analyze/rules/rule.js +1 -0
  38. package/dist/analyze/rules/signal-catch.d.ts +2 -0
  39. package/dist/analyze/rules/signal-catch.js +12 -0
  40. package/dist/analyze/rules/split-join-pairing.d.ts +3 -0
  41. package/dist/analyze/rules/split-join-pairing.js +50 -0
  42. package/dist/analyze/rules/start-event.d.ts +2 -0
  43. package/dist/analyze/rules/start-event.js +8 -0
  44. package/dist/analyze/rules/task-message-flow.d.ts +2 -0
  45. package/dist/analyze/rules/task-message-flow.js +19 -0
  46. package/dist/analyze/scope-graph.d.ts +56 -0
  47. package/dist/analyze/scope-graph.js +89 -0
  48. package/dist/analyze-cli.d.ts +1 -0
  49. package/dist/analyze-cli.js +5 -0
  50. package/dist/analyze-run.d.ts +12 -0
  51. package/dist/analyze-run.js +85 -0
  52. package/dist/bpmn-ld-cli.d.ts +1 -0
  53. package/dist/bpmn-ld-cli.js +90 -0
  54. package/dist/build-cli.d.ts +1 -0
  55. package/dist/build-cli.js +2 -0
  56. package/dist/build.d.ts +3 -0
  57. package/dist/build.js +38 -0
  58. package/dist/check-xml/check.d.ts +3 -0
  59. package/dist/check-xml/check.js +11 -0
  60. package/dist/check-xml/lint.d.ts +2 -0
  61. package/dist/check-xml/lint.js +47 -0
  62. package/dist/check-xml/moddle.d.ts +6 -0
  63. package/dist/check-xml/moddle.js +23 -0
  64. package/dist/check-xml/types.d.ts +20 -0
  65. package/dist/check-xml/types.js +1 -0
  66. package/dist/check-xml/xsd.d.ts +2 -0
  67. package/dist/check-xml/xsd.js +25 -0
  68. package/dist/check-xml-cli.d.ts +1 -0
  69. package/dist/check-xml-cli.js +5 -0
  70. package/dist/check-xml-run.d.ts +10 -0
  71. package/dist/check-xml-run.js +77 -0
  72. package/dist/convert/analyze-output.d.ts +3 -0
  73. package/dist/convert/analyze-output.js +8 -0
  74. package/dist/convert/convert.d.ts +19 -0
  75. package/dist/convert/convert.js +96 -0
  76. package/dist/convert/errors.d.ts +5 -0
  77. package/dist/convert/errors.js +8 -0
  78. package/dist/convert/extensions.d.ts +23 -0
  79. package/dist/convert/extensions.js +103 -0
  80. package/dist/convert/mapping-check.d.ts +15 -0
  81. package/dist/convert/mapping-check.js +66 -0
  82. package/dist/convert/mapping.d.ts +52 -0
  83. package/dist/convert/mapping.js +273 -0
  84. package/dist/convert/namespaces.d.ts +2 -0
  85. package/dist/convert/namespaces.js +19 -0
  86. package/dist/convert/validate-output.d.ts +2 -0
  87. package/dist/convert/validate-output.js +28 -0
  88. package/dist/convert/warnings.d.ts +9 -0
  89. package/dist/convert/warnings.js +67 -0
  90. package/dist/convert/xml-reader.d.ts +11 -0
  91. package/dist/convert/xml-reader.js +84 -0
  92. package/dist/convert-cli.d.ts +1 -0
  93. package/dist/convert-cli.js +5 -0
  94. package/dist/convert-run.d.ts +10 -0
  95. package/dist/convert-run.js +125 -0
  96. package/dist/coverage-cli.d.ts +1 -0
  97. package/dist/coverage-cli.js +8 -0
  98. package/dist/coverage-mappings.d.ts +3 -0
  99. package/dist/coverage-mappings.js +34 -0
  100. package/dist/coverage-scope.d.ts +11 -0
  101. package/dist/coverage-scope.js +187 -0
  102. package/dist/coverage-xsd.d.ts +15 -0
  103. package/dist/coverage-xsd.js +55 -0
  104. package/dist/coverage.d.ts +35 -0
  105. package/dist/coverage.js +152 -0
  106. package/dist/docs-cli.d.ts +1 -0
  107. package/dist/docs-cli.js +18 -0
  108. package/dist/docs.d.ts +8 -0
  109. package/dist/docs.js +136 -0
  110. package/dist/eval/checks.d.ts +19 -0
  111. package/dist/eval/checks.js +252 -0
  112. package/dist/eval/regenerate.d.ts +10 -0
  113. package/dist/eval/regenerate.js +48 -0
  114. package/dist/eval-regenerate-cli.d.ts +1 -0
  115. package/dist/eval-regenerate-cli.js +16 -0
  116. package/dist/export/data.d.ts +10 -0
  117. package/dist/export/data.js +127 -0
  118. package/dist/export/diagram.d.ts +8 -0
  119. package/dist/export/diagram.js +112 -0
  120. package/dist/export/element.d.ts +27 -0
  121. package/dist/export/element.js +175 -0
  122. package/dist/export/export.d.ts +22 -0
  123. package/dist/export/export.js +124 -0
  124. package/dist/export/extensions.d.ts +18 -0
  125. package/dist/export/extensions.js +122 -0
  126. package/dist/export/layout-export.d.ts +4 -0
  127. package/dist/export/layout-export.js +25 -0
  128. package/dist/export/mapping-check.d.ts +39 -0
  129. package/dist/export/mapping-check.js +175 -0
  130. package/dist/export/normalize.d.ts +3 -0
  131. package/dist/export/normalize.js +67 -0
  132. package/dist/export-cli.d.ts +1 -0
  133. package/dist/export-cli.js +5 -0
  134. package/dist/export-run.d.ts +10 -0
  135. package/dist/export-run.js +157 -0
  136. package/dist/index.d.ts +10 -0
  137. package/dist/index.js +10 -0
  138. package/dist/install-skill-run.d.ts +8 -0
  139. package/dist/install-skill-run.js +30 -0
  140. package/dist/install-skill.d.ts +23 -0
  141. package/dist/install-skill.js +76 -0
  142. package/dist/layout/collaboration.d.ts +36 -0
  143. package/dist/layout/collaboration.js +152 -0
  144. package/dist/layout/di.d.ts +15 -0
  145. package/dist/layout/di.js +52 -0
  146. package/dist/layout/extract.d.ts +2 -0
  147. package/dist/layout/extract.js +99 -0
  148. package/dist/layout/lanes.d.ts +30 -0
  149. package/dist/layout/lanes.js +112 -0
  150. package/dist/layout/layering.d.ts +7 -0
  151. package/dist/layout/layering.js +53 -0
  152. package/dist/layout/layout.d.ts +12 -0
  153. package/dist/layout/layout.js +299 -0
  154. package/dist/layout/model.d.ts +52 -0
  155. package/dist/layout/model.js +10 -0
  156. package/dist/layout/placement.d.ts +25 -0
  157. package/dist/layout/placement.js +256 -0
  158. package/dist/layout/standalone.d.ts +8 -0
  159. package/dist/layout/standalone.js +50 -0
  160. package/dist/layout-cli.d.ts +1 -0
  161. package/dist/layout-cli.js +5 -0
  162. package/dist/layout-run.d.ts +9 -0
  163. package/dist/layout-run.js +105 -0
  164. package/dist/loader.d.ts +5 -0
  165. package/dist/loader.js +7 -0
  166. package/dist/namespace.d.ts +5 -0
  167. package/dist/namespace.js +5 -0
  168. package/dist/ontology.d.ts +19 -0
  169. package/dist/ontology.js +94 -0
  170. package/dist/paths.d.ts +1 -0
  171. package/dist/paths.js +2 -0
  172. package/dist/render/geometry.d.ts +40 -0
  173. package/dist/render/geometry.js +81 -0
  174. package/dist/render/renderer.d.ts +31 -0
  175. package/dist/render/renderer.js +369 -0
  176. package/dist/render/symbols.d.ts +10 -0
  177. package/dist/render/symbols.js +26 -0
  178. package/dist/render/text.d.ts +20 -0
  179. package/dist/render/text.js +28 -0
  180. package/dist/render-cli.d.ts +1 -0
  181. package/dist/render-cli.js +7 -0
  182. package/dist/render-run.d.ts +9 -0
  183. package/dist/render-run.js +161 -0
  184. package/dist/render.d.ts +4 -0
  185. package/dist/render.js +4 -0
  186. package/dist/schema-overrides.d.ts +14 -0
  187. package/dist/schema-overrides.js +36 -0
  188. package/dist/schema-validate.d.ts +5 -0
  189. package/dist/schema-validate.js +8 -0
  190. package/dist/schema.d.ts +6 -0
  191. package/dist/schema.js +114 -0
  192. package/dist/shacl.d.ts +15 -0
  193. package/dist/shacl.js +37 -0
  194. package/dist/validate-cli.d.ts +1 -0
  195. package/dist/validate-cli.js +5 -0
  196. package/dist/validate-run.d.ts +8 -0
  197. package/dist/validate-run.js +58 -0
  198. package/dist/validate.d.ts +11 -0
  199. package/dist/validate.js +94 -0
  200. package/dist/versioning-cli.d.ts +1 -0
  201. package/dist/versioning-cli.js +18 -0
  202. package/dist/versioning.d.ts +17 -0
  203. package/dist/versioning.js +45 -0
  204. package/ontology/core.ttl +993 -0
  205. package/ontology/di.ttl +167 -0
  206. package/package.json +76 -4
  207. package/schema/bpmn-ld.schema.json +15230 -0
  208. package/shapes/core.shapes.ttl +398 -0
  209. package/skills/bpmn-ld/SKILL.md +154 -0
  210. package/skills/bpmn-ld/evals/models/order-approval-di.jsonld +296 -0
  211. package/skills/bpmn-ld/evals/models/refund-di.bpmn +82 -0
  212. package/skills/bpmn-ld/evals/models/refund.bpmn +18 -0
  213. package/skills/bpmn-ld/evals/outputs/explain-collaboration.md +22 -0
  214. package/skills/bpmn-ld/evals/outputs/explain-order-approval.md +24 -0
  215. package/skills/bpmn-ld/evals/outputs/explain-refund.md +17 -0
  216. package/skills/bpmn-ld/evals/outputs/generate-activity-compensation.jsonld +39 -0
  217. package/skills/bpmn-ld/evals/outputs/generate-ad-hoc-sub-process.jsonld +52 -0
  218. package/skills/bpmn-ld/evals/outputs/generate-boundary-event.jsonld +27 -0
  219. package/skills/bpmn-ld/evals/outputs/generate-collaboration.jsonld +49 -0
  220. package/skills/bpmn-ld/evals/outputs/generate-conditions.jsonld +93 -0
  221. package/skills/bpmn-ld/evals/outputs/generate-diagram-properties.jsonld +340 -0
  222. package/skills/bpmn-ld/evals/outputs/generate-error.jsonld +217 -0
  223. package/skills/bpmn-ld/evals/outputs/generate-escalation.jsonld +231 -0
  224. package/skills/bpmn-ld/evals/outputs/generate-event-definition-ref.jsonld +67 -0
  225. package/skills/bpmn-ld/evals/outputs/generate-event-sub-process.jsonld +54 -0
  226. package/skills/bpmn-ld/evals/outputs/generate-exclusive-choice.jsonld +32 -0
  227. package/skills/bpmn-ld/evals/outputs/generate-instantiating-gateway.jsonld +24 -0
  228. package/skills/bpmn-ld/evals/outputs/generate-lane-partition.jsonld +46 -0
  229. package/skills/bpmn-ld/evals/outputs/generate-link-event.expect.json +11 -0
  230. package/skills/bpmn-ld/evals/outputs/generate-link-event.jsonld +57 -0
  231. package/skills/bpmn-ld/evals/outputs/generate-loop.jsonld +30 -0
  232. package/skills/bpmn-ld/evals/outputs/generate-message.jsonld +61 -0
  233. package/skills/bpmn-ld/evals/outputs/generate-parallel-branches.jsonld +25 -0
  234. package/skills/bpmn-ld/evals/outputs/generate-process-attributes.jsonld +49 -0
  235. package/skills/bpmn-ld/evals/outputs/generate-script-task.jsonld +18 -0
  236. package/skills/bpmn-ld/evals/outputs/generate-signal.jsonld +178 -0
  237. package/skills/bpmn-ld/evals/outputs/generate-sub-process.jsonld +31 -0
  238. package/skills/bpmn-ld/evals/outputs/generate-targeted-compensation.jsonld +40 -0
  239. package/skills/bpmn-ld/evals/outputs/generate-task-implementation.jsonld +18 -0
  240. package/skills/bpmn-ld/evals/outputs/generate-task-message-references.jsonld +49 -0
  241. package/skills/bpmn-ld/evals/outputs/generate-transaction.jsonld +48 -0
  242. package/skills/bpmn-ld/evals/outputs/modify-order-approval.jsonld +376 -0
  243. package/skills/bpmn-ld/evals/outputs/modify-refund.jsonld +373 -0
  244. package/skills/bpmn-ld/evals/outputs/order-approval.jsonld +29 -0
  245. package/skills/bpmn-ld/evals/outputs/refine-order-approval.jsonld +377 -0
  246. package/skills/bpmn-ld/evals/prompts/explain-collaboration.md +3 -0
  247. package/skills/bpmn-ld/evals/prompts/explain-order-approval.md +3 -0
  248. package/skills/bpmn-ld/evals/prompts/explain-refund.md +3 -0
  249. package/skills/bpmn-ld/evals/prompts/generate-activity-compensation.md +1 -0
  250. package/skills/bpmn-ld/evals/prompts/generate-ad-hoc-sub-process.md +1 -0
  251. package/skills/bpmn-ld/evals/prompts/generate-boundary-event.md +1 -0
  252. package/skills/bpmn-ld/evals/prompts/generate-collaboration.md +1 -0
  253. package/skills/bpmn-ld/evals/prompts/generate-conditions.md +1 -0
  254. package/skills/bpmn-ld/evals/prompts/generate-diagram-properties.md +1 -0
  255. package/skills/bpmn-ld/evals/prompts/generate-error.md +1 -0
  256. package/skills/bpmn-ld/evals/prompts/generate-escalation.md +1 -0
  257. package/skills/bpmn-ld/evals/prompts/generate-event-definition-ref.md +1 -0
  258. package/skills/bpmn-ld/evals/prompts/generate-event-sub-process.md +1 -0
  259. package/skills/bpmn-ld/evals/prompts/generate-exclusive-choice.md +1 -0
  260. package/skills/bpmn-ld/evals/prompts/generate-instantiating-gateway.md +1 -0
  261. package/skills/bpmn-ld/evals/prompts/generate-lane-partition.md +1 -0
  262. package/skills/bpmn-ld/evals/prompts/generate-link-event.md +1 -0
  263. package/skills/bpmn-ld/evals/prompts/generate-loop.md +1 -0
  264. package/skills/bpmn-ld/evals/prompts/generate-message.md +1 -0
  265. package/skills/bpmn-ld/evals/prompts/generate-parallel-branches.md +1 -0
  266. package/skills/bpmn-ld/evals/prompts/generate-process-attributes.md +1 -0
  267. package/skills/bpmn-ld/evals/prompts/generate-script-task.md +1 -0
  268. package/skills/bpmn-ld/evals/prompts/generate-signal.md +1 -0
  269. package/skills/bpmn-ld/evals/prompts/generate-sub-process.md +1 -0
  270. package/skills/bpmn-ld/evals/prompts/generate-targeted-compensation.md +1 -0
  271. package/skills/bpmn-ld/evals/prompts/generate-task-implementation.md +1 -0
  272. package/skills/bpmn-ld/evals/prompts/generate-task-message-references.md +1 -0
  273. package/skills/bpmn-ld/evals/prompts/generate-transaction.md +1 -0
  274. package/skills/bpmn-ld/evals/prompts/modify-order-approval.md +4 -0
  275. package/skills/bpmn-ld/evals/prompts/modify-refund.md +4 -0
  276. package/skills/bpmn-ld/evals/prompts/order-approval.md +1 -0
  277. package/skills/bpmn-ld/evals/prompts/refine-order-approval.md +8 -0
  278. package/skills/bpmn-ld/examples/positive/activity-compensation.jsonld +39 -0
  279. package/skills/bpmn-ld/examples/positive/ad-hoc-sub-process.jsonld +52 -0
  280. package/skills/bpmn-ld/examples/positive/boundary-event.jsonld +27 -0
  281. package/skills/bpmn-ld/examples/positive/collaboration.jsonld +49 -0
  282. package/skills/bpmn-ld/examples/positive/conditions.jsonld +93 -0
  283. package/skills/bpmn-ld/examples/positive/diagram-properties.jsonld +340 -0
  284. package/skills/bpmn-ld/examples/positive/error.jsonld +208 -0
  285. package/skills/bpmn-ld/examples/positive/escalation.jsonld +231 -0
  286. package/skills/bpmn-ld/examples/positive/event-definition-ref.jsonld +142 -0
  287. package/skills/bpmn-ld/examples/positive/event-sub-process.jsonld +54 -0
  288. package/skills/bpmn-ld/examples/positive/exclusive-choice.jsonld +32 -0
  289. package/skills/bpmn-ld/examples/positive/instantiating-gateway.jsonld +24 -0
  290. package/skills/bpmn-ld/examples/positive/lane-partition.jsonld +46 -0
  291. package/skills/bpmn-ld/examples/positive/link-event.expect.json +10 -0
  292. package/skills/bpmn-ld/examples/positive/link-event.jsonld +138 -0
  293. package/skills/bpmn-ld/examples/positive/loop.jsonld +30 -0
  294. package/skills/bpmn-ld/examples/positive/message.jsonld +60 -0
  295. package/skills/bpmn-ld/examples/positive/order-approval.jsonld +29 -0
  296. package/skills/bpmn-ld/examples/positive/parallel-branches.jsonld +25 -0
  297. package/skills/bpmn-ld/examples/positive/process-attributes.jsonld +49 -0
  298. package/skills/bpmn-ld/examples/positive/script-task.jsonld +18 -0
  299. package/skills/bpmn-ld/examples/positive/signal.jsonld +150 -0
  300. package/skills/bpmn-ld/examples/positive/sub-process.jsonld +31 -0
  301. package/skills/bpmn-ld/examples/positive/targeted-compensation.jsonld +40 -0
  302. package/skills/bpmn-ld/examples/positive/task-implementation.jsonld +18 -0
  303. package/skills/bpmn-ld/examples/positive/task-message-references.jsonld +151 -0
  304. package/skills/bpmn-ld/examples/positive/transaction.jsonld +48 -0
  305. package/skills/bpmn-ld/references/clarification-and-refinement.md +60 -0
  306. package/skills/bpmn-ld/references/common-mistakes.md +110 -0
  307. package/skills/bpmn-ld/references/explain-and-document.md +36 -0
  308. package/skills/bpmn-ld/references/modify-existing-model.md +49 -0
  309. package/skills/bpmn-ld/references/patterns.md +292 -0
  310. package/skills/bpmn-ld/references/render-output.md +1 -0
  311. package/skills/bpmn-ld/references/rule-catalogue.md +183 -0
  312. package/skills/bpmn-ld/references/vocabulary-summary.md +65 -0
  313. package/skills/bpmn-ld/template.jsonld +14 -0
  314. package/templates/combined.jsonld +3 -0
  315. package/templates/core.jsonld +170 -0
  316. package/templates/core.shapes.ttl +398 -0
  317. package/templates/core.ttl +993 -0
  318. package/templates/di.jsonld +37 -0
  319. package/templates/di.ttl +167 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Dejan Dimic <dejan.dimic@gmail.com>
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,126 @@
1
- # Temporary Holding Version
1
+ # bpmn-ld
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **A Semantic JSON-LD Representation of BPMN 2.0**
4
+
5
+ > Bringing BPMN 2.0 into the Semantic Web and the AI Agent ecosystem.
6
+
7
+ ## Overview
8
+
9
+ BPMN-LD is an open-source initiative to develop a semantic representation of the
10
+ Business Process Model and Notation (BPMN) 2.0 specification using JSON-LD.
11
+
12
+ The project aims to make BPMN models machine-readable, semantically interoperable
13
+ and accessible to AI agents.
14
+
15
+ The initiative will establish a common semantic foundation for creating,
16
+ interpreting, analysing and validating business process models.
17
+
18
+ ## Vision
19
+
20
+ Enable humans and AI agents to collaborate in business process modelling through
21
+ a standardised, semantically rich and machine-interpretable representation of
22
+ BPMN.
23
+
24
+ ## Project Objectives
25
+
26
+ 1. Develop a JSON-LD semantic representation of BPMN 2.0.
27
+ 2. Define the BPMN-LD ontology, JSON-LD context and associated validation schemas.
28
+ 3. Preserve BPMN 2.0 semantics and support interoperability with BPMN XML.
29
+ 4. Develop an AI Agent Skill capable of creating BPMN diagrams from
30
+ natural-language requirements.
31
+ 5. Enable AI agents to interpret, explain, modify and improve existing BPMN diagrams.
32
+ 6. Implement structural, semantic and process-level validation.
33
+ 7. Provide reusable tools, documentation, examples and test cases.
34
+
35
+ ## Main Workstreams
36
+
37
+ ### 1. BPMN-LD Semantic Model
38
+
39
+ - BPMN classes and properties.
40
+ - Events, activities, gateways and flows, including message, signal, error, escalation, compensation, conditional and link event definitions, ad-hoc sub-processes and transactions.
41
+ - Root elements (messages, signals, errors, escalations) and the references to them.
42
+ - Participants, pools and lanes.
43
+ - Data objects and associations.
44
+ - Processes and collaborations.
45
+ - BPMN diagram interchange (BPMN DI).
46
+
47
+ The generated [coverage report](reports/coverage.md) shows no in-scope gaps against the BPMN 2.0.2 XSDs. Item definitions and operations are not modelled, so `itemRef`, `operationRef`, `structureRef` and `evaluatesToTypeRef` are kept as unresolved identifiers. The converter does not yet convert data constructs.
48
+
49
+ ### 2. JSON-LD Representation
50
+
51
+ - JSON-LD context.
52
+ - RDF/OWL ontology.
53
+ - JSON Schema.
54
+ - SHACL validation constraints.
55
+ - Semantic identifiers and relationships.
56
+
57
+ ### 3. BPMN Processing Engine
58
+
59
+ - JSON-LD parsing and serialization.
60
+ - Model validation.
61
+ - BPMN XML interoperability: [import](docs/conventions/converter.md) and [export](docs/conventions/exporter.md).
62
+ - Automatic diagram layout (BPMN DI) for models without a diagram, see [layout](docs/conventions/layout.md).
63
+ - External checks of exported XML: XSD, bpmn-moddle and bpmnlint.
64
+ - Semantic graph analysis.
65
+ - [Process structure analysis](docs/conventions/process-analysis.md).
66
+
67
+ ### 4. AI Agent Skill
68
+
69
+ - Natural-language-to-BPMN generation.
70
+ - BPMN model interpretation.
71
+ - Diagram modification.
72
+ - Process documentation.
73
+ - Validation and error explanation.
74
+ - Iterative refinement through user feedback.
75
+ - Install and usage: [AI agent skill](docs/conventions/skill.md).
76
+
77
+ ### 5. Testing and Demonstration
78
+
79
+ - Reference BPMN models.
80
+ - Positive and negative validation examples.
81
+ - JSON-LD interoperability tests.
82
+ - AI-generated BPMN test cases.
83
+ - Regression testing.
84
+
85
+ ## Commands
86
+
87
+ | Command | Purpose | Documentation |
88
+ | ------- | ------- | ------------- |
89
+ | `npm run convert` | BPMN 2.0 XML to BPMN-LD | [Converter](docs/conventions/converter.md) |
90
+ | `npm run export` | BPMN-LD to BPMN 2.0 XML, optionally with `--layout` | [Exporter](docs/conventions/exporter.md) |
91
+ | `npm run layout` | Add BPMN DI shapes and edges to a BPMN-LD document | [Layout](docs/conventions/layout.md) |
92
+ | `npm run check-xml` | Check BPMN 2.0 XML with the XSD, bpmn-moddle and bpmnlint | [Exporter](docs/conventions/exporter.md#external-checks) |
93
+ | `npm run analyze` | Process-level analysis of a BPMN-LD document | [Process analysis](docs/conventions/process-analysis.md) |
94
+ | `npm run render` | Render BPMN-LD or BPMN XML to SVG | [Renderer](docs/conventions/renderer.md) |
95
+ | `npm run validate` | Schema and SHACL validation | [Documentation index](docs/README.md) |
96
+
97
+ The design of the exporter, layout and external checks is recorded in [ADR 0012](docs/adr/0012-bpmn-xml-exporter-layout-and-external-checks.md). The AI agent skill is described in [the skill page](docs/conventions/skill.md) and recorded in [ADR 0013](docs/adr/0013-ai-agent-skill.md). The renderer is recorded in [ADR 0015](docs/adr/0015-svg-renderer.md).
98
+
99
+ ## Guiding Principles
100
+
101
+ - Standards-based: maintain alignment with OMG BPMN 2.0.2.
102
+ - Semantic interoperability: use W3C Linked Data standards.
103
+ - AI-ready: provide machine-interpretable structures.
104
+ - Open-source: encourage collaboration and reuse.
105
+ - Extensible: support future BPMN extensions and domain-specific vocabularies.
106
+ - Verifiable: provide repeatable validation and testing.
107
+
108
+ ## Initial Technology References
109
+
110
+ | Name | Version | URL | Description |
111
+ | ---- | ------- | --- | ----------- |
112
+ | OMG BPMN | 2.0.2 | <https://www.omg.org/spec/BPMN/2.0.2/PDF> | Business Process Model and Notation specification. |
113
+ | BPMN XML | 2.0 (XSD) | <https://www.omg.org/spec/BPMN/20100501/BPMN20.xsd> | Normative XML schema for BPMN interchange; the semantic part is at <https://www.omg.org/spec/BPMN/20100501/Semantic.xsd>. |
114
+ | W3C JSON-LD | 1.1 | <https://www.w3.org/TR/2020/REC-json-ld11-20200716/> | JSON-based serialization of Linked Data. |
115
+ | W3C RDF | 1.1 Concepts | <https://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/> | Core data model for graph-based semantic data. |
116
+ | W3C OWL | 2 | <https://www.w3.org/TR/2012/REC-owl2-overview-20121211/> | Ontology language for describing classes and properties. |
117
+ | W3C SHACL | 1.0 | <https://www.w3.org/TR/2017/REC-shacl-20170720/> | Language for validating RDF graphs against constraints. |
118
+ | JSON Schema | 2020-12 | <https://json-schema.org/draft/2020-12> | Vocabulary for validating the structure of JSON documents. |
119
+
120
+ ## Collaboration
121
+
122
+ Contributions, discussions, architectural proposals and implementation ideas are
123
+ welcome.
124
+
125
+ The project aims to build an open ecosystem connecting business process
126
+ modelling, semantic technologies and AI agents.
@@ -0,0 +1,3 @@
1
+ {
2
+ "@context": ["core.jsonld", "di.jsonld"]
3
+ }
@@ -0,0 +1,170 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@protected": true,
5
+ "id": "@id",
6
+ "type": "@type",
7
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
8
+ "bpmn": "https://bpmn-ld.example.org/ns#",
9
+ "Process": "bpmn:Process",
10
+ "SubProcess": "bpmn:SubProcess",
11
+ "AdHocSubProcess": "bpmn:AdHocSubProcess",
12
+ "Transaction": "bpmn:Transaction",
13
+ "Collaboration": "bpmn:Collaboration",
14
+ "Participant": "bpmn:Participant",
15
+ "MessageFlow": "bpmn:MessageFlow",
16
+ "Message": "bpmn:Message",
17
+ "Signal": "bpmn:Signal",
18
+ "Error": "bpmn:Error",
19
+ "Escalation": "bpmn:Escalation",
20
+ "Association": "bpmn:Association",
21
+ "LaneSet": "bpmn:LaneSet",
22
+ "Lane": "bpmn:Lane",
23
+ "StartEvent": "bpmn:StartEvent",
24
+ "EndEvent": "bpmn:EndEvent",
25
+ "CatchEvent": "bpmn:CatchEvent",
26
+ "ThrowEvent": "bpmn:ThrowEvent",
27
+ "IntermediateCatchEvent": "bpmn:IntermediateCatchEvent",
28
+ "IntermediateThrowEvent": "bpmn:IntermediateThrowEvent",
29
+ "ImplicitThrowEvent": "bpmn:ImplicitThrowEvent",
30
+ "BoundaryEvent": "bpmn:BoundaryEvent",
31
+ "MessageEventDefinition": "bpmn:MessageEventDefinition",
32
+ "TimerEventDefinition": "bpmn:TimerEventDefinition",
33
+ "ErrorEventDefinition": "bpmn:ErrorEventDefinition",
34
+ "SignalEventDefinition": "bpmn:SignalEventDefinition",
35
+ "EscalationEventDefinition": "bpmn:EscalationEventDefinition",
36
+ "ConditionalEventDefinition": "bpmn:ConditionalEventDefinition",
37
+ "LinkEventDefinition": "bpmn:LinkEventDefinition",
38
+ "CompensateEventDefinition": "bpmn:CompensateEventDefinition",
39
+ "CancelEventDefinition": "bpmn:CancelEventDefinition",
40
+ "TerminateEventDefinition": "bpmn:TerminateEventDefinition",
41
+ "SequenceFlow": "bpmn:SequenceFlow",
42
+ "BusinessRuleTask": "bpmn:BusinessRuleTask",
43
+ "ManualTask": "bpmn:ManualTask",
44
+ "ReceiveTask": "bpmn:ReceiveTask",
45
+ "SendTask": "bpmn:SendTask",
46
+ "ScriptTask": "bpmn:ScriptTask",
47
+ "ServiceTask": "bpmn:ServiceTask",
48
+ "UserTask": "bpmn:UserTask",
49
+ "ExclusiveGateway": "bpmn:ExclusiveGateway",
50
+ "ParallelGateway": "bpmn:ParallelGateway",
51
+ "InclusiveGateway": "bpmn:InclusiveGateway",
52
+ "EventBasedGateway": "bpmn:EventBasedGateway",
53
+ "ComplexGateway": "bpmn:ComplexGateway",
54
+ "Expression": "bpmn:Expression",
55
+ "FormalExpression": "bpmn:FormalExpression",
56
+ "DataObject": "bpmn:DataObject",
57
+ "DataObjectReference": "bpmn:DataObjectReference",
58
+ "DataStore": "bpmn:DataStore",
59
+ "DataStoreReference": "bpmn:DataStoreReference",
60
+ "DataInput": "bpmn:DataInput",
61
+ "DataOutput": "bpmn:DataOutput",
62
+ "InputSet": "bpmn:InputSet",
63
+ "OutputSet": "bpmn:OutputSet",
64
+ "InputOutputSpecification": "bpmn:InputOutputSpecification",
65
+ "DataInputAssociation": "bpmn:DataInputAssociation",
66
+ "DataOutputAssociation": "bpmn:DataOutputAssociation",
67
+ "Assignment": "bpmn:Assignment",
68
+ "Unspecified": "bpmn:Unspecified",
69
+ "Converging": "bpmn:Converging",
70
+ "Diverging": "bpmn:Diverging",
71
+ "Mixed": "bpmn:Mixed",
72
+ "Exclusive": "bpmn:Exclusive",
73
+ "Parallel": "bpmn:Parallel",
74
+ "Sequential": "bpmn:Sequential",
75
+ "Compensate": "bpmn:Compensate",
76
+ "Image": "bpmn:Image",
77
+ "Store": "bpmn:Store",
78
+ "None": "bpmn:None",
79
+ "One": "bpmn:One",
80
+ "Both": "bpmn:Both",
81
+ "Public": "bpmn:Public",
82
+ "Private": "bpmn:Private",
83
+ "name": "bpmn:name",
84
+ "flowElements": { "@id": "bpmn:flowElements", "@container": "@set" },
85
+ "laneSets": { "@id": "bpmn:laneSets", "@container": "@set" },
86
+ "lanes": { "@id": "bpmn:lanes", "@container": "@set" },
87
+ "flowNodeRef": { "@id": "bpmn:flowNodeRef", "@type": "@id", "@container": "@set" },
88
+ "childLaneSet": { "@id": "bpmn:childLaneSet" },
89
+ "partitionElement": { "@id": "bpmn:partitionElement" },
90
+ "partitionElementRef": { "@id": "bpmn:partitionElementRef", "@type": "@id" },
91
+ "gatewayDirection": { "@id": "bpmn:gatewayDirection", "@type": "@vocab" },
92
+ "eventGatewayType": { "@id": "bpmn:eventGatewayType", "@type": "@vocab" },
93
+ "processType": { "@id": "bpmn:processType", "@type": "@vocab" },
94
+ "isExecutable": { "@id": "bpmn:isExecutable", "@type": "xsd:boolean" },
95
+ "isImmediate": { "@id": "bpmn:isImmediate", "@type": "xsd:boolean" },
96
+ "isClosed": { "@id": "bpmn:isClosed", "@type": "xsd:boolean" },
97
+ "instantiate": { "@id": "bpmn:instantiate", "@type": "xsd:boolean" },
98
+ "implementation": "bpmn:implementation",
99
+ "script": "bpmn:script",
100
+ "scriptFormat": "bpmn:scriptFormat",
101
+ "eventDefinitionRef": { "@id": "bpmn:eventDefinitionRef", "@type": "@id", "@container": "@set" },
102
+ "eventDefinitions": { "@id": "bpmn:eventDefinitions", "@container": "@set" },
103
+ "attachedToRef": { "@id": "bpmn:attachedToRef", "@type": "@id" },
104
+ "cancelActivity": { "@id": "bpmn:cancelActivity", "@type": "xsd:boolean" },
105
+ "isInterrupting": { "@id": "bpmn:isInterrupting", "@type": "xsd:boolean" },
106
+ "triggeredByEvent": { "@id": "bpmn:triggeredByEvent", "@type": "xsd:boolean" },
107
+ "parallelMultiple": { "@id": "bpmn:parallelMultiple", "@type": "xsd:boolean" },
108
+ "timeDate": "bpmn:timeDate",
109
+ "timeDuration": "bpmn:timeDuration",
110
+ "timeCycle": "bpmn:timeCycle",
111
+ "errorCode": "bpmn:errorCode",
112
+ "escalationCode": "bpmn:escalationCode",
113
+ "waitForCompletion": { "@id": "bpmn:waitForCompletion", "@type": "xsd:boolean" },
114
+ "sourceRef": { "@id": "bpmn:sourceRef", "@type": "@id" },
115
+ "targetRef": { "@id": "bpmn:targetRef", "@type": "@id" },
116
+ "participants": { "@id": "bpmn:participants", "@container": "@set" },
117
+ "artifacts": { "@id": "bpmn:artifacts", "@container": "@set" },
118
+ "associationDirection": { "@id": "bpmn:associationDirection", "@type": "@vocab" },
119
+ "messageFlows": { "@id": "bpmn:messageFlows", "@container": "@set" },
120
+ "processRef": { "@id": "bpmn:processRef", "@type": "@id" },
121
+ "messageRef": { "@id": "bpmn:messageRef", "@type": "@id" },
122
+ "source": { "@id": "bpmn:source", "@type": "@id", "@container": "@set" },
123
+ "target": { "@id": "bpmn:target", "@type": "@id" },
124
+ "itemRef": { "@id": "bpmn:itemRef", "@type": "@id" },
125
+ "signalRef": { "@id": "bpmn:signalRef", "@type": "@id" },
126
+ "errorRef": { "@id": "bpmn:errorRef", "@type": "@id" },
127
+ "escalationRef": { "@id": "bpmn:escalationRef", "@type": "@id" },
128
+ "activityRef": { "@id": "bpmn:activityRef", "@type": "@id" },
129
+ "structureRef": { "@id": "bpmn:structureRef", "@type": "@id" },
130
+ "operationRef": { "@id": "bpmn:operationRef", "@type": "@id" },
131
+ "default": { "@id": "bpmn:default", "@type": "@id" },
132
+ "conditionExpression": { "@id": "bpmn:conditionExpression" },
133
+ "method": { "@id": "bpmn:method", "@type": "@vocab" },
134
+ "isForCompensation": { "@id": "bpmn:isForCompensation", "@type": "xsd:boolean" },
135
+ "startQuantity": { "@id": "bpmn:startQuantity", "@type": "xsd:nonNegativeInteger" },
136
+ "completionQuantity": { "@id": "bpmn:completionQuantity", "@type": "xsd:nonNegativeInteger" },
137
+ "completionCondition": { "@id": "bpmn:completionCondition" },
138
+ "condition": { "@id": "bpmn:condition" },
139
+ "activationCondition": { "@id": "bpmn:activationCondition" },
140
+ "evaluatesToTypeRef": { "@id": "bpmn:evaluatesToTypeRef", "@type": "@id" },
141
+ "ordering": { "@id": "bpmn:ordering", "@type": "@vocab" },
142
+ "cancelRemainingInstances": { "@id": "bpmn:cancelRemainingInstances", "@type": "xsd:boolean" },
143
+ "language": "bpmn:language",
144
+ "body": "bpmn:body",
145
+ "ioSpecification": { "@id": "bpmn:ioSpecification" },
146
+ "dataInputs": { "@id": "bpmn:dataInputs", "@container": "@set" },
147
+ "dataOutputs": { "@id": "bpmn:dataOutputs", "@container": "@set" },
148
+ "inputSets": { "@id": "bpmn:inputSets", "@container": "@set" },
149
+ "outputSets": { "@id": "bpmn:outputSets", "@container": "@set" },
150
+ "dataInputRefs": { "@id": "bpmn:dataInputRefs", "@type": "@id", "@container": "@set" },
151
+ "optionalInputRefs": { "@id": "bpmn:optionalInputRefs", "@type": "@id", "@container": "@set" },
152
+ "whileExecutingInputRefs": { "@id": "bpmn:whileExecutingInputRefs", "@type": "@id", "@container": "@set" },
153
+ "outputSetRefs": { "@id": "bpmn:outputSetRefs", "@type": "@id", "@container": "@set" },
154
+ "dataOutputRefs": { "@id": "bpmn:dataOutputRefs", "@type": "@id", "@container": "@set" },
155
+ "optionalOutputRefs": { "@id": "bpmn:optionalOutputRefs", "@type": "@id", "@container": "@set" },
156
+ "whileExecutingOutputRefs": { "@id": "bpmn:whileExecutingOutputRefs", "@type": "@id", "@container": "@set" },
157
+ "inputSetRefs": { "@id": "bpmn:inputSetRefs", "@type": "@id", "@container": "@set" },
158
+ "dataInputAssociations": { "@id": "bpmn:dataInputAssociations", "@container": "@set" },
159
+ "dataOutputAssociations": { "@id": "bpmn:dataOutputAssociations", "@container": "@set" },
160
+ "transformation": { "@id": "bpmn:transformation" },
161
+ "assignments": { "@id": "bpmn:assignments", "@container": "@set" },
162
+ "from": { "@id": "bpmn:from" },
163
+ "to": { "@id": "bpmn:to" },
164
+ "dataObjectRef": { "@id": "bpmn:dataObjectRef", "@type": "@id" },
165
+ "dataStoreRef": { "@id": "bpmn:dataStoreRef", "@type": "@id" },
166
+ "isCollection": { "@id": "bpmn:isCollection", "@type": "xsd:boolean" },
167
+ "capacity": { "@id": "bpmn:capacity", "@type": "xsd:integer" },
168
+ "isUnlimited": { "@id": "bpmn:isUnlimited", "@type": "xsd:boolean" }
169
+ }
170
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@protected": true,
5
+ "id": "@id",
6
+ "type": "@type",
7
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
8
+ "bpmndi": "https://bpmn-ld.example.org/di#",
9
+ "BPMNDiagram": "bpmndi:BPMNDiagram",
10
+ "BPMNPlane": "bpmndi:BPMNPlane",
11
+ "BPMNShape": "bpmndi:BPMNShape",
12
+ "BPMNEdge": "bpmndi:BPMNEdge",
13
+ "BPMNLabel": "bpmndi:BPMNLabel",
14
+ "Bounds": "bpmndi:Bounds",
15
+ "Point": "bpmndi:Point",
16
+ "plane": { "@id": "bpmndi:plane" },
17
+ "planeElements": { "@id": "bpmndi:planeElements", "@container": "@set" },
18
+ "bpmnElement": { "@id": "bpmndi:bpmnElement", "@type": "@id" },
19
+ "bounds": { "@id": "bpmndi:bounds" },
20
+ "label": { "@id": "bpmndi:label" },
21
+ "waypoints": { "@id": "bpmndi:waypoints", "@container": "@list" },
22
+ "sourceElement": { "@id": "bpmndi:sourceElement", "@type": "@id" },
23
+ "targetElement": { "@id": "bpmndi:targetElement", "@type": "@id" },
24
+ "initiating": "bpmndi:initiating",
25
+ "non_initiating": "bpmndi:non_initiating",
26
+ "resolution": { "@id": "bpmndi:resolution", "@type": "xsd:double" },
27
+ "messageVisibleKind": { "@id": "bpmndi:messageVisibleKind", "@type": "@vocab" },
28
+ "isExpanded": { "@id": "bpmndi:isExpanded", "@type": "xsd:boolean" },
29
+ "isHorizontal": { "@id": "bpmndi:isHorizontal", "@type": "xsd:boolean" },
30
+ "isMarkerVisible": { "@id": "bpmndi:isMarkerVisible", "@type": "xsd:boolean" },
31
+ "isMessageVisible": { "@id": "bpmndi:isMessageVisible", "@type": "xsd:boolean" },
32
+ "x": { "@id": "bpmndi:x", "@type": "xsd:double" },
33
+ "y": { "@id": "bpmndi:y", "@type": "xsd:double" },
34
+ "width": { "@id": "bpmndi:width", "@type": "xsd:double" },
35
+ "height": { "@id": "bpmndi:height", "@type": "xsd:double" }
36
+ }
37
+ }
@@ -0,0 +1,3 @@
1
+ import { type Finding } from "./findings.ts";
2
+ import type { Rule } from "./rules/rule.ts";
3
+ export declare const analyze: (document: unknown, base: string, rules?: Rule[]) => Promise<Finding[]>;
@@ -0,0 +1,11 @@
1
+ import { validateDocument } from "../validate.js";
2
+ import { STRUCTURAL_RULE } from "./findings.js";
3
+ import { rules as defaultRules } from "./rules/index.js";
4
+ import { buildScopes } from "./scope-graph.js";
5
+ export const analyze = async (document, base, rules = defaultRules) => {
6
+ const structure = await validateDocument(document, base);
7
+ if (!structure.valid) {
8
+ return structure.errors.map((message) => ({ rule: STRUCTURAL_RULE, severity: "error", node: null, message }));
9
+ }
10
+ return buildScopes(structure.expanded).flatMap((scope) => rules.flatMap((rule) => rule.check(scope)));
11
+ };
@@ -0,0 +1,8 @@
1
+ export type Severity = "error" | "warning";
2
+ export interface Finding {
3
+ rule: string;
4
+ severity: Severity;
5
+ node: string | null;
6
+ message: string;
7
+ }
8
+ export declare const STRUCTURAL_RULE = "structural-validity";
@@ -0,0 +1 @@
1
+ export const STRUCTURAL_RULE = "structural-validity";
@@ -0,0 +1,3 @@
1
+ import type { Finding } from "./findings.ts";
2
+ export declare const formatJson: (findings: Finding[]) => string;
3
+ export declare const formatText: (findings: Finding[]) => string;
@@ -0,0 +1,9 @@
1
+ const count = (findings, severity) => findings.filter((f) => f.severity === severity).length;
2
+ export const formatJson = (findings) => `${JSON.stringify({ findings, summary: { errors: count(findings, "error"), warnings: count(findings, "warning") } }, null, 2)}\n`;
3
+ export const formatText = (findings) => {
4
+ if (findings.length === 0)
5
+ return "no findings\n";
6
+ const lines = findings.map((f) => `${f.severity} ${f.rule} ${f.node ?? "-"}: ${f.message}`);
7
+ lines.push(`${count(findings, "error")} error(s), ${count(findings, "warning")} warning(s)`);
8
+ return `${lines.join("\n")}\n`;
9
+ };
@@ -0,0 +1,2 @@
1
+ import type { Rule } from "./rule.ts";
2
+ export declare const adHocCompletionConditionRule: Rule;
@@ -0,0 +1,7 @@
1
+ export const adHocCompletionConditionRule = {
2
+ id: "ad-hoc-completion-condition-missing",
3
+ severity: "warning",
4
+ check: (scope) => scope.adHoc && !scope.completionCondition
5
+ ? [{ rule: "ad-hoc-completion-condition-missing", severity: "warning", node: scope.id, message: "ad-hoc sub-process has no completion condition, so nothing defines when it ends" }]
6
+ : [],
7
+ };
@@ -0,0 +1,2 @@
1
+ import type { Rule } from "./rule.ts";
2
+ export declare const cannotReachEndRule: Rule;
@@ -0,0 +1,28 @@
1
+ import { hasType } from "../scope-graph.js";
2
+ export const cannotReachEndRule = {
3
+ id: "node-cannot-reach-end",
4
+ severity: "warning",
5
+ check: (scope) => {
6
+ const ends = scope.nodes.filter((node) => hasType(node, "EndEvent"));
7
+ if (scope.adHoc || ends.length === 0)
8
+ return [];
9
+ const predecessors = new Map();
10
+ const link = (from, to) => predecessors.set(to, [...(predecessors.get(to) ?? []), from]);
11
+ scope.flows.forEach((flow) => flow.source !== null && flow.target !== null && link(flow.source, flow.target));
12
+ scope.nodes.forEach((node) => node.attachedTo !== null && link(node.attachedTo, node.id));
13
+ const reaching = new Set(ends.map((node) => node.id));
14
+ const queue = [...reaching];
15
+ while (queue.length > 0) {
16
+ for (const previous of predecessors.get(queue.shift()) ?? []) {
17
+ if (!reaching.has(previous)) {
18
+ reaching.add(previous);
19
+ queue.push(previous);
20
+ }
21
+ }
22
+ }
23
+ const sources = new Set(scope.flows.map((flow) => flow.source));
24
+ return scope.nodes
25
+ .filter((node) => !node.exempt && !reaching.has(node.id) && sources.has(node.id))
26
+ .map((node) => ({ rule: "node-cannot-reach-end", severity: "warning", node: node.id, message: "no end event can be reached from this flow node" }));
27
+ },
28
+ };
@@ -0,0 +1,2 @@
1
+ import type { Rule } from "./rule.ts";
2
+ export declare const compensationAssociationRule: Rule;