Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace handling directly with the uuid module #13

Open
thomasbtnfr opened this issue Jan 12, 2023 · 2 comments
Open

Namespace handling directly with the uuid module #13

thomasbtnfr opened this issue Jan 12, 2023 · 2 comments

Comments

@thomasbtnfr
Copy link
Collaborator

Can we improve the use of the uuid module so that it handles namespaces directly instead of manually indicating the namespace urn each time?

Describe the solution you'd like
A complete management of uuids and namespaces by a particular module (maybe uuid)

Describe alternatives you've considered
If we add the urn namespace manually then we will have to declare it somewhere, in the context and in the RDF python library.

Additional context
Context : bids-standard#83 (comment)

@thomasbtnfr
Copy link
Collaborator Author

thomasbtnfr commented Jan 12, 2023

From a few tests:

  • We can't use the uuid directly without the conversion to str otherwise we have the following error : TypeError: Object of type UUID is not JSON serializable when writing the jsonld in output
  • Some functions of the uuid module can use a namespace like uuid3 which takes as parameter a namespace and a name
    Example :
uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

but I'm not sure the output does anything for namespace management

@cmaumet
Copy link

cmaumet commented Jan 12, 2023

see also satra's comment in bids-standard#83 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants