-
Notifications
You must be signed in to change notification settings - Fork 7
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
CURIE maybe not working? #7
Comments
Can you give an example of CURIE expansion not working. It seems to work for me. Here, a document is being loaded without any import dougrain
obj = {"_links": {"curies": [{'name': "app",
'href': "/rels/{rel}",
'templated': True}],
"self": {'href': "/1"},
"app:home": {'href': "/"},
"app:spam": {'href': "/main"},
"app:eggs": {'href': "/eggs/1"},
"/rels/eggs": {'href': "/eggs/2"}}}
doc = dougrain.Document.from_object(obj)
assert doc.links["/rels/spam"].url() == "/main"
assert doc.links["app:spam"].url() == "/main"
assert len(doc.links["app:eggs"]) == 2
assert doc.links["app:eggs"] == doc.links["/rels/eggs"] |
If that is how it should work, then I just didn't get what a CURIE should do. I thought that: doc.links["app:spam"].url() should expand to "/rels/main" I'm sorry for taking your time, probably should have studied the CURIE's better. |
You can expand a CURIE from a document using the |
I have the impression, that CURIE does actually not work, they only expand to the correct url if you have a "base_uri" specified which prefixes everything.
The text was updated successfully, but these errors were encountered: