Closed apdavison closed 8 months ago
@apdavison this would be a workaround to a missing / incomplete schema definition correct? I would assume a cleaner solution would be an update in the actual schemas.
Option 1)
Option 2)
LocalFile was intended more for files that no longer exist.
The use case here is more for people preparing openMINDS collections locally before they've uploaded their data to a public repository. The idea is that they would use "file://" URLs when preparing the collection, then replace these with the correct "https://" URLs once the files are uploaded.
@apdavison thanks for the clarification. LocalFile was in my eye exactly used for files stored locally. So there was a misunderstanding when we created that. However the use case you describe is something which we should support on the schema level (not only as workaround within the python package) no?
I don't think there was really an understanding about LocalFile. If a file is stored locally, it doesn't really exist from the perspective of linked data, so LocalFile is for recording that there was once a file at this path, which may or may not still exist.
Doesn't the schema support file:/// IRIs? I don't see anything in the schema definition that precludes it? I didn't see this as a Python-specific workaround, rather this change makes the Python package more schema-compliant.
@apdavison you are right I think. The assumption in the schema is currently that an IRIs follow the string format set by JSON-Schema: https://json-schema.org/understanding-json-schema/reference/string#resource-identifiers (which should accept file://). Sorry for the confusion...
Instead, added a validation check that will flag
file:///
IRIs