Closed pohutukawa closed 5 years ago
Hi @pohutukawa,
I think the main issue here is that a string is passed where the package is expecting a qualified name. In such cases, it will try to look for a registered namespace using something before a colon in the string. In the examples you gave, they are did:
and https:
. Since the registered namespaces did not have either of those, it failed. When you registered the did:
namespace, it worked.
Following the PROV specs, two built-in namespaces are reserved and defined: prov:
and xsd:
. Other namespaces will need to be explicitly registered.
Also, it is the requirement of using qualified names as identifiers in PROV that necessitates namespace registration (https://www.w3.org/TR/prov-dm/#term-identifier); URIs cannot be used directly as identifiers in PROV.
Hi @trungdong, thanks for the info/clarification!
Would I be 'doing it right' if I registered did
as a prefix in the way as described above, or is that somewhat ugly/undesired to just register it as a prefix for did:
itself?
Yes, what you're doing is correct.
I am adding decentralised identifiers (DIDs) of the Decentralised Identity Foundation to PROV(-N) trails. However, this Python PROV library chokes with an exception when using those URIs directly (or in fact any full URL) to identify agents:
prov.model.ProvException: Invalid value for attribute prov:agent: did:ssid:8uQhQMGzWxR8vw5P3UWH1ja
or with a full (made up) URL:
prov.model.ProvException: Invalid value for attribute prov:agent: https://w3id.org/ssid/8uQhQMGzWxR8vw5P3UWH1ja
DIDs are fully qualified URNs, that have a provisional name added already to the IANA URI schemes:
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
In my opinion added short namespaces were only required as a convenience, but not necessity for long/full URIs.
Anyway, I think it would be good if these could be used (both above) in full at any time.
For now, I'm just adding a dummy
did
namespace shorthand, which resolves todid:
Please, also see the thread here on public-prov-comments mailing list:
https://lists.w3.org/Archives/Public/public-prov-comments/2019Mar/thread.html