Shacl2code

Latest version: v0.0.10

Safety actively analyzes 622217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.0.10

What's Changed
* python: Rename SHACLDocument -> SHACLObjectSet by JPEWdev in https://github.com/JPEWdev/shacl2code/pull/3
* JSON Schema output should no longer generate warnings when run using `ajv`
* `SHACLObjectSet` now has insertion API
* `sh:in` is used to detect enumerations instead of `owl:NamedIndividual`; Named individual IRIs are now reported as class constants
* `SHACLObjectSet` argument `force_graph` renamed `force_at_graph` to make it clear it controls `graph` generation
* `SHACLObjectSet` argument `subclass` is renamed `match_subclass` and defaults to `True` (making it more intuitively match `instanceof`)
* Python bindings now validate when deserializing
* Python bindings now support extensible classes
* `SHACLObject.DESERIALIZERS` is renamed `SHACLObject.CLASSES` since it's not limited to deserializing

**Full Changelog**: https://github.com/JPEWdev/shacl2code/compare/v0.0.9...v0.0.10

0.0.9

In this release:
* A new `SHACLDocument` object is created to manage object sets when serializing/deserializing
* Memory usage in python is reduced by making properties class members instead of object members
* `SHACLObject` initialization rearranged to make it easier to create custom classes
* A new `register()` class decorator makes it easier to register custom classes to be serialized/deserialized
* JSON-LD serializers order data more plesantly

**Full Changelog**: https://github.com/JPEWdev/shacl2code/compare/v0.0.8...v0.0.9

0.0.8

In this release:
* Allow properties that reference non-`sh:NodeShape` classes to be referenced by a URI

**Full Changelog**: https://github.com/JPEWdev/shacl2code/compare/v0.0.7...v0.0.8

0.0.7

In this release:
* Enum values are no longer named based on `rdfs:label` since that is intended to be the human readable name
* `xsd:dateTimeStamp` is now supported
* `shacl2code` now accepts multiple RDF graph input files. This is useful to add annotations to an existing model
* `https://rdf.spdx.org/ns/schema#idPropertyName` is renamed `https://jpewdev.github.io/shacl2code/schema#idPropertyName` to namespace it to shacl2code
* `spdx:refable` is removed in favor of using `sh:nodeKind` on a class since that property is validated by SHACL
* Python bindings no longer include the entire context with an arbitrary parser; compacted values are now included in the generated code instead
* Inheriting from `sh:NodeShape` is now the trigger to generate a class instead of "not being an enum"

**Full Changelog**: https://github.com/JPEWdev/shacl2code/compare/v0.0.6...v0.0.7

0.0.6

In this release:
* _Lots_ of rewrites of things to make them better
* It should now be possible to write other Encoders and Decoders to serialize/deserialize data in different formats (instead of just JSON-LD)
* Adds support for custom schema properties in the model to provide information for the serializers
* Tests now use a custom model instead of the SPDX 3 model. This is more flexible and allows testing of corner cases
* Python property names now have `_` for invalid variable name characters.
* Parsing of the model now uses `rdflib` so it can handle any format supported by that library (e.g Turtle, etc.)
* Eliding of arrays that have a single member is no longer enabled by default for JSON schema (it's annoying for plain JSON consumers to have to deal with that; it's either an array or it's not).


**Full Changelog**: https://github.com/JPEWdev/shacl2code/compare/v0.0.5...v0.0.6

0.0.5

*In this Release*
* Much better testing, including 100% code coverage and coverage reports
* Support for mandatory context in the generated bindings. The context is pulled when the bindings are generated and encoded in the bindings. This allows files to be written in a more human readable format, but the generated bindings don't need to go pull the context from the internet to work. Note: This only works if your context is static since it's only referenced when the bindings are generated.
* Reworking the way context is handled both in the code and in the generated Python bindings
* A new `jsonschema` output format which generates a [JSONSchema](https://json-schema.org/) file that can be used to validate a document is correctly formatted. This can be useful if users want to validate their documents without needing a full JSON-LD validator.

**Full Changelog**: https://github.com/JPEWdev/shacl2code/compare/v0.0.4...v0.0.5

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.