-
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
json-ld serialize doesnt failt or raise warning, when producing invalid syntax; type is literal #2747
Comments
It fails at this point: (rt is the dict
This is the testfile that fails to be loaded again: rdflib/test/data/suites/n3roundtrip/rdf-test-11.n3 Lines 1 to 14 in 9834665
|
Ok i'm pretty sure this is a bug in the serializer and not in the parser. I would change the parser to give more leniency and let it fallback to its behaviour of version |
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
[] a foaf:Person. is serialized to [
{
"@id": "_:ncd6c76112bd148c0a0c9a8a035854d6cb1",
"@type": [
"http://xmlns.com/foaf/0.1/Person"
]
}
] As far as i understand it should be |
I guess the serialized result you got there is just the JSON-LD in the expanded form. If you don't want it as a list, you can use compaction. Behaviour of Sorry, haven't looked too much into how this is related to your original issue though. |
Mh your right. I still think value objects arent allowed in that array. so things like |
Yeah, probably the JSON-LD processor in RDFLib is just not as strict. Your provided example fails in https://json-ld.org/playground/ when the value of JSON-LD example: https://tinyurl.com/2atu5gdy |
Ive renamed the issue, because of the bug in the serializer. Now Roundtrip test with default jsonld version 1.1 will succeed. |
So im not sure if this is a bug. So i tested if there are any problems bumping up the default version of json-ld to
1.1
and the roundtrip test failed. Background is #2606Cant pe parsed with version
1.1
but it works with1.0
.It seems that it tries to get an existing reference to the type
{"@value": "another thing"}
which is a dict and cant be hashed. It doesnt try to do this in version1.0
.The text was updated successfully, but these errors were encountered: