Managing single Ontologies not possible via API -> unify handling of schemaIds for different schema types
Hi,
Description: Currently it's not possible to delete, update, or get a previously added Ontology via the API.
Reason:
The reason is that when adding Schemas (via HTTP POST /schemas
) the schemaId
is calculated differently, depending on the actual type of content. For SHACL Shapes the schemaId
is generated by calculating a SHA256 hash of the file content, whereas for Ontology files the URI of the contained Ontology is taken.
The endpoints to retrieve, update, or delete a specific schema expect the schemaId
to be provided via a path variable.
Example:HTTP DELETE /schemas/<schemaId>
These endpoints do not work when you provide a URI as path variable (which are calculated for the Ontologies).
Suggested solution: Unify the calculation of the schemaId in method SchemaStoreImpl.addSchema()
to just use a SHA256 hash of the file content or just use simple UUIDs depending on the intended behavior of the schema management. Didn't spend much time to investigate possible side effects of this approach.
From my point of view, currently I do not see a reason why it's necessary to handle creation of schemaIds differently. But apart from that, the current implementation is not stable with the current approach.
Please let me know your thoughts about this. I could also provide an implementation for the suggested solution.
Andreas