-
Notifications
You must be signed in to change notification settings - Fork 555
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
Dataset: NQuads serialization only makes sense for context-aware stores! #2335
Comments
@sdasda7777 this is a known bug (IMO at least) recorded here #1892. I will close this as a duplicate, however, I think that NQuads for a non-context-aware store should be identical to NTriples [ref]. |
I see, I was hoping for some kind of solution, but since it's open for that long I guess I can forget about that.
For this example, yes. However JSON-LD may actually have context information, and I want it to work in that case as well. |
Section number 8 of the standard has an example that should translate into multiple graphs. You can see it really does when you try converting it to N-Quads on the JSON-LD playground, which is exactly what I want to be able to do. |
But then you should use a context-aware store like
The reason this bug is not fixed, even though it is simple to fix, is that it can easily be worked around by users, even if we fix it, it will be no different from just using NTriples, and this is because non-context aware stores cannot contain named graphs, and if there are no graph names NQuads is equivalent to NTriples. We will be grateful for PRs that fix #1892. |
But I am using a Dataset, am I not?
Okay, so I should be able to do this conversion just fine if I use context-aware store? Which stores are those? |
I overlooked that, you are indeed using Dataset. In that case, this is a somewhat separate bug from #1892.
Dataset should be context aware, but I guess for some reason the serializers disagree. |
Yeah, it is the same output, I am using Python 3.10.4 and rdflib 6.3.2, if that helps in any way. |
Okay, then I don't really have an immediate answer. I will look at it when I have time. It does seem like a bug, and a pull requests fixing this will be welcome. |
Oh wait, I think the problem is this:
Don't reassign
|
Oh, you're right! Thank you so much!!! |
@aucampia how about making |
@namedgraph there is actually a PR that will fix this - though it will use But this needs some other things fixed before we can merge it. |
The reason the output is empty is because of this bug: |
Hi, I'd like to serialize JSON-LD to N-Quads, however I keep getting
NQuads serialization only makes sense for context-aware stores!
exception. From the Dataset definition and this issue it seems that it however should work, correct? Here is my code (formatting might be bit off):The text was updated successfully, but these errors were encountered: