shacl2code 0.0.18__tar.gz → 0.0.20__tar.gz

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 (257) hide show
  1. {shacl2code-0.0.18 → shacl2code-0.0.20}/.github/workflows/coverage-generate.yaml +7 -4
  2. {shacl2code-0.0.18 → shacl2code-0.0.20}/.github/workflows/coverage-report.yaml +4 -1
  3. {shacl2code-0.0.18 → shacl2code-0.0.20}/.github/workflows/publish.yaml +3 -3
  4. shacl2code-0.0.20/.github/workflows/scorecard.yml +73 -0
  5. {shacl2code-0.0.18 → shacl2code-0.0.20}/.github/workflows/test.yaml +7 -7
  6. {shacl2code-0.0.18 → shacl2code-0.0.20}/PKG-INFO +15 -8
  7. {shacl2code-0.0.18 → shacl2code-0.0.20}/README.md +14 -7
  8. shacl2code-0.0.20/SECURITY.md +13 -0
  9. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/errorhandler.cpp.j2 +2 -2
  10. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/extensible.hpp.j2 +1 -1
  11. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/header.j2 +8 -0
  12. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/object.hpp.j2 +1 -1
  13. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectpath.cpp.j2 +1 -1
  14. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/classes.go.j2 +34 -13
  15. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/reflistproperty.go.j2 +17 -0
  16. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/shaclobjectset.go.j2 +63 -6
  17. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/jsonschema.j2 +6 -0
  18. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/python.j2 +14 -1
  19. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/model.py +7 -1
  20. shacl2code-0.0.20/src/shacl2code/version.py +1 -0
  21. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/model/test-context.json +10 -0
  22. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/model/test.ttl +31 -0
  23. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_common_jinja.py +1 -1
  24. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_cpp.py +12 -34
  25. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_golang.py +17 -36
  26. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_jsonschema.py +6 -37
  27. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_model_source.py +44 -54
  28. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_python.py +26 -44
  29. shacl2code-0.0.18/src/shacl2code/version.py +0 -1
  30. shacl2code-0.0.18/tests/expect/cpp/context/Doxyfile +0 -2623
  31. shacl2code-0.0.18/tests/expect/cpp/context/Makefile +0 -106
  32. shacl2code-0.0.18/tests/expect/cpp/context/api.hpp +0 -49
  33. shacl2code-0.0.18/tests/expect/cpp/context/datetime.cpp +0 -141
  34. shacl2code-0.0.18/tests/expect/cpp/context/datetime.hpp +0 -123
  35. shacl2code-0.0.18/tests/expect/cpp/context/decode.cpp +0 -43
  36. shacl2code-0.0.18/tests/expect/cpp/context/decode.hpp +0 -317
  37. shacl2code-0.0.18/tests/expect/cpp/context/encode.cpp +0 -93
  38. shacl2code-0.0.18/tests/expect/cpp/context/encode.hpp +0 -360
  39. shacl2code-0.0.18/tests/expect/cpp/context/errorhandler.cpp +0 -52
  40. shacl2code-0.0.18/tests/expect/cpp/context/errorhandler.hpp +0 -159
  41. shacl2code-0.0.18/tests/expect/cpp/context/exceptions.hpp +0 -119
  42. shacl2code-0.0.18/tests/expect/cpp/context/extensible.cpp +0 -199
  43. shacl2code-0.0.18/tests/expect/cpp/context/extensible.hpp +0 -207
  44. shacl2code-0.0.18/tests/expect/cpp/context/link.cpp +0 -35
  45. shacl2code-0.0.18/tests/expect/cpp/context/link.hpp +0 -72
  46. shacl2code-0.0.18/tests/expect/cpp/context/namedindividual.cpp +0 -58
  47. shacl2code-0.0.18/tests/expect/cpp/context/namedindividual.hpp +0 -126
  48. shacl2code-0.0.18/tests/expect/cpp/context/object.cpp +0 -317
  49. shacl2code-0.0.18/tests/expect/cpp/context/object.hpp +0 -358
  50. shacl2code-0.0.18/tests/expect/cpp/context/objectpath.cpp +0 -94
  51. shacl2code-0.0.18/tests/expect/cpp/context/objectpath.hpp +0 -187
  52. shacl2code-0.0.18/tests/expect/cpp/context/objectset.cpp +0 -325
  53. shacl2code-0.0.18/tests/expect/cpp/context/objectset.hpp +0 -245
  54. shacl2code-0.0.18/tests/expect/cpp/context/prop.hpp +0 -252
  55. shacl2code-0.0.18/tests/expect/cpp/context/property.cpp +0 -465
  56. shacl2code-0.0.18/tests/expect/cpp/context/property.hpp +0 -498
  57. shacl2code-0.0.18/tests/expect/cpp/context/propertyvalue.cpp +0 -52
  58. shacl2code-0.0.18/tests/expect/cpp/context/propertyvalue.hpp +0 -1053
  59. shacl2code-0.0.18/tests/expect/cpp/context/ref.hpp +0 -448
  60. shacl2code-0.0.18/tests/expect/cpp/context/refproperty.cpp +0 -36
  61. shacl2code-0.0.18/tests/expect/cpp/context/refproperty.hpp +0 -227
  62. shacl2code-0.0.18/tests/expect/cpp/context/test-context-jsonld.cpp +0 -25248
  63. shacl2code-0.0.18/tests/expect/cpp/context/test-context-jsonld.hpp +0 -327
  64. shacl2code-0.0.18/tests/expect/cpp/context/test-context-validate.cpp +0 -142
  65. shacl2code-0.0.18/tests/expect/cpp/context/test-context.cpp +0 -835
  66. shacl2code-0.0.18/tests/expect/cpp/context/test-context.hpp +0 -1210
  67. shacl2code-0.0.18/tests/expect/cpp/context/test-context.pc +0 -10
  68. shacl2code-0.0.18/tests/expect/cpp/context/type.cpp +0 -39
  69. shacl2code-0.0.18/tests/expect/cpp/context/type.hpp +0 -309
  70. shacl2code-0.0.18/tests/expect/cpp/context/util.cpp +0 -35
  71. shacl2code-0.0.18/tests/expect/cpp/context/util.hpp +0 -54
  72. shacl2code-0.0.18/tests/expect/cpp/context/walk.hpp +0 -103
  73. shacl2code-0.0.18/tests/expect/cpp/nocontext/Doxyfile +0 -2623
  74. shacl2code-0.0.18/tests/expect/cpp/nocontext/Makefile +0 -106
  75. shacl2code-0.0.18/tests/expect/cpp/nocontext/api.hpp +0 -49
  76. shacl2code-0.0.18/tests/expect/cpp/nocontext/datetime.cpp +0 -141
  77. shacl2code-0.0.18/tests/expect/cpp/nocontext/datetime.hpp +0 -123
  78. shacl2code-0.0.18/tests/expect/cpp/nocontext/decode.cpp +0 -43
  79. shacl2code-0.0.18/tests/expect/cpp/nocontext/decode.hpp +0 -317
  80. shacl2code-0.0.18/tests/expect/cpp/nocontext/encode.cpp +0 -93
  81. shacl2code-0.0.18/tests/expect/cpp/nocontext/encode.hpp +0 -360
  82. shacl2code-0.0.18/tests/expect/cpp/nocontext/errorhandler.cpp +0 -52
  83. shacl2code-0.0.18/tests/expect/cpp/nocontext/errorhandler.hpp +0 -159
  84. shacl2code-0.0.18/tests/expect/cpp/nocontext/exceptions.hpp +0 -119
  85. shacl2code-0.0.18/tests/expect/cpp/nocontext/extensible.cpp +0 -199
  86. shacl2code-0.0.18/tests/expect/cpp/nocontext/extensible.hpp +0 -207
  87. shacl2code-0.0.18/tests/expect/cpp/nocontext/link.cpp +0 -35
  88. shacl2code-0.0.18/tests/expect/cpp/nocontext/link.hpp +0 -72
  89. shacl2code-0.0.18/tests/expect/cpp/nocontext/namedindividual.cpp +0 -58
  90. shacl2code-0.0.18/tests/expect/cpp/nocontext/namedindividual.hpp +0 -126
  91. shacl2code-0.0.18/tests/expect/cpp/nocontext/object.cpp +0 -317
  92. shacl2code-0.0.18/tests/expect/cpp/nocontext/object.hpp +0 -358
  93. shacl2code-0.0.18/tests/expect/cpp/nocontext/objectpath.cpp +0 -94
  94. shacl2code-0.0.18/tests/expect/cpp/nocontext/objectpath.hpp +0 -187
  95. shacl2code-0.0.18/tests/expect/cpp/nocontext/objectset.cpp +0 -324
  96. shacl2code-0.0.18/tests/expect/cpp/nocontext/objectset.hpp +0 -245
  97. shacl2code-0.0.18/tests/expect/cpp/nocontext/prop.hpp +0 -252
  98. shacl2code-0.0.18/tests/expect/cpp/nocontext/property.cpp +0 -465
  99. shacl2code-0.0.18/tests/expect/cpp/nocontext/property.hpp +0 -498
  100. shacl2code-0.0.18/tests/expect/cpp/nocontext/propertyvalue.cpp +0 -52
  101. shacl2code-0.0.18/tests/expect/cpp/nocontext/propertyvalue.hpp +0 -1053
  102. shacl2code-0.0.18/tests/expect/cpp/nocontext/ref.hpp +0 -448
  103. shacl2code-0.0.18/tests/expect/cpp/nocontext/refproperty.cpp +0 -36
  104. shacl2code-0.0.18/tests/expect/cpp/nocontext/refproperty.hpp +0 -227
  105. shacl2code-0.0.18/tests/expect/cpp/nocontext/test-jsonld.cpp +0 -25248
  106. shacl2code-0.0.18/tests/expect/cpp/nocontext/test-jsonld.hpp +0 -327
  107. shacl2code-0.0.18/tests/expect/cpp/nocontext/test-validate.cpp +0 -142
  108. shacl2code-0.0.18/tests/expect/cpp/nocontext/test.cpp +0 -820
  109. shacl2code-0.0.18/tests/expect/cpp/nocontext/test.hpp +0 -1082
  110. shacl2code-0.0.18/tests/expect/cpp/nocontext/test.pc +0 -10
  111. shacl2code-0.0.18/tests/expect/cpp/nocontext/type.cpp +0 -39
  112. shacl2code-0.0.18/tests/expect/cpp/nocontext/type.hpp +0 -309
  113. shacl2code-0.0.18/tests/expect/cpp/nocontext/util.cpp +0 -35
  114. shacl2code-0.0.18/tests/expect/cpp/nocontext/util.hpp +0 -54
  115. shacl2code-0.0.18/tests/expect/cpp/nocontext/walk.hpp +0 -103
  116. shacl2code-0.0.18/tests/expect/golang/context/test-context/classes.go +0 -3895
  117. shacl2code-0.0.18/tests/expect/golang/context/test-context/decode.go +0 -334
  118. shacl2code-0.0.18/tests/expect/golang/context/test-context/encode.go +0 -73
  119. shacl2code-0.0.18/tests/expect/golang/context/test-context/errorhandler.go +0 -11
  120. shacl2code-0.0.18/tests/expect/golang/context/test-context/errors.go +0 -44
  121. shacl2code-0.0.18/tests/expect/golang/context/test-context/extensible.go +0 -47
  122. shacl2code-0.0.18/tests/expect/golang/context/test-context/linkstate.go +0 -12
  123. shacl2code-0.0.18/tests/expect/golang/context/test-context/listproperty.go +0 -112
  124. shacl2code-0.0.18/tests/expect/golang/context/test-context/optional.go +0 -34
  125. shacl2code-0.0.18/tests/expect/golang/context/test-context/path.go +0 -30
  126. shacl2code-0.0.18/tests/expect/golang/context/test-context/property.go +0 -99
  127. shacl2code-0.0.18/tests/expect/golang/context/test-context/ref.go +0 -91
  128. shacl2code-0.0.18/tests/expect/golang/context/test-context/reflistproperty.go +0 -42
  129. shacl2code-0.0.18/tests/expect/golang/context/test-context/refproperty.go +0 -89
  130. shacl2code-0.0.18/tests/expect/golang/context/test-context/shaclobject.go +0 -127
  131. shacl2code-0.0.18/tests/expect/golang/context/test-context/shaclobjectset.go +0 -299
  132. shacl2code-0.0.18/tests/expect/golang/context/test-context/shacltype.go +0 -177
  133. shacl2code-0.0.18/tests/expect/golang/context/test-context/util.go +0 -26
  134. shacl2code-0.0.18/tests/expect/golang/context/test-context/validator.go +0 -107
  135. shacl2code-0.0.18/tests/expect/golang/nocontext/test/classes.go +0 -3866
  136. shacl2code-0.0.18/tests/expect/golang/nocontext/test/decode.go +0 -334
  137. shacl2code-0.0.18/tests/expect/golang/nocontext/test/encode.go +0 -73
  138. shacl2code-0.0.18/tests/expect/golang/nocontext/test/errorhandler.go +0 -11
  139. shacl2code-0.0.18/tests/expect/golang/nocontext/test/errors.go +0 -44
  140. shacl2code-0.0.18/tests/expect/golang/nocontext/test/extensible.go +0 -47
  141. shacl2code-0.0.18/tests/expect/golang/nocontext/test/linkstate.go +0 -12
  142. shacl2code-0.0.18/tests/expect/golang/nocontext/test/listproperty.go +0 -112
  143. shacl2code-0.0.18/tests/expect/golang/nocontext/test/optional.go +0 -34
  144. shacl2code-0.0.18/tests/expect/golang/nocontext/test/path.go +0 -30
  145. shacl2code-0.0.18/tests/expect/golang/nocontext/test/property.go +0 -99
  146. shacl2code-0.0.18/tests/expect/golang/nocontext/test/ref.go +0 -91
  147. shacl2code-0.0.18/tests/expect/golang/nocontext/test/reflistproperty.go +0 -42
  148. shacl2code-0.0.18/tests/expect/golang/nocontext/test/refproperty.go +0 -89
  149. shacl2code-0.0.18/tests/expect/golang/nocontext/test/shaclobject.go +0 -127
  150. shacl2code-0.0.18/tests/expect/golang/nocontext/test/shaclobjectset.go +0 -299
  151. shacl2code-0.0.18/tests/expect/golang/nocontext/test/shacltype.go +0 -177
  152. shacl2code-0.0.18/tests/expect/golang/nocontext/test/util.go +0 -26
  153. shacl2code-0.0.18/tests/expect/golang/nocontext/test/validator.go +0 -107
  154. shacl2code-0.0.18/tests/expect/jsonschema/context/test-context.json +0 -1435
  155. shacl2code-0.0.18/tests/expect/jsonschema/nocontext/test.json +0 -1426
  156. shacl2code-0.0.18/tests/expect/make_expect.py +0 -100
  157. shacl2code-0.0.18/tests/expect/python/context/test-context.py +0 -2561
  158. shacl2code-0.0.18/tests/expect/python/nocontext/test.py +0 -2516
  159. shacl2code-0.0.18/tests/expect/raw/context/test-context.txt +0 -54
  160. shacl2code-0.0.18/tests/expect/raw/nocontext/test.txt +0 -28
  161. {shacl2code-0.0.18 → shacl2code-0.0.20}/.flake8 +0 -0
  162. {shacl2code-0.0.18 → shacl2code-0.0.20}/.gitignore +0 -0
  163. {shacl2code-0.0.18 → shacl2code-0.0.20}/LICENSE +0 -0
  164. {shacl2code-0.0.18 → shacl2code-0.0.20}/pyproject.toml +0 -0
  165. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/__init__.py +0 -0
  166. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/__main__.py +0 -0
  167. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/context.py +0 -0
  168. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/__init__.py +0 -0
  169. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/common.py +0 -0
  170. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/cpp.py +0 -0
  171. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/golang.py +0 -0
  172. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/jinja.py +0 -0
  173. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/jsonschema.py +0 -0
  174. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/lang.py +0 -0
  175. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/python.py +0 -0
  176. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/sources/cpp/json.hpp +0 -0
  177. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/Doxyfile.j2 +0 -0
  178. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/Makefile.j2 +0 -0
  179. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/api.hpp.j2 +0 -0
  180. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/datetime.cpp.j2 +0 -0
  181. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/datetime.hpp.j2 +0 -0
  182. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/decode.cpp.j2 +0 -0
  183. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/decode.hpp.j2 +0 -0
  184. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/encode.cpp.j2 +0 -0
  185. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/encode.hpp.j2 +0 -0
  186. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/errorhandler.hpp.j2 +0 -0
  187. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/exceptions.hpp.j2 +0 -0
  188. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/extensible.cpp.j2 +0 -0
  189. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/jsonld-header.j2 +0 -0
  190. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/jsonld-source.j2 +0 -0
  191. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/link.cpp.j2 +0 -0
  192. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/link.hpp.j2 +0 -0
  193. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/namedindividual.cpp.j2 +0 -0
  194. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/namedindividual.hpp.j2 +0 -0
  195. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/object.cpp.j2 +0 -0
  196. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectpath.hpp.j2 +0 -0
  197. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectset.cpp.j2 +0 -0
  198. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectset.hpp.j2 +0 -0
  199. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/pkgconfig.pc.j2 +0 -0
  200. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/prop.hpp.j2 +0 -0
  201. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/property.cpp.j2 +0 -0
  202. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/property.hpp.j2 +0 -0
  203. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/propertyvalue.cpp.j2 +0 -0
  204. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/propertyvalue.hpp.j2 +0 -0
  205. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/ref.hpp.j2 +0 -0
  206. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/refproperty.cpp.j2 +0 -0
  207. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/refproperty.hpp.j2 +0 -0
  208. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/source.j2 +0 -0
  209. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/type.cpp.j2 +0 -0
  210. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/type.hpp.j2 +0 -0
  211. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/util.cpp.j2 +0 -0
  212. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/util.hpp.j2 +0 -0
  213. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/validate.j2 +0 -0
  214. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/walk.hpp.j2 +0 -0
  215. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/decode.go.j2 +0 -0
  216. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/encode.go.j2 +0 -0
  217. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/errorhandler.go.j2 +0 -0
  218. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/errors.go.j2 +0 -0
  219. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/extensible.go.j2 +0 -0
  220. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/linkstate.go.j2 +0 -0
  221. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/listproperty.go.j2 +0 -0
  222. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/optional.go.j2 +0 -0
  223. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/path.go.j2 +0 -0
  224. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/property.go.j2 +0 -0
  225. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/ref.go.j2 +0 -0
  226. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/refproperty.go.j2 +0 -0
  227. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/shaclobject.go.j2 +0 -0
  228. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/shacltype.go.j2 +0 -0
  229. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/util.go.j2 +0 -0
  230. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/validator.go.j2 +0 -0
  231. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/main.py +0 -0
  232. {shacl2code-0.0.18 → shacl2code-0.0.20}/src/shacl2code/urlcontext.py +0 -0
  233. {shacl2code-0.0.18 → shacl2code-0.0.20}/testfixtures/testfixtures/__init__.py +0 -0
  234. {shacl2code-0.0.18 → shacl2code-0.0.20}/testfixtures/testfixtures/httpserver.py +0 -0
  235. {shacl2code-0.0.18 → shacl2code-0.0.20}/testfixtures/testfixtures/jsonvalidation.py +0 -0
  236. {shacl2code-0.0.18 → shacl2code-0.0.20}/testfixtures/testfixtures/timetests.py +0 -0
  237. {shacl2code-0.0.18 → shacl2code-0.0.20}/testfixtures/testfixtures/utils.py +0 -0
  238. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/conftest.py +0 -0
  239. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/abort.j2 +0 -0
  240. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/bad-id.j2 +0 -0
  241. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/bad-node-kind.ttl +0 -0
  242. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/bad-pattern-class.ttl +0 -0
  243. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/bad-pattern-integer.ttl +0 -0
  244. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/bad-prop-type.ttl +0 -0
  245. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/bad-reference.jsonld +0 -0
  246. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/context-url.j2 +0 -0
  247. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/context.j2 +0 -0
  248. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/links.json +0 -0
  249. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/missing-range.ttl +0 -0
  250. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/python/bad-object-type-inline.json +0 -0
  251. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/python/bad-object-type-ref-after.json +0 -0
  252. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/python/bad-object-type-ref-before.json +0 -0
  253. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/raw.j2 +0 -0
  254. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/data/roundtrip.json +0 -0
  255. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_cli.py +0 -0
  256. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_common_prefix.py +0 -0
  257. {shacl2code-0.0.18 → shacl2code-0.0.20}/tests/test_context.py +0 -0
@@ -7,6 +7,9 @@ on:
7
7
  branches:
8
8
  - "main"
9
9
 
10
+ permissions:
11
+ contents: read
12
+
10
13
  jobs:
11
14
  coverage:
12
15
  name: Generate coverage report
@@ -20,9 +23,9 @@ jobs:
20
23
  # comments (to avoid publishing multiple comments in the same PR)
21
24
  contents: write
22
25
  steps:
23
- - uses: actions/checkout@v4
26
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24
27
  - name: Setup Python ${{ matrix.python-version }}
25
- uses: actions/setup-python@v4
28
+ uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
26
29
  with:
27
30
  python-version: "3.11"
28
31
  - name: Install dependencies
@@ -36,11 +39,11 @@ jobs:
36
39
  pytest -v
37
40
  - name: Coverage comment
38
41
  id: coverage_comment
39
- uses: py-cov-action/python-coverage-comment-action@v3
42
+ uses: py-cov-action/python-coverage-comment-action@2b84cfb222691291ba358a586c13606f0a9c172c # v3
40
43
  with:
41
44
  GITHUB_TOKEN: ${{ github.token }}
42
45
  - name: Store Pull Request comment to be posted
43
- uses: actions/upload-artifact@v4
46
+ uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
44
47
  if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
45
48
  with:
46
49
  # If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
@@ -7,6 +7,9 @@ on:
7
7
  types:
8
8
  - completed
9
9
 
10
+ permissions:
11
+ contents: read
12
+
10
13
  jobs:
11
14
  report-coverage:
12
15
  name: Report coverage
@@ -27,7 +30,7 @@ jobs:
27
30
  # DO NOT run actions/checkout here, for security reasons
28
31
  # For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
29
32
  - name: Post comment
30
- uses: py-cov-action/python-coverage-comment-action@v3
33
+ uses: py-cov-action/python-coverage-comment-action@2b84cfb222691291ba358a586c13606f0a9c172c # v3
31
34
  with:
32
35
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
36
  GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
@@ -18,10 +18,10 @@ jobs:
18
18
  id-token: write
19
19
 
20
20
  steps:
21
- - uses: actions/checkout@v4
21
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22
22
 
23
23
  - name: Set up Python
24
- uses: actions/setup-python@v4
24
+ uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
25
25
  with:
26
26
  python-version: '3.x'
27
27
 
@@ -34,4 +34,4 @@ jobs:
34
34
  run: python -m build
35
35
 
36
36
  - name: Publish distribution to PyPI
37
- uses: pypa/gh-action-pypi-publish@release/v1
37
+ uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
@@ -0,0 +1,73 @@
1
+ # This workflow uses actions that are not certified by GitHub. They are provided
2
+ # by a third-party and are governed by separate terms of service, privacy
3
+ # policy, and support documentation.
4
+
5
+ name: Scorecard supply-chain security
6
+ on:
7
+ # For Branch-Protection check. Only the default branch is supported. See
8
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9
+ branch_protection_rule:
10
+ # To guarantee Maintained check is occasionally updated. See
11
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12
+ schedule:
13
+ - cron: '36 2 * * 4'
14
+ push:
15
+ branches: [ "main" ]
16
+
17
+ # Declare default permissions as read only.
18
+ permissions: read-all
19
+
20
+ jobs:
21
+ analysis:
22
+ name: Scorecard analysis
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ # Needed to upload the results to code-scanning dashboard.
26
+ security-events: write
27
+ # Needed to publish results and get a badge (see publish_results below).
28
+ id-token: write
29
+ # Uncomment the permissions below if installing in a private repository.
30
+ # contents: read
31
+ # actions: read
32
+
33
+ steps:
34
+ - name: "Checkout code"
35
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
36
+ with:
37
+ persist-credentials: false
38
+
39
+ - name: "Run analysis"
40
+ uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
41
+ with:
42
+ results_file: results.sarif
43
+ results_format: sarif
44
+ # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
45
+ # - you want to enable the Branch-Protection check on a *public* repository, or
46
+ # - you are installing Scorecard on a *private* repository
47
+ # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
48
+ # repo_token: ${{ secrets.SCORECARD_TOKEN }}
49
+
50
+ # Public repositories:
51
+ # - Publish results to OpenSSF REST API for easy access by consumers
52
+ # - Allows the repository to include the Scorecard badge.
53
+ # - See https://github.com/ossf/scorecard-action#publishing-results.
54
+ # For private repositories:
55
+ # - `publish_results` will always be set to `false`, regardless
56
+ # of the value entered here.
57
+ publish_results: true
58
+
59
+ # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
60
+ # format to the repository Actions tab.
61
+ #- name: "Upload artifact"
62
+ # uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
63
+ # with:
64
+ # name: sarif-file
65
+ # path: results.sarif
66
+ # retention-days: 5
67
+
68
+ # Upload the results to GitHub's code scanning dashboard (optional).
69
+ # Commenting out will disable upload of results to your repo's Code Scanning dashboard
70
+ - name: "Upload to code-scanning"
71
+ uses: github/codeql-action/upload-sarif@v3
72
+ with:
73
+ sarif_file: results.sarif
@@ -17,13 +17,13 @@ jobs:
17
17
  - "3.11"
18
18
  - "3.12"
19
19
  steps:
20
- - uses: actions/checkout@v4
20
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21
21
  - name: Setup Python ${{ matrix.python-version }}
22
- uses: actions/setup-python@v4
22
+ uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
23
23
  with:
24
24
  python-version: ${{ matrix.python-version }}
25
25
  - name: Setup Node
26
- uses: actions/setup-node@v4
26
+ uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
27
27
  with:
28
28
  node-version: 20
29
29
  - name: Install dependencies
@@ -44,10 +44,10 @@ jobs:
44
44
  lint:
45
45
  runs-on: ubuntu-latest
46
46
  steps:
47
- - uses: actions/checkout@v4
47
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
48
48
  - name: Setup Python
49
- uses: actions/setup-python@v4
49
+ uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
50
50
  with:
51
51
  python-version: "3.11"
52
- - uses: psf/black@stable
53
- - uses: py-actions/flake8@v2
52
+ - uses: psf/black@8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # 25.1.0
53
+ - uses: py-actions/flake8@84ec6726560b6d5bd68f2a5bed83d62b52bb50ba # v2.3.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shacl2code
3
- Version: 0.0.18
3
+ Version: 0.0.20
4
4
  Summary: Convert SHACL model file to code bindings
5
5
  Project-URL: Homepage, https://github.com/JPEWdev/shacl2code
6
6
  Project-URL: Repository, https://github.com/JPEWdev/shacl2code.git
@@ -29,6 +29,9 @@ Requires-Dist: pytest>=7.4; extra == 'dev'
29
29
  Description-Content-Type: text/markdown
30
30
 
31
31
  # Convert SHACL Model to code bindings
32
+
33
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9999/badge)](https://www.bestpractices.dev/projects/9999)
34
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/JPEWdev/shacl2code/badge)](https://scorecard.dev/viewer/?uri=github.com/JPEWdev/shacl2code)
32
35
  [![Coverage Report](https://raw.githubusercontent.com/JPEWdev/shacl2code/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/JPEWdev/shacl2code/blob/python-coverage-comment-action-data/htmlcov/index.html)
33
36
 
34
37
  This tool can be used to convert a SHACL model into various code bindings
@@ -44,24 +47,31 @@ python3 -m pip install shacl2code
44
47
  ## Usage
45
48
 
46
49
  `shacl2code` can generate bindings from either a local file:
50
+
47
51
  ```shell
48
52
  shacl2code generate -i model.jsonld python -o out.py
49
53
  ```
54
+
50
55
  Or from a URL:
56
+
51
57
  ```shell
52
58
  shacl2code generate -i https://example.com/rdf/model.jsonld python -o out.py
53
59
  ```
60
+
54
61
  Or from stdin:
62
+
55
63
  ```shell
56
64
  cat model.jsonld | shacl2code generate -i - python -o - > out.py
57
65
  ```
58
66
 
59
67
  For more information, run:
68
+
60
69
  ```shell
61
70
  shacl2code --help
62
71
  ```
63
72
 
64
73
  The available language bindings can be viewed by running:
74
+
65
75
  ```shell
66
76
  shacl2code list
67
77
  ```
@@ -82,6 +92,7 @@ pip install -e ".[dev]"
82
92
 
83
93
  `shacl2code` has a test suite written in [pytest][pytest]. To run it, setup a
84
94
  virtual environment as shown above, then run:
95
+
85
96
  ```shell
86
97
  pytest
87
98
  ```
@@ -89,7 +100,6 @@ pytest
89
100
  In addition to the test results, a test coverage report will also be generated
90
101
  using [pytest-cov][pytest-cov]
91
102
 
92
-
93
103
  ## Custom Annotations
94
104
 
95
105
  `shacl2code` supports a number of custom annotations that can be specified in a
@@ -118,6 +128,7 @@ turtle will use `MyId` instead of `@id` when writing JSON-LD bindings:
118
128
  ```
119
129
 
120
130
  When doing this, the class would then look like this in JSON-LD:
131
+
121
132
  ```json
122
133
  {
123
134
  "@type": "MyClass",
@@ -125,7 +136,7 @@ When doing this, the class would then look like this in JSON-LD:
125
136
  }
126
137
  ```
127
138
 
128
- The `idProperyName` annotation is inherited by derived classes, so for example
139
+ The `idPropertyName` annotation is inherited by derived classes, so for example
129
140
  any class that derived from `MyClass` would also use `MyId` as the subject
130
141
  property.
131
142
 
@@ -157,7 +168,6 @@ indicates if a class can be extended, and defaults to `false`. For example, the
157
168
  following turtle will declare a class as extensible:
158
169
 
159
170
  ```ttl
160
-
161
171
  <MyClass> a owl:Class, sh:NodeShape ;
162
172
  sh-to-code:isExtensible true
163
173
  .
@@ -193,14 +203,12 @@ a constraint on the shape that it cannot be of its own type. This can be done
193
203
  with the following turtle:
194
204
 
195
205
  ```ttl
196
-
197
206
  <MyClass> a owl:Class, sh:NodeShape ;
198
- # SHACL to prevent a class from being instansiated as this exact type
207
+ # SHACL to prevent a class from being instantiated as this exact type
199
208
  sh:property [
200
209
  sh:path rdf:type ;
201
210
  sh:not [ sh:hasValue <MyClass> ]
202
211
  ] .
203
-
204
212
  ```
205
213
 
206
214
  `shacl2code` will detect this pattern and generate abstract bindings for
@@ -216,7 +224,6 @@ abstract. This can be done with the boolean `isAbstract` property. For
216
224
  example, the following turtle will declare a class as abstract:
217
225
 
218
226
  ```ttl
219
-
220
227
  <MyClass> a owl:Class, sh:NodeShape ;
221
228
  sh-to-code:isAbstract true
222
229
  .
@@ -1,4 +1,7 @@
1
1
  # Convert SHACL Model to code bindings
2
+
3
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9999/badge)](https://www.bestpractices.dev/projects/9999)
4
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/JPEWdev/shacl2code/badge)](https://scorecard.dev/viewer/?uri=github.com/JPEWdev/shacl2code)
2
5
  [![Coverage Report](https://raw.githubusercontent.com/JPEWdev/shacl2code/python-coverage-comment-action-data/badge.svg)](https://htmlpreview.github.io/?https://github.com/JPEWdev/shacl2code/blob/python-coverage-comment-action-data/htmlcov/index.html)
3
6
 
4
7
  This tool can be used to convert a SHACL model into various code bindings
@@ -14,24 +17,31 @@ python3 -m pip install shacl2code
14
17
  ## Usage
15
18
 
16
19
  `shacl2code` can generate bindings from either a local file:
20
+
17
21
  ```shell
18
22
  shacl2code generate -i model.jsonld python -o out.py
19
23
  ```
24
+
20
25
  Or from a URL:
26
+
21
27
  ```shell
22
28
  shacl2code generate -i https://example.com/rdf/model.jsonld python -o out.py
23
29
  ```
30
+
24
31
  Or from stdin:
32
+
25
33
  ```shell
26
34
  cat model.jsonld | shacl2code generate -i - python -o - > out.py
27
35
  ```
28
36
 
29
37
  For more information, run:
38
+
30
39
  ```shell
31
40
  shacl2code --help
32
41
  ```
33
42
 
34
43
  The available language bindings can be viewed by running:
44
+
35
45
  ```shell
36
46
  shacl2code list
37
47
  ```
@@ -52,6 +62,7 @@ pip install -e ".[dev]"
52
62
 
53
63
  `shacl2code` has a test suite written in [pytest][pytest]. To run it, setup a
54
64
  virtual environment as shown above, then run:
65
+
55
66
  ```shell
56
67
  pytest
57
68
  ```
@@ -59,7 +70,6 @@ pytest
59
70
  In addition to the test results, a test coverage report will also be generated
60
71
  using [pytest-cov][pytest-cov]
61
72
 
62
-
63
73
  ## Custom Annotations
64
74
 
65
75
  `shacl2code` supports a number of custom annotations that can be specified in a
@@ -88,6 +98,7 @@ turtle will use `MyId` instead of `@id` when writing JSON-LD bindings:
88
98
  ```
89
99
 
90
100
  When doing this, the class would then look like this in JSON-LD:
101
+
91
102
  ```json
92
103
  {
93
104
  "@type": "MyClass",
@@ -95,7 +106,7 @@ When doing this, the class would then look like this in JSON-LD:
95
106
  }
96
107
  ```
97
108
 
98
- The `idProperyName` annotation is inherited by derived classes, so for example
109
+ The `idPropertyName` annotation is inherited by derived classes, so for example
99
110
  any class that derived from `MyClass` would also use `MyId` as the subject
100
111
  property.
101
112
 
@@ -127,7 +138,6 @@ indicates if a class can be extended, and defaults to `false`. For example, the
127
138
  following turtle will declare a class as extensible:
128
139
 
129
140
  ```ttl
130
-
131
141
  <MyClass> a owl:Class, sh:NodeShape ;
132
142
  sh-to-code:isExtensible true
133
143
  .
@@ -163,14 +173,12 @@ a constraint on the shape that it cannot be of its own type. This can be done
163
173
  with the following turtle:
164
174
 
165
175
  ```ttl
166
-
167
176
  <MyClass> a owl:Class, sh:NodeShape ;
168
- # SHACL to prevent a class from being instansiated as this exact type
177
+ # SHACL to prevent a class from being instantiated as this exact type
169
178
  sh:property [
170
179
  sh:path rdf:type ;
171
180
  sh:not [ sh:hasValue <MyClass> ]
172
181
  ] .
173
-
174
182
  ```
175
183
 
176
184
  `shacl2code` will detect this pattern and generate abstract bindings for
@@ -186,7 +194,6 @@ abstract. This can be done with the boolean `isAbstract` property. For
186
194
  example, the following turtle will declare a class as abstract:
187
195
 
188
196
  ```ttl
189
-
190
197
  <MyClass> a owl:Class, sh:NodeShape ;
191
198
  sh-to-code:isAbstract true
192
199
  .
@@ -0,0 +1,13 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ These version of shacl2code are currently receiving security fixes:
6
+
7
+ | Version | Supported |
8
+ | ------- | ------------------ |
9
+ | 0.0.x | :white_check_mark: |
10
+
11
+ ## Reporting a Vulnerability
12
+
13
+ Security issues can be reported in the [GitHub Issues](https://github.com/JPEWdev/shacl2code/issues). If accepted, the `security` label will be able to the issue
@@ -25,7 +25,7 @@ namespace {{ n }} {
25
25
 
26
26
  using std::string_literals::operator""s;
27
27
 
28
- // DefaultErrorHanlder
28
+ // DefaultErrorHandler
29
29
  DefaultErrorHandler::DefaultErrorHandler() {}
30
30
  DefaultErrorHandler::~DefaultErrorHandler() {}
31
31
 
@@ -41,7 +41,7 @@ void DefaultErrorHandler::handleDeserializeError(std::string const& message,
41
41
 
42
42
  DefaultErrorHandler DefaultErrorHandler::handler;
43
43
 
44
- // NoopErrorHanlder
44
+ // NoopErrorHandler
45
45
  NoopErrorHandler::NoopErrorHandler() {}
46
46
  NoopErrorHandler::~NoopErrorHandler() {}
47
47
 
@@ -40,7 +40,7 @@ typedef std::variant<std::string, int, double, DateTime, Ref<SHACLObject>>
40
40
  *
41
41
  * Implements the extra APIs that need to be called by an extensible class
42
42
  *
43
- * @note This should not be used directy; instead the SHACLExtensibleObject
43
+ * @note This should not be used directly; instead the SHACLExtensibleObject
44
44
  * template class should be used
45
45
  */
46
46
  class EXPORT SHACLExtensibleObjectBase {
@@ -102,6 +102,10 @@ class {{ varname(*class.clsname) }};
102
102
  *
103
103
  * This class is abstract
104
104
  {%- else %}
105
+ {%- if class.deprecated %}
106
+ *
107
+ * @deprecated This class is deprecated
108
+ {%- endif %}
105
109
  *
106
110
  * @ingroup {{ basename }}_concrete_classes
107
111
  *
@@ -143,6 +147,10 @@ class EXPORT {{ cpp_name }} : public{% for parent in parent_cpp_classes(class, c
143
147
  {%- if context.compact_vocab(prop.path) != prop.path %}
144
148
  *
145
149
  * Compact IRI: {{ context.compact_vocab(prop.path) }}
150
+ {%- endif %}
151
+ {%- if prop.deprecated %}
152
+ *
153
+ * @deprecated This property is deprecated
146
154
  {%- endif %}
147
155
  *
148
156
  {%- for l in prop.comment.split("\n") %}
@@ -60,7 +60,7 @@ class EXPORT SHACLObject {
60
60
  };
61
61
 
62
62
  public:
63
- /// Alias for the parameter that desribes the type IRIs an object can have
63
+ /// Alias for the parameter that describes the type IRIs an object can have
64
64
  using TypeIRIs =
65
65
  std::optional<std::pair<std::string, std::optional<std::string>>>;
66
66
 
@@ -34,7 +34,7 @@ using std::string_literals::operator""s;
34
34
  */
35
35
  class Finally {
36
36
  public:
37
- /// Contructor
37
+ /// Constructor
38
38
  explicit Finally(std::function<void(void)>&& func)
39
39
  : mFunc(std::move(func)) {}
40
40
 
@@ -16,6 +16,9 @@ import (
16
16
  {%- for l in class.comment.splitlines() %}
17
17
  {{ ("// " + l).rstrip() }}
18
18
  {% endfor -%}
19
+ {%- if class.deprecated %}
20
+ // Deprecated: This class is deprecated
21
+ {%- endif %}
19
22
  {% set is_public = not class.is_abstract or class.is_extensible -%}
20
23
  type {{ struct_name(class) }} struct {
21
24
  {%- if class.parent_ids %}
@@ -148,14 +151,21 @@ type {{ interface_name(class) }} interface {
148
151
  SHACLObject
149
152
  {%- endif %}
150
153
  {%- for prop in class.properties %}
151
- {%- if prop_is_list(prop) %}
152
- {{ varname(prop.varname) }}() ListPropertyInterface[{{ prop_go_type(prop, classes) }}]
153
- {%- elif not prop.enum_values and prop.class_id %}
154
- {{ varname(prop.varname) }}() RefPropertyInterface[{{ interface_name(classes.get(prop.class_id)) }}]
155
- {%- else %}
156
- {{ varname(prop.varname) }}() PropertyInterface[{{ prop_go_type(prop, classes) }}]
157
- {%- endif %}
154
+ {{ varname(prop.varname) }}() {% if not prop.enum_values and prop.class_id -%}
155
+ Ref
156
+ {%- endif %}{% if prop_is_list(prop) -%}
157
+ List
158
+ {%- endif %}PropertyInterface[
159
+ {%- if not prop.enum_values and prop.class_id -%}
160
+ {{ interface_name(classes.get(prop.class_id)) }}
161
+ {%- else -%}
162
+ {{ prop_go_type(prop, classes) }}
163
+ {%- endif -%}
164
+ ]
158
165
  {%- endfor %}
166
+ // Type placeholder to ensure this interface cannot be assigned
167
+ // incorrectly, even if it has no properties
168
+ typeHolder{{ interface_name(class) }}()
159
169
  }
160
170
 
161
171
  {% if not class.is_abstract %}
@@ -260,15 +270,26 @@ func (self *{{ struct_name(class) }}) Link(state *LinkState) error {
260
270
  }
261
271
 
262
272
  {% for prop in class.properties %}
263
- {%- if prop_is_list(prop) %}
264
- func (self *{{ struct_name(class) }}) {{ varname(prop.varname) }}() ListPropertyInterface[{{ prop_go_type(prop, classes) }}] { return &self.{{ prop_name(prop) }} }
265
- {%- elif not prop.enum_values and prop.class_id %}
266
- func (self *{{ struct_name(class) }}) {{ varname(prop.varname) }}() RefPropertyInterface[{{ interface_name(classes.get(prop.class_id)) }}] { return &self.{{ prop_name(prop) }} }
267
- {%- else %}
268
- func (self *{{ struct_name(class) }}) {{ varname(prop.varname) }}() PropertyInterface[{{ prop_go_type(prop, classes) }}] { return &self.{{ prop_name(prop) }} }
273
+ {%- if prop.deprecated %}
274
+ // Deprecated: This property is deprecated
269
275
  {%- endif %}
276
+ func (self *{{ struct_name(class) }}) {{ varname(prop.varname) }}() {% if not prop.enum_values and prop.class_id -%}
277
+ Ref
278
+ {%- endif %}{% if prop_is_list(prop) -%}
279
+ List
280
+ {%- endif %}PropertyInterface[
281
+ {%- if not prop.enum_values and prop.class_id -%}
282
+ {{ interface_name(classes.get(prop.class_id)) }}
283
+ {%- else -%}
284
+ {{ prop_go_type(prop, classes) }}
285
+ {%- endif -%}
286
+ ] {
287
+ return &self.{{ prop_name(prop) }}
288
+ }
270
289
  {%- endfor %}
271
290
 
291
+ func (self *{{ struct_name(class) }}) typeHolder{{ interface_name(class) }}() {}
292
+
272
293
  func (self *{{ struct_name(class) }}) EncodeProperties(data map[string]interface{}, path Path, state *EncodeState) error {
273
294
  {%- if class.parent_ids %}
274
295
  {%- for p in class.parent_ids %}
@@ -8,6 +8,12 @@ vim: ft=go
8
8
 
9
9
  package {{ package }}
10
10
 
11
+ type RefListPropertyInterface[T SHACLObject] interface {
12
+ ListPropertyInterface[Ref[T]]
13
+ AppendObj(obj T) error
14
+ AppendIRI(iri string) error
15
+ }
16
+
11
17
  type RefListProperty[T SHACLObject] struct {
12
18
  ListProperty[Ref[T]]
13
19
  }
@@ -43,3 +49,14 @@ func (self *RefListProperty[T]) Link(state *LinkState) error {
43
49
  return nil
44
50
  }
45
51
 
52
+ func (self *RefListProperty[T]) AppendObj(obj T) error {
53
+ // Shorthand to append an object by making a reference to it
54
+ return self.Append(MakeObjectRef(obj))
55
+ }
56
+
57
+ func (self *RefListProperty[T]) AppendIRI(iri string) error {
58
+ // Shorthand to append an IRI by making a reference to it
59
+ return self.Append(MakeIRIRef[T](iri))
60
+ }
61
+
62
+