-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
add loader for file: URLs #65
base: main
Are you sure you want to change the base?
Conversation
- Remove `C` local context abstraction - Remove `LiteralString` type - Hide metadata in `List`, `Entry` and `Indexed`.
Improve context types.
Add `serde` feature.
Upgrade `grdf` to version 0.21 Upgrade `nquads-syntax` to version 0.16
Upgrade `rdf-types` to version 0.18 Upgrade `json-syntax` to version 0.10 Upgrade `grdf` to version 0.22 Upgrade `nquads-syntax` 0.17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great thanks! My only caveat is the use of the url
crate where the iref
crate already handles URLs through the Uri
type. URLs and URIs are equivalents.
Also maybe add a description to the PR next time please 😃
@@ -43,6 +44,7 @@ pretty_dtoa = "0.3" | |||
mime = "0.3" | |||
reqwest = { version = "^0.11", optional = true } | |||
bytes = { version = "^1.3", optional = true } | |||
url = { version = "2.4.1", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The iref
crate already handles URLs through the Uri
/UriBuf
type.
if !url_str.starts_with("file:") { | ||
return Err(Error::NotFileUrl(url_str.into())); | ||
} | ||
let url_parsed = Url::parse(url_str).map_err(Error::InvalidUrl)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use Iri::as_uri
for that.
{ | ||
async move { | ||
let url_str = vocabulary.iri(&url).unwrap().as_str(); | ||
if !url_str.starts_with("file:") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use:
let url = vocabulary.iri(&url).unwrap();
if url.scheme() != "file" {
// ...
}
I agree that this is redundant, but the reason I used the
oops, sorry about that! 😨 |
27c0a80
to
bc5ebdc
Compare
You're right, I should add a similar function into |
No description provided.