w3c / vc-data-model-2.0-test-suite

W3C Verifiable Credentials v2.0 test suite
https://w3c.github.io/vc-data-model-2.0-test-suite/
Other
9 stars 10 forks source link

@type is not an URI test does not fail when using JSON-LD processor #27

Open filip26 opened 11 months ago

filip26 commented 11 months ago

Please note that this test input/credential-type-mapped-nonurl-fail.json does not fail when the input is given directly to a JSON-LD processor. The tot-a-url#ExampleTestCredential is treated as a relative URI and gets expanded.

See the expanded input

filip26 commented 11 months ago

the same for input/credential-type-unmapped-fail.json

aljones15 commented 11 months ago

Thanks for this. I looked into it and finding strings it doesn't turn into relative urls is an issue. "ftp://bluesberries" is turned into a relative URL as is an empty string "". The later, an empty string, is not a url to my knowledge so this could be a json-ld issue. To further add the issues with this test case, the @vocab in the vc2.0 context will often result in a valid type.

Ok found an invalid url: "http ://foo.org" so I will update with that shortly.

I do feel json-ld based processor needs to not consider an empty string a valid url. I might add that ftp is a valid url, but is treated as a relative url amongst other oddities.

@davidlehn any thoughts here? @filip26 's jsonld playground examples are pretty good.