-
Notifications
You must be signed in to change notification settings - Fork 543
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
Load a remote context via an unsupported network protocol #1650
Comments
I don't think so! I'm not aware that this issue have come up before and recently we removed all use of fancier network packages like But if you just wrapped the current import function with one that could handle other protocols, I'm sure that would be fine. |
@nicholascar thank you for the response!
I must confess I am not sure I understand, so let me rephrase. As a JSON-LD feature, Is possible to override that, is there a hook in rdflib where a developer can insert their own downloader of |
Yes, I think that's the case.
There is no way that is planned for in the rdflib code base, so I think the method that reads the So overall, you will have to find that function and add new logic to it! |
|
@anatoly-scherbakov as far as I can tell it should work fine to just install a custom URL opener, that supports IPFS for example, using |
I would also be open to pull requests that implement custom handlers, like IPFS, into |
Thank you. At the moment I do not have a particular use case for this but I will keep this pointer in mind. Thanks! |
Closing this as we have identified how this can be done using python's standard library. |
Under RDFLIb 6.0.1, I am trying the following example:
which obviously fails:
My particular question is not specifically about adding IPFS support to RDFLib but in the venue of the latter's extensibility without modifying its core code base.
Question. Would it be possible to add support for new network protocols or new mechanisms of retrieval for JSON-LD contexts to RDFLib without modifying its source code? Is there a mechanism like loaders (https://github.com/digitalbazaar/pyld/blob/master/lib/pyld/documentloader/requests.py) in
pyld
? Or, perhaps,pyld
loaders can be somehow reused when parsing JSON-LD documents withrdflib
?P. S. As a workaround, one could
expand()
the source JSON-LD document supplying an appropriate custom loader and then use the result as input for RDFLib but I'd be interested to see if there is a better solution.The text was updated successfully, but these errors were encountered: