shacl2code 0.0.19__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.19 → shacl2code-0.0.20}/.github/workflows/coverage-generate.yaml +7 -4
  2. {shacl2code-0.0.19 → shacl2code-0.0.20}/.github/workflows/coverage-report.yaml +4 -1
  3. {shacl2code-0.0.19 → 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.19 → shacl2code-0.0.20}/.github/workflows/test.yaml +7 -7
  6. {shacl2code-0.0.19 → shacl2code-0.0.20}/PKG-INFO +15 -8
  7. {shacl2code-0.0.19 → shacl2code-0.0.20}/README.md +14 -7
  8. shacl2code-0.0.20/SECURITY.md +13 -0
  9. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/errorhandler.cpp.j2 +2 -2
  10. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/extensible.hpp.j2 +1 -1
  11. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/header.j2 +8 -0
  12. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/object.hpp.j2 +1 -1
  13. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectpath.cpp.j2 +1 -1
  14. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/classes.go.j2 +11 -0
  15. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/jsonschema.j2 +6 -0
  16. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/python.j2 +14 -1
  17. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/model.py +7 -1
  18. shacl2code-0.0.20/src/shacl2code/version.py +1 -0
  19. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/model/test-context.json +10 -0
  20. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/model/test.ttl +31 -0
  21. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_common_jinja.py +1 -1
  22. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_cpp.py +8 -35
  23. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_golang.py +17 -36
  24. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_jsonschema.py +6 -37
  25. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_model_source.py +44 -54
  26. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_python.py +26 -44
  27. shacl2code-0.0.19/src/shacl2code/version.py +0 -1
  28. shacl2code-0.0.19/tests/expect/cpp/context/Doxyfile +0 -2623
  29. shacl2code-0.0.19/tests/expect/cpp/context/Makefile +0 -106
  30. shacl2code-0.0.19/tests/expect/cpp/context/api.hpp +0 -49
  31. shacl2code-0.0.19/tests/expect/cpp/context/datetime.cpp +0 -141
  32. shacl2code-0.0.19/tests/expect/cpp/context/datetime.hpp +0 -123
  33. shacl2code-0.0.19/tests/expect/cpp/context/decode.cpp +0 -43
  34. shacl2code-0.0.19/tests/expect/cpp/context/decode.hpp +0 -317
  35. shacl2code-0.0.19/tests/expect/cpp/context/encode.cpp +0 -93
  36. shacl2code-0.0.19/tests/expect/cpp/context/encode.hpp +0 -360
  37. shacl2code-0.0.19/tests/expect/cpp/context/errorhandler.cpp +0 -52
  38. shacl2code-0.0.19/tests/expect/cpp/context/errorhandler.hpp +0 -159
  39. shacl2code-0.0.19/tests/expect/cpp/context/exceptions.hpp +0 -119
  40. shacl2code-0.0.19/tests/expect/cpp/context/extensible.cpp +0 -199
  41. shacl2code-0.0.19/tests/expect/cpp/context/extensible.hpp +0 -207
  42. shacl2code-0.0.19/tests/expect/cpp/context/link.cpp +0 -35
  43. shacl2code-0.0.19/tests/expect/cpp/context/link.hpp +0 -72
  44. shacl2code-0.0.19/tests/expect/cpp/context/namedindividual.cpp +0 -58
  45. shacl2code-0.0.19/tests/expect/cpp/context/namedindividual.hpp +0 -126
  46. shacl2code-0.0.19/tests/expect/cpp/context/object.cpp +0 -317
  47. shacl2code-0.0.19/tests/expect/cpp/context/object.hpp +0 -358
  48. shacl2code-0.0.19/tests/expect/cpp/context/objectpath.cpp +0 -94
  49. shacl2code-0.0.19/tests/expect/cpp/context/objectpath.hpp +0 -187
  50. shacl2code-0.0.19/tests/expect/cpp/context/objectset.cpp +0 -325
  51. shacl2code-0.0.19/tests/expect/cpp/context/objectset.hpp +0 -245
  52. shacl2code-0.0.19/tests/expect/cpp/context/prop.hpp +0 -252
  53. shacl2code-0.0.19/tests/expect/cpp/context/property.cpp +0 -465
  54. shacl2code-0.0.19/tests/expect/cpp/context/property.hpp +0 -498
  55. shacl2code-0.0.19/tests/expect/cpp/context/propertyvalue.cpp +0 -52
  56. shacl2code-0.0.19/tests/expect/cpp/context/propertyvalue.hpp +0 -1053
  57. shacl2code-0.0.19/tests/expect/cpp/context/ref.hpp +0 -448
  58. shacl2code-0.0.19/tests/expect/cpp/context/refproperty.cpp +0 -36
  59. shacl2code-0.0.19/tests/expect/cpp/context/refproperty.hpp +0 -227
  60. shacl2code-0.0.19/tests/expect/cpp/context/test-context-jsonld.cpp +0 -25248
  61. shacl2code-0.0.19/tests/expect/cpp/context/test-context-jsonld.hpp +0 -327
  62. shacl2code-0.0.19/tests/expect/cpp/context/test-context-validate.cpp +0 -142
  63. shacl2code-0.0.19/tests/expect/cpp/context/test-context.cpp +0 -835
  64. shacl2code-0.0.19/tests/expect/cpp/context/test-context.hpp +0 -1210
  65. shacl2code-0.0.19/tests/expect/cpp/context/test-context.pc +0 -10
  66. shacl2code-0.0.19/tests/expect/cpp/context/type.cpp +0 -39
  67. shacl2code-0.0.19/tests/expect/cpp/context/type.hpp +0 -309
  68. shacl2code-0.0.19/tests/expect/cpp/context/util.cpp +0 -35
  69. shacl2code-0.0.19/tests/expect/cpp/context/util.hpp +0 -54
  70. shacl2code-0.0.19/tests/expect/cpp/context/walk.hpp +0 -103
  71. shacl2code-0.0.19/tests/expect/cpp/nocontext/Doxyfile +0 -2623
  72. shacl2code-0.0.19/tests/expect/cpp/nocontext/Makefile +0 -106
  73. shacl2code-0.0.19/tests/expect/cpp/nocontext/api.hpp +0 -49
  74. shacl2code-0.0.19/tests/expect/cpp/nocontext/datetime.cpp +0 -141
  75. shacl2code-0.0.19/tests/expect/cpp/nocontext/datetime.hpp +0 -123
  76. shacl2code-0.0.19/tests/expect/cpp/nocontext/decode.cpp +0 -43
  77. shacl2code-0.0.19/tests/expect/cpp/nocontext/decode.hpp +0 -317
  78. shacl2code-0.0.19/tests/expect/cpp/nocontext/encode.cpp +0 -93
  79. shacl2code-0.0.19/tests/expect/cpp/nocontext/encode.hpp +0 -360
  80. shacl2code-0.0.19/tests/expect/cpp/nocontext/errorhandler.cpp +0 -52
  81. shacl2code-0.0.19/tests/expect/cpp/nocontext/errorhandler.hpp +0 -159
  82. shacl2code-0.0.19/tests/expect/cpp/nocontext/exceptions.hpp +0 -119
  83. shacl2code-0.0.19/tests/expect/cpp/nocontext/extensible.cpp +0 -199
  84. shacl2code-0.0.19/tests/expect/cpp/nocontext/extensible.hpp +0 -207
  85. shacl2code-0.0.19/tests/expect/cpp/nocontext/link.cpp +0 -35
  86. shacl2code-0.0.19/tests/expect/cpp/nocontext/link.hpp +0 -72
  87. shacl2code-0.0.19/tests/expect/cpp/nocontext/namedindividual.cpp +0 -58
  88. shacl2code-0.0.19/tests/expect/cpp/nocontext/namedindividual.hpp +0 -126
  89. shacl2code-0.0.19/tests/expect/cpp/nocontext/object.cpp +0 -317
  90. shacl2code-0.0.19/tests/expect/cpp/nocontext/object.hpp +0 -358
  91. shacl2code-0.0.19/tests/expect/cpp/nocontext/objectpath.cpp +0 -94
  92. shacl2code-0.0.19/tests/expect/cpp/nocontext/objectpath.hpp +0 -187
  93. shacl2code-0.0.19/tests/expect/cpp/nocontext/objectset.cpp +0 -324
  94. shacl2code-0.0.19/tests/expect/cpp/nocontext/objectset.hpp +0 -245
  95. shacl2code-0.0.19/tests/expect/cpp/nocontext/prop.hpp +0 -252
  96. shacl2code-0.0.19/tests/expect/cpp/nocontext/property.cpp +0 -465
  97. shacl2code-0.0.19/tests/expect/cpp/nocontext/property.hpp +0 -498
  98. shacl2code-0.0.19/tests/expect/cpp/nocontext/propertyvalue.cpp +0 -52
  99. shacl2code-0.0.19/tests/expect/cpp/nocontext/propertyvalue.hpp +0 -1053
  100. shacl2code-0.0.19/tests/expect/cpp/nocontext/ref.hpp +0 -448
  101. shacl2code-0.0.19/tests/expect/cpp/nocontext/refproperty.cpp +0 -36
  102. shacl2code-0.0.19/tests/expect/cpp/nocontext/refproperty.hpp +0 -227
  103. shacl2code-0.0.19/tests/expect/cpp/nocontext/test-jsonld.cpp +0 -25248
  104. shacl2code-0.0.19/tests/expect/cpp/nocontext/test-jsonld.hpp +0 -327
  105. shacl2code-0.0.19/tests/expect/cpp/nocontext/test-validate.cpp +0 -142
  106. shacl2code-0.0.19/tests/expect/cpp/nocontext/test.cpp +0 -820
  107. shacl2code-0.0.19/tests/expect/cpp/nocontext/test.hpp +0 -1082
  108. shacl2code-0.0.19/tests/expect/cpp/nocontext/test.pc +0 -10
  109. shacl2code-0.0.19/tests/expect/cpp/nocontext/type.cpp +0 -39
  110. shacl2code-0.0.19/tests/expect/cpp/nocontext/type.hpp +0 -309
  111. shacl2code-0.0.19/tests/expect/cpp/nocontext/util.cpp +0 -35
  112. shacl2code-0.0.19/tests/expect/cpp/nocontext/util.hpp +0 -54
  113. shacl2code-0.0.19/tests/expect/cpp/nocontext/walk.hpp +0 -103
  114. shacl2code-0.0.19/tests/expect/golang/context/test-context/classes.go +0 -3971
  115. shacl2code-0.0.19/tests/expect/golang/context/test-context/decode.go +0 -334
  116. shacl2code-0.0.19/tests/expect/golang/context/test-context/encode.go +0 -73
  117. shacl2code-0.0.19/tests/expect/golang/context/test-context/errorhandler.go +0 -11
  118. shacl2code-0.0.19/tests/expect/golang/context/test-context/errors.go +0 -44
  119. shacl2code-0.0.19/tests/expect/golang/context/test-context/extensible.go +0 -47
  120. shacl2code-0.0.19/tests/expect/golang/context/test-context/linkstate.go +0 -12
  121. shacl2code-0.0.19/tests/expect/golang/context/test-context/listproperty.go +0 -112
  122. shacl2code-0.0.19/tests/expect/golang/context/test-context/optional.go +0 -34
  123. shacl2code-0.0.19/tests/expect/golang/context/test-context/path.go +0 -30
  124. shacl2code-0.0.19/tests/expect/golang/context/test-context/property.go +0 -99
  125. shacl2code-0.0.19/tests/expect/golang/context/test-context/ref.go +0 -91
  126. shacl2code-0.0.19/tests/expect/golang/context/test-context/reflistproperty.go +0 -59
  127. shacl2code-0.0.19/tests/expect/golang/context/test-context/refproperty.go +0 -89
  128. shacl2code-0.0.19/tests/expect/golang/context/test-context/shaclobject.go +0 -127
  129. shacl2code-0.0.19/tests/expect/golang/context/test-context/shaclobjectset.go +0 -356
  130. shacl2code-0.0.19/tests/expect/golang/context/test-context/shacltype.go +0 -177
  131. shacl2code-0.0.19/tests/expect/golang/context/test-context/util.go +0 -26
  132. shacl2code-0.0.19/tests/expect/golang/context/test-context/validator.go +0 -107
  133. shacl2code-0.0.19/tests/expect/golang/nocontext/test/classes.go +0 -3942
  134. shacl2code-0.0.19/tests/expect/golang/nocontext/test/decode.go +0 -334
  135. shacl2code-0.0.19/tests/expect/golang/nocontext/test/encode.go +0 -73
  136. shacl2code-0.0.19/tests/expect/golang/nocontext/test/errorhandler.go +0 -11
  137. shacl2code-0.0.19/tests/expect/golang/nocontext/test/errors.go +0 -44
  138. shacl2code-0.0.19/tests/expect/golang/nocontext/test/extensible.go +0 -47
  139. shacl2code-0.0.19/tests/expect/golang/nocontext/test/linkstate.go +0 -12
  140. shacl2code-0.0.19/tests/expect/golang/nocontext/test/listproperty.go +0 -112
  141. shacl2code-0.0.19/tests/expect/golang/nocontext/test/optional.go +0 -34
  142. shacl2code-0.0.19/tests/expect/golang/nocontext/test/path.go +0 -30
  143. shacl2code-0.0.19/tests/expect/golang/nocontext/test/property.go +0 -99
  144. shacl2code-0.0.19/tests/expect/golang/nocontext/test/ref.go +0 -91
  145. shacl2code-0.0.19/tests/expect/golang/nocontext/test/reflistproperty.go +0 -59
  146. shacl2code-0.0.19/tests/expect/golang/nocontext/test/refproperty.go +0 -89
  147. shacl2code-0.0.19/tests/expect/golang/nocontext/test/shaclobject.go +0 -127
  148. shacl2code-0.0.19/tests/expect/golang/nocontext/test/shaclobjectset.go +0 -356
  149. shacl2code-0.0.19/tests/expect/golang/nocontext/test/shacltype.go +0 -177
  150. shacl2code-0.0.19/tests/expect/golang/nocontext/test/util.go +0 -26
  151. shacl2code-0.0.19/tests/expect/golang/nocontext/test/validator.go +0 -107
  152. shacl2code-0.0.19/tests/expect/jsonschema/context/test-context.json +0 -1435
  153. shacl2code-0.0.19/tests/expect/jsonschema/nocontext/test.json +0 -1426
  154. shacl2code-0.0.19/tests/expect/make_expect.py +0 -105
  155. shacl2code-0.0.19/tests/expect/python/context/test-context.py +0 -2561
  156. shacl2code-0.0.19/tests/expect/python/nocontext/test.py +0 -2516
  157. shacl2code-0.0.19/tests/expect/raw/context/test-context.txt +0 -54
  158. shacl2code-0.0.19/tests/expect/raw/nocontext/test.txt +0 -28
  159. {shacl2code-0.0.19 → shacl2code-0.0.20}/.flake8 +0 -0
  160. {shacl2code-0.0.19 → shacl2code-0.0.20}/.gitignore +0 -0
  161. {shacl2code-0.0.19 → shacl2code-0.0.20}/LICENSE +0 -0
  162. {shacl2code-0.0.19 → shacl2code-0.0.20}/pyproject.toml +0 -0
  163. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/__init__.py +0 -0
  164. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/__main__.py +0 -0
  165. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/context.py +0 -0
  166. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/__init__.py +0 -0
  167. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/common.py +0 -0
  168. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/cpp.py +0 -0
  169. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/golang.py +0 -0
  170. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/jinja.py +0 -0
  171. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/jsonschema.py +0 -0
  172. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/lang.py +0 -0
  173. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/python.py +0 -0
  174. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/sources/cpp/json.hpp +0 -0
  175. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/Doxyfile.j2 +0 -0
  176. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/Makefile.j2 +0 -0
  177. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/api.hpp.j2 +0 -0
  178. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/datetime.cpp.j2 +0 -0
  179. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/datetime.hpp.j2 +0 -0
  180. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/decode.cpp.j2 +0 -0
  181. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/decode.hpp.j2 +0 -0
  182. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/encode.cpp.j2 +0 -0
  183. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/encode.hpp.j2 +0 -0
  184. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/errorhandler.hpp.j2 +0 -0
  185. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/exceptions.hpp.j2 +0 -0
  186. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/extensible.cpp.j2 +0 -0
  187. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/jsonld-header.j2 +0 -0
  188. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/jsonld-source.j2 +0 -0
  189. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/link.cpp.j2 +0 -0
  190. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/link.hpp.j2 +0 -0
  191. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/namedindividual.cpp.j2 +0 -0
  192. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/namedindividual.hpp.j2 +0 -0
  193. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/object.cpp.j2 +0 -0
  194. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectpath.hpp.j2 +0 -0
  195. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectset.cpp.j2 +0 -0
  196. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/objectset.hpp.j2 +0 -0
  197. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/pkgconfig.pc.j2 +0 -0
  198. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/prop.hpp.j2 +0 -0
  199. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/property.cpp.j2 +0 -0
  200. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/property.hpp.j2 +0 -0
  201. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/propertyvalue.cpp.j2 +0 -0
  202. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/propertyvalue.hpp.j2 +0 -0
  203. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/ref.hpp.j2 +0 -0
  204. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/refproperty.cpp.j2 +0 -0
  205. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/refproperty.hpp.j2 +0 -0
  206. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/source.j2 +0 -0
  207. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/type.cpp.j2 +0 -0
  208. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/type.hpp.j2 +0 -0
  209. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/util.cpp.j2 +0 -0
  210. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/util.hpp.j2 +0 -0
  211. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/validate.j2 +0 -0
  212. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/cpp/walk.hpp.j2 +0 -0
  213. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/decode.go.j2 +0 -0
  214. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/encode.go.j2 +0 -0
  215. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/errorhandler.go.j2 +0 -0
  216. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/errors.go.j2 +0 -0
  217. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/extensible.go.j2 +0 -0
  218. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/linkstate.go.j2 +0 -0
  219. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/listproperty.go.j2 +0 -0
  220. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/optional.go.j2 +0 -0
  221. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/path.go.j2 +0 -0
  222. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/property.go.j2 +0 -0
  223. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/ref.go.j2 +0 -0
  224. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/reflistproperty.go.j2 +0 -0
  225. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/refproperty.go.j2 +0 -0
  226. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/shaclobject.go.j2 +0 -0
  227. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/shaclobjectset.go.j2 +0 -0
  228. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/shacltype.go.j2 +0 -0
  229. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/util.go.j2 +0 -0
  230. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/lang/templates/golang/validator.go.j2 +0 -0
  231. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/main.py +0 -0
  232. {shacl2code-0.0.19 → shacl2code-0.0.20}/src/shacl2code/urlcontext.py +0 -0
  233. {shacl2code-0.0.19 → shacl2code-0.0.20}/testfixtures/testfixtures/__init__.py +0 -0
  234. {shacl2code-0.0.19 → shacl2code-0.0.20}/testfixtures/testfixtures/httpserver.py +0 -0
  235. {shacl2code-0.0.19 → shacl2code-0.0.20}/testfixtures/testfixtures/jsonvalidation.py +0 -0
  236. {shacl2code-0.0.19 → shacl2code-0.0.20}/testfixtures/testfixtures/timetests.py +0 -0
  237. {shacl2code-0.0.19 → shacl2code-0.0.20}/testfixtures/testfixtures/utils.py +0 -0
  238. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/conftest.py +0 -0
  239. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/abort.j2 +0 -0
  240. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/bad-id.j2 +0 -0
  241. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/bad-node-kind.ttl +0 -0
  242. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/bad-pattern-class.ttl +0 -0
  243. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/bad-pattern-integer.ttl +0 -0
  244. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/bad-prop-type.ttl +0 -0
  245. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/bad-reference.jsonld +0 -0
  246. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/context-url.j2 +0 -0
  247. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/context.j2 +0 -0
  248. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/links.json +0 -0
  249. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/missing-range.ttl +0 -0
  250. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/python/bad-object-type-inline.json +0 -0
  251. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/python/bad-object-type-ref-after.json +0 -0
  252. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/python/bad-object-type-ref-before.json +0 -0
  253. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/raw.j2 +0 -0
  254. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/data/roundtrip.json +0 -0
  255. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_cli.py +0 -0
  256. {shacl2code-0.0.19 → shacl2code-0.0.20}/tests/test_common_prefix.py +0 -0
  257. {shacl2code-0.0.19 → 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.19
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 %}
@@ -160,6 +163,9 @@ type {{ interface_name(class) }} interface {
160
163
  {%- endif -%}
161
164
  ]
162
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) }}()
163
169
  }
164
170
 
165
171
  {% if not class.is_abstract %}
@@ -264,6 +270,9 @@ func (self *{{ struct_name(class) }}) Link(state *LinkState) error {
264
270
  }
265
271
 
266
272
  {% for prop in class.properties %}
273
+ {%- if prop.deprecated %}
274
+ // Deprecated: This property is deprecated
275
+ {%- endif %}
267
276
  func (self *{{ struct_name(class) }}) {{ varname(prop.varname) }}() {% if not prop.enum_values and prop.class_id -%}
268
277
  Ref
269
278
  {%- endif %}{% if prop_is_list(prop) -%}
@@ -279,6 +288,8 @@ func (self *{{ struct_name(class) }}) {{ varname(prop.varname) }}() {% if not pr
279
288
  }
280
289
  {%- endfor %}
281
290
 
291
+ func (self *{{ struct_name(class) }}) typeHolder{{ interface_name(class) }}() {}
292
+
282
293
  func (self *{{ struct_name(class) }}) EncodeProperties(data map[string]interface{}, path Path, state *EncodeState) error {
283
294
  {%- if class.parent_ids %}
284
295
  {%- for p in class.parent_ids %}
@@ -64,6 +64,9 @@
64
64
  "allOf": [
65
65
  {
66
66
  "type": "object",
67
+ {%- if class.deprecated %}
68
+ "deprecated": true,
69
+ {%- endif %}
67
70
  {%- if class.is_extensible %}
68
71
  "unevaluatedProperties": true,
69
72
  {%- endif %}
@@ -183,6 +186,9 @@
183
186
  },
184
187
  {%- for prop in class.properties %}
185
188
  "prop_{{ varname(*class.clsname) }}_{{ varname(prop.varname) }}": {
189
+ {%- if prop.deprecated %}
190
+ "deprecated": true,
191
+ {%- endif %}
186
192
  {%- if prop.enum_values %}
187
193
  "enum": [
188
194
  {%- for e in prop.enum_values %}
@@ -13,6 +13,7 @@ import re
13
13
  import sys
14
14
  import threading
15
15
  import time
16
+ import warnings
16
17
  from contextlib import contextmanager
17
18
  from datetime import datetime, timezone, timedelta
18
19
  from enum import Enum
@@ -555,6 +556,7 @@ class SHACLObject(object):
555
556
  NODE_KIND = NodeKind.BlankNodeOrIRI
556
557
  ID_ALIAS = None
557
558
  IS_ABSTRACT = True
559
+ IS_DEPRECATED = False
558
560
 
559
561
  def __init__(self, **kwargs):
560
562
  if self._is_abstract():
@@ -562,11 +564,15 @@ class SHACLObject(object):
562
564
  f"{self.__class__.__name__} is abstract and cannot be implemented"
563
565
  )
564
566
 
567
+ if self.__class__.IS_DEPRECATED:
568
+ warnings.warn(f"{self.__class__.__name__} is deprecated", DeprecationWarning)
569
+
565
570
  with register_lock:
566
571
  cls = self.__class__
567
572
  if cls._NEEDS_REG:
568
573
  cls._OBJ_PROPERTIES = {}
569
574
  cls._OBJ_IRIS = {}
575
+ cls._OBJ_DEPRECATED = set()
570
576
  cls._register_props()
571
577
  cls._NEEDS_REG = False
572
578
 
@@ -595,6 +601,7 @@ class SHACLObject(object):
595
601
  min_count=None,
596
602
  max_count=None,
597
603
  compact=None,
604
+ deprecated=False,
598
605
  ):
599
606
  if pyname in cls._OBJ_IRIS:
600
607
  raise KeyError(f"'{pyname}' is already defined for '{cls.__name__}'")
@@ -609,6 +616,8 @@ class SHACLObject(object):
609
616
 
610
617
  cls._OBJ_IRIS[pyname] = iri
611
618
  cls._OBJ_PROPERTIES[iri] = (prop, min_count, max_count, pyname, compact)
619
+ if deprecated:
620
+ cls._OBJ_DEPRECATED.add(iri)
612
621
 
613
622
  def __setattr__(self, name, value):
614
623
  if name == self.ID_ALIAS:
@@ -692,8 +701,10 @@ class SHACLObject(object):
692
701
  f"{self.__class__.__name__} ({id(self)}) Has invalid Property '{iri}' '{value}'. Must be a blank node or IRI"
693
702
  )
694
703
 
695
- prop, _, _, _, _ = self.__get_prop(iri)
704
+ prop, _, _, pyname, _ = self.__get_prop(iri)
696
705
  prop.validate(value)
706
+ if iri in self._OBJ_DEPRECATED:
707
+ warnings.warn(f"{self.__class__.__name__}.{pyname} is deprecated", DeprecationWarning)
697
708
  self.__dict__["_obj_data"][iri] = prop.set(value)
698
709
 
699
710
  def __delitem__(self, iri):
@@ -2022,6 +2033,7 @@ class {{ varname(*class.clsname) }}(
2022
2033
  {%- if class.id_property %}
2023
2034
  ID_ALIAS = "{{ class.id_property }}"
2024
2035
  {%- endif %}
2036
+ IS_DEPRECATED = {{ class.deprecated }}
2025
2037
  NAMED_INDIVIDUALS = {
2026
2038
  {%- for member in class.named_individuals %}
2027
2039
  "{{ varname(member.varname) }}": "{{ member._id }}",
@@ -2086,6 +2098,7 @@ class {{ varname(*class.clsname) }}(
2086
2098
  {%- if context.compact_vocab(prop.path) != prop.path %}
2087
2099
  compact="{{ context.compact_vocab(prop.path) }}",
2088
2100
  {%- endif %}
2101
+ deprecated={{ prop.deprecated }}
2089
2102
  )
2090
2103
  {%- endfor %}
2091
2104
  {%- endif %}
@@ -72,6 +72,7 @@ class Property:
72
72
  class_id: str = ""
73
73
  datatype: str = ""
74
74
  pattern: str = ""
75
+ deprecated: bool = False
75
76
 
76
77
 
77
78
  @dataclass
@@ -87,6 +88,7 @@ class Class:
87
88
  is_extensible: bool = False
88
89
  is_abstract: bool = False
89
90
  named_individuals: list = None
91
+ deprecated: bool = False
90
92
 
91
93
 
92
94
  class Model(object):
@@ -168,7 +170,9 @@ class Model(object):
168
170
 
169
171
  return False
170
172
 
171
- class_iris = set(self.model.subjects(RDF.type, OWL.Class))
173
+ class_iris = set(self.model.subjects(RDF.type, OWL.Class)) | set(
174
+ self.model.subjects(RDF.type, OWL.DeprecatedClass)
175
+ )
172
176
  for cls_iri in class_iris:
173
177
  c = Class(
174
178
  _id=str(cls_iri),
@@ -188,6 +192,7 @@ class Model(object):
188
192
  is_extensible=bool(self.model.value(cls_iri, SHACL2CODE.isExtensible)),
189
193
  is_abstract=is_abstract(cls_iri),
190
194
  named_individuals=get_named_individuals(cls_iri),
195
+ deprecated=(cls_iri, RDF.type, OWL.DeprecatedClass) in self.model,
191
196
  )
192
197
 
193
198
  if c.node_kind not in (SH.IRI, SH.BlankNode, SH.BlankNodeOrIRI):
@@ -216,6 +221,7 @@ class Model(object):
216
221
  comment=str(self.model.value(prop, RDFS.comment, default="")),
217
222
  max_count=int_val(self.model.value(obj_prop, SH.maxCount)),
218
223
  min_count=int_val(self.model.value(obj_prop, SH.minCount)),
224
+ deprecated=(prop, RDF.type, OWL.DeprecatedProperty) in self.model,
219
225
  )
220
226
 
221
227
  if in_list := self.model.value(obj_prop, SH["in"]):
@@ -0,0 +1 @@
1
+ VERSION = "0.0.20"