shacl2code 0.0.16__tar.gz → 0.0.18__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.
- {shacl2code-0.0.16 → shacl2code-0.0.18}/PKG-INFO +3 -2
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/__init__.py +1 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/common.py +6 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/cpp.py +1 -1
- shacl2code-0.0.18/src/shacl2code/lang/golang.py +279 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/api.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/datetime.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/datetime.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/decode.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/decode.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/encode.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/encode.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/errorhandler.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/errorhandler.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/exceptions.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/extensible.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/extensible.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/header.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/jsonld-header.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/jsonld-source.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/link.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/link.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/namedindividual.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/namedindividual.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/object.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/object.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/objectpath.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/objectpath.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/objectset.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/objectset.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/prop.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/property.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/property.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/propertyvalue.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/propertyvalue.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/ref.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/refproperty.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/refproperty.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/source.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/type.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/type.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/util.cpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/util.hpp.j2 +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/validate.j2 +4 -6
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/walk.hpp.j2 +1 -3
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/classes.go.j2 +327 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/decode.go.j2 +336 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/encode.go.j2 +75 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/errorhandler.go.j2 +14 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/errors.go.j2 +46 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/extensible.go.j2 +49 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/linkstate.go.j2 +15 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/listproperty.go.j2 +114 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/optional.go.j2 +36 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/path.go.j2 +32 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/property.go.j2 +101 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/ref.go.j2 +93 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/reflistproperty.go.j2 +45 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/refproperty.go.j2 +92 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/shaclobject.go.j2 +130 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/shaclobjectset.go.j2 +310 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/shacltype.go.j2 +180 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/util.go.j2 +29 -0
- shacl2code-0.0.18/src/shacl2code/lang/templates/golang/validator.go.j2 +110 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/python.j2 +29 -5
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/main.py +6 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/model.py +1 -0
- shacl2code-0.0.18/src/shacl2code/version.py +1 -0
- shacl2code-0.0.18/testfixtures/testfixtures/__init__.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18/testfixtures}/testfixtures/jsonvalidation.py +77 -15
- shacl2code-0.0.18/testfixtures/testfixtures/timetests.py +193 -0
- shacl2code-0.0.18/testfixtures/testfixtures/utils.py +18 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/conftest.py +1 -1
- {shacl2code-0.0.16/tests/data/python → shacl2code-0.0.18/tests/data}/links.json +13 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/model/test-context.json +4 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/model/test.ttl +10 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/roundtrip.json +4 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/Doxyfile +1 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/Makefile +3 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/api.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/datetime.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/datetime.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/decode.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/decode.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/encode.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/encode.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/errorhandler.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/errorhandler.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/exceptions.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/extensible.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/extensible.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/link.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/link.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/namedindividual.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/namedindividual.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/object.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/object.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/objectpath.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/objectpath.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/objectset.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/objectset.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/prop.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/property.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/property.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/propertyvalue.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/propertyvalue.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/ref.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/refproperty.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/refproperty.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/test-context-jsonld.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/test-context-jsonld.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/test-context-validate.cpp +5 -7
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/test-context.cpp +13 -8
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/test-context.hpp +19 -11
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/test-context.pc +1 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/type.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/type.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/util.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/util.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/context/walk.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/Doxyfile +1 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/Makefile +3 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/api.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/datetime.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/datetime.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/decode.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/decode.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/encode.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/encode.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/errorhandler.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/errorhandler.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/exceptions.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/extensible.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/extensible.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/link.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/link.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/namedindividual.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/namedindividual.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/object.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/object.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/objectpath.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/objectpath.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/objectset.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/objectset.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/prop.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/property.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/property.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/propertyvalue.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/propertyvalue.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/ref.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/refproperty.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/refproperty.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/test-jsonld.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/test-jsonld.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/test-validate.cpp +5 -7
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/test.cpp +12 -7
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/test.hpp +17 -11
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/test.pc +1 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/type.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/type.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/util.cpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/util.hpp +1 -3
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/cpp/nocontext/walk.hpp +1 -3
- shacl2code-0.0.18/tests/expect/golang/context/test-context/classes.go +3895 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/decode.go +334 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/encode.go +73 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/errorhandler.go +11 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/errors.go +44 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/extensible.go +47 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/linkstate.go +12 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/listproperty.go +112 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/optional.go +34 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/path.go +30 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/property.go +99 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/ref.go +91 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/reflistproperty.go +42 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/refproperty.go +89 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/shaclobject.go +127 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/shaclobjectset.go +299 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/shacltype.go +177 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/util.go +26 -0
- shacl2code-0.0.18/tests/expect/golang/context/test-context/validator.go +107 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/classes.go +3866 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/decode.go +334 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/encode.go +73 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/errorhandler.go +11 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/errors.go +44 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/extensible.go +47 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/linkstate.go +12 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/listproperty.go +112 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/optional.go +34 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/path.go +30 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/property.go +99 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/ref.go +91 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/reflistproperty.go +42 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/refproperty.go +89 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/shaclobject.go +127 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/shaclobjectset.go +299 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/shacltype.go +177 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/util.go +26 -0
- shacl2code-0.0.18/tests/expect/golang/nocontext/test/validator.go +107 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/jsonschema/context/test-context.json +7 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/jsonschema/nocontext/test.json +6 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/make_expect.py +6 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/python/context/test-context.py +39 -8
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/python/nocontext/test.py +38 -8
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/raw/nocontext/test.txt +2 -2
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_cpp.py +1 -1
- shacl2code-0.0.18/tests/test_golang.py +1182 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_jsonschema.py +1 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_python.py +34 -216
- shacl2code-0.0.16/src/shacl2code/version.py +0 -1
- {shacl2code-0.0.16 → shacl2code-0.0.18}/.flake8 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/.github/workflows/coverage-generate.yaml +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/.github/workflows/coverage-report.yaml +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/.github/workflows/publish.yaml +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/.github/workflows/test.yaml +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/.gitignore +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/LICENSE +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/README.md +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/pyproject.toml +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/__init__.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/__main__.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/context.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/jinja.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/jsonschema.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/lang.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/python.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/sources/cpp/json.hpp +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/Doxyfile.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/Makefile.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/cpp/pkgconfig.pc.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/lang/templates/jsonschema.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/src/shacl2code/urlcontext.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18/testfixtures}/testfixtures/httpserver.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/abort.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/bad-id.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/bad-node-kind.ttl +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/bad-pattern-class.ttl +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/bad-pattern-integer.ttl +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/bad-prop-type.ttl +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/bad-reference.jsonld +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/context-url.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/context.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/missing-range.ttl +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/python/bad-object-type-inline.json +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/python/bad-object-type-ref-after.json +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/python/bad-object-type-ref-before.json +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/data/raw.j2 +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/expect/raw/context/test-context.txt +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_cli.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_common_jinja.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_common_prefix.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_context.py +0 -0
- {shacl2code-0.0.16 → shacl2code-0.0.18}/tests/test_model_source.py +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: shacl2code
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.18
|
|
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
|
|
7
7
|
Project-URL: Issues, https://github.com/JPEWdev/shacl2code/issues
|
|
8
8
|
Author-email: Joshua Watt <JPEWhacker@gmail.com>
|
|
9
|
+
License-File: LICENSE
|
|
9
10
|
Classifier: Development Status :: 4 - Beta
|
|
10
11
|
Classifier: Intended Audience :: Developers
|
|
11
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -37,8 +37,8 @@ def include_file(ctx, name):
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class JinjaTemplateRender(object):
|
|
40
|
-
def __init__(self):
|
|
41
|
-
|
|
40
|
+
def __init__(self, args):
|
|
41
|
+
self.spdx_license = args.license
|
|
42
42
|
|
|
43
43
|
def get_additional_render_args(self):
|
|
44
44
|
return {}
|
|
@@ -61,6 +61,7 @@ class JinjaTemplateRender(object):
|
|
|
61
61
|
|
|
62
62
|
render = template.render(
|
|
63
63
|
disclaimer=f"This file was automatically generated by {os.path.basename(sys.argv[0])}. DO NOT MANUALLY MODIFY IT",
|
|
64
|
+
spdx_license=self.spdx_license,
|
|
64
65
|
**render_args,
|
|
65
66
|
)
|
|
66
67
|
|
|
@@ -105,6 +106,8 @@ class JinjaTemplateRender(object):
|
|
|
105
106
|
for d in get_all_derived(cls):
|
|
106
107
|
ni |= set(i._id for i in classes.get(d).named_individuals)
|
|
107
108
|
|
|
109
|
+
ni = list(ni)
|
|
110
|
+
ni.sort()
|
|
108
111
|
return ni
|
|
109
112
|
|
|
110
113
|
classes = ObjectList(model.classes)
|
|
@@ -156,7 +159,7 @@ class BasicJinjaRender(JinjaTemplateRender):
|
|
|
156
159
|
"""
|
|
157
160
|
|
|
158
161
|
def __init__(self, args, template):
|
|
159
|
-
super().__init__()
|
|
162
|
+
super().__init__(args)
|
|
160
163
|
self.__output = args.output
|
|
161
164
|
self.__template = template
|
|
162
165
|
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2024 Joshua Watt
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
5
|
+
|
|
6
|
+
from .common import JinjaTemplateRender
|
|
7
|
+
from .lang import language, TEMPLATE_DIR
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
|
|
13
|
+
GO_KEYWORDS = (
|
|
14
|
+
"break",
|
|
15
|
+
"default",
|
|
16
|
+
"func",
|
|
17
|
+
"interface",
|
|
18
|
+
"select",
|
|
19
|
+
"case",
|
|
20
|
+
"defer",
|
|
21
|
+
"go",
|
|
22
|
+
"map",
|
|
23
|
+
"struct",
|
|
24
|
+
"chan",
|
|
25
|
+
"else",
|
|
26
|
+
"goto",
|
|
27
|
+
"package",
|
|
28
|
+
"switch",
|
|
29
|
+
"const",
|
|
30
|
+
"fallthrough",
|
|
31
|
+
"if",
|
|
32
|
+
"range",
|
|
33
|
+
"type",
|
|
34
|
+
"continue",
|
|
35
|
+
"for",
|
|
36
|
+
"import",
|
|
37
|
+
"return",
|
|
38
|
+
"var",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def varname(*name, public=True):
|
|
43
|
+
new_name = []
|
|
44
|
+
for n in name:
|
|
45
|
+
for s in re.split(r"[^a-zA-Z0-9]+", n):
|
|
46
|
+
if not s:
|
|
47
|
+
continue
|
|
48
|
+
new_name.append(s)
|
|
49
|
+
if public:
|
|
50
|
+
new_name = [s[0].upper() + s[1:] for s in new_name]
|
|
51
|
+
else:
|
|
52
|
+
new_name = [new_name[0][0].lower() + new_name[0][1:]] + [
|
|
53
|
+
s[0].upper() + s[1:] for s in new_name[1:]
|
|
54
|
+
]
|
|
55
|
+
new_name = "".join(new_name)
|
|
56
|
+
if new_name in GO_KEYWORDS:
|
|
57
|
+
new_name = new_name + "_"
|
|
58
|
+
return new_name
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def struct_name(cls):
|
|
62
|
+
return varname(*cls.clsname) + "Object"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def interface_name(cls):
|
|
66
|
+
return varname(*cls.clsname)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def class_type_var(cls):
|
|
70
|
+
return varname(*cls.clsname, public=False) + "Type"
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def prop_name(prop):
|
|
74
|
+
return varname(prop.varname, public=False)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def prop_is_list(prop):
|
|
78
|
+
return prop.max_count is None or prop.max_count != 1
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def prop_go_type(prop, classes):
|
|
82
|
+
if prop.enum_values:
|
|
83
|
+
return "string"
|
|
84
|
+
|
|
85
|
+
if prop.class_id:
|
|
86
|
+
intf = interface_name(classes.get(prop.class_id))
|
|
87
|
+
return f"Ref[{intf}]"
|
|
88
|
+
|
|
89
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#string":
|
|
90
|
+
return "string"
|
|
91
|
+
|
|
92
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#anyURI":
|
|
93
|
+
return "string"
|
|
94
|
+
|
|
95
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#integer":
|
|
96
|
+
return "int"
|
|
97
|
+
|
|
98
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#positiveInteger":
|
|
99
|
+
return "int"
|
|
100
|
+
|
|
101
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#nonNegativeInteger":
|
|
102
|
+
return "int"
|
|
103
|
+
|
|
104
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#boolean":
|
|
105
|
+
return "bool"
|
|
106
|
+
|
|
107
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#decimal":
|
|
108
|
+
return "float64"
|
|
109
|
+
|
|
110
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#dateTime":
|
|
111
|
+
return "time.Time"
|
|
112
|
+
|
|
113
|
+
if prop.datatype == "http://www.w3.org/2001/XMLSchema#dateTimeStamp":
|
|
114
|
+
return "time.Time"
|
|
115
|
+
|
|
116
|
+
raise Exception("Unknown data type " + prop.datatype) # pragma: no cover
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def prop_ctx_name(cls, prop):
|
|
120
|
+
return varname(*cls.clsname, public=False) + varname(prop.varname) + "Context"
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def prop_decode_func(cls, prop, classes):
|
|
124
|
+
if prop.enum_values:
|
|
125
|
+
func = "DecodeIRI"
|
|
126
|
+
|
|
127
|
+
elif prop.class_id:
|
|
128
|
+
func = "Decode" + interface_name(classes.get(prop.class_id))
|
|
129
|
+
|
|
130
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#string":
|
|
131
|
+
func = "DecodeString"
|
|
132
|
+
|
|
133
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#anyURI":
|
|
134
|
+
func = "DecodeString"
|
|
135
|
+
|
|
136
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#integer":
|
|
137
|
+
func = "DecodeInteger"
|
|
138
|
+
|
|
139
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#positiveInteger":
|
|
140
|
+
func = "DecodeInteger"
|
|
141
|
+
|
|
142
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#nonNegativeInteger":
|
|
143
|
+
func = "DecodeInteger"
|
|
144
|
+
|
|
145
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#boolean":
|
|
146
|
+
func = "DecodeBoolean"
|
|
147
|
+
|
|
148
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#decimal":
|
|
149
|
+
func = "DecodeFloat"
|
|
150
|
+
|
|
151
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#dateTime":
|
|
152
|
+
func = "DecodeDateTime"
|
|
153
|
+
|
|
154
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#dateTimeStamp":
|
|
155
|
+
func = "DecodeDateTimeStamp"
|
|
156
|
+
|
|
157
|
+
else:
|
|
158
|
+
raise Exception("Unknown data type " + prop.datatype) # pragma: no cover
|
|
159
|
+
|
|
160
|
+
if prop_is_list(prop):
|
|
161
|
+
return f"DecodeList[{prop_go_type(prop, classes)}](value, path, {prop_ctx_name(cls, prop)}, {func}, obj.{varname(prop.varname)}())"
|
|
162
|
+
|
|
163
|
+
return f"{func}(value, path, {prop_ctx_name(cls, prop)}, obj.{varname(prop.varname)}())"
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def prop_encode_func(cls, prop, classes):
|
|
167
|
+
if prop.enum_values:
|
|
168
|
+
func = "EncodeIRI"
|
|
169
|
+
|
|
170
|
+
elif prop.class_id:
|
|
171
|
+
func = "EncodeRef[" + interface_name(classes.get(prop.class_id)) + "]"
|
|
172
|
+
|
|
173
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#string":
|
|
174
|
+
func = "EncodeString"
|
|
175
|
+
|
|
176
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#anyURI":
|
|
177
|
+
func = "EncodeString"
|
|
178
|
+
|
|
179
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#integer":
|
|
180
|
+
func = "EncodeInteger"
|
|
181
|
+
|
|
182
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#positiveInteger":
|
|
183
|
+
func = "EncodeInteger"
|
|
184
|
+
|
|
185
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#nonNegativeInteger":
|
|
186
|
+
func = "EncodeInteger"
|
|
187
|
+
|
|
188
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#boolean":
|
|
189
|
+
func = "EncodeBoolean"
|
|
190
|
+
|
|
191
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#decimal":
|
|
192
|
+
func = "EncodeFloat"
|
|
193
|
+
|
|
194
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#dateTime":
|
|
195
|
+
func = "EncodeDateTime"
|
|
196
|
+
|
|
197
|
+
elif prop.datatype == "http://www.w3.org/2001/XMLSchema#dateTimeStamp":
|
|
198
|
+
func = "EncodeDateTime"
|
|
199
|
+
|
|
200
|
+
else:
|
|
201
|
+
raise Exception("Unknown data type " + prop.datatype) # pragma: no cover
|
|
202
|
+
|
|
203
|
+
if prop_is_list(prop):
|
|
204
|
+
return f'EncodeList[{prop_go_type(prop, classes)}](self.{prop_name(prop)}.Get(), path.PushPath("{prop_name(prop)}"), {prop_ctx_name(cls, prop)}, state, {func})'
|
|
205
|
+
|
|
206
|
+
return f'{func}(self.{prop_name(prop)}.Get(), path.PushPath("{prop_name(prop)}"), {prop_ctx_name(cls, prop)}, state)'
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@language("golang")
|
|
210
|
+
class GoLangRender(JinjaTemplateRender):
|
|
211
|
+
HELP = "Go Schema"
|
|
212
|
+
|
|
213
|
+
FILES = (
|
|
214
|
+
"classes.go",
|
|
215
|
+
"decode.go",
|
|
216
|
+
"encode.go",
|
|
217
|
+
"errorhandler.go",
|
|
218
|
+
"errors.go",
|
|
219
|
+
"extensible.go",
|
|
220
|
+
"linkstate.go",
|
|
221
|
+
"listproperty.go",
|
|
222
|
+
"optional.go",
|
|
223
|
+
"path.go",
|
|
224
|
+
"property.go",
|
|
225
|
+
"ref.go",
|
|
226
|
+
"reflistproperty.go",
|
|
227
|
+
"refproperty.go",
|
|
228
|
+
"shaclobject.go",
|
|
229
|
+
"shaclobjectset.go",
|
|
230
|
+
"shacltype.go",
|
|
231
|
+
"util.go",
|
|
232
|
+
"validator.go",
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
def __init__(self, args):
|
|
236
|
+
super().__init__(args)
|
|
237
|
+
self.__output = args.output
|
|
238
|
+
self.__render_args = {
|
|
239
|
+
"package": args.package,
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@classmethod
|
|
243
|
+
def get_arguments(cls, parser):
|
|
244
|
+
parser.add_argument(
|
|
245
|
+
"-p",
|
|
246
|
+
"--package",
|
|
247
|
+
help="Go Package Name",
|
|
248
|
+
default="model",
|
|
249
|
+
)
|
|
250
|
+
parser.add_argument(
|
|
251
|
+
"--output",
|
|
252
|
+
"-o",
|
|
253
|
+
type=Path,
|
|
254
|
+
help="Output directory",
|
|
255
|
+
required=True,
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
def get_outputs(self):
|
|
259
|
+
t = TEMPLATE_DIR / "golang"
|
|
260
|
+
|
|
261
|
+
for s in self.FILES:
|
|
262
|
+
yield self.__output / s, t / (s + ".j2"), {}
|
|
263
|
+
|
|
264
|
+
def get_extra_env(self):
|
|
265
|
+
return {
|
|
266
|
+
"varname": varname,
|
|
267
|
+
"struct_name": struct_name,
|
|
268
|
+
"interface_name": interface_name,
|
|
269
|
+
"class_type_var": class_type_var,
|
|
270
|
+
"prop_name": prop_name,
|
|
271
|
+
"prop_is_list": prop_is_list,
|
|
272
|
+
"prop_go_type": prop_go_type,
|
|
273
|
+
"prop_ctx_name": prop_ctx_name,
|
|
274
|
+
"prop_decode_func": prop_decode_func,
|
|
275
|
+
"prop_encode_func": prop_encode_func,
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
def get_additional_render_args(self):
|
|
279
|
+
return self.__render_args
|