-
Notifications
You must be signed in to change notification settings - Fork 136
String xsd:double value crash toRdf()
#202
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
String xsd:double value crash toRdf()
#202
Conversation
xsd:double value crash toRrdf()
|
@BigBlueHat @davidlehn please let me know what you think. Thanks! |
|
An extra test should not bring about much harm. It can be deduplicated and, if necessary, merged into the test suite of the API specification later. |
Please don't assume "it works in the json-ld.org playground" means the output is correct! We need the shared tests to be reviewed to ensure they are actually correct. It's entirely possible that the playground js code is doing something wrong and needs fixing too. Better to have the test in the approved shared suite so everyone agrees on behavior.
Great, please update the patch. Looks like it's probably a few blank lines, trailing commas, and some trailing whitespace to fix? Open an issue and/or PR about using other tooling.
Again, seems like this patch should match the style of the existing code, which doesn't yet use annotations. Probably best to discuss it in an issue then slowly or bulk add everywhere needed.
I wasn't questioning the need or reason to have a test. Did you determine if the test suite had anything to cover this? That a test needed to be written seems to imply no. This 100% needs to be in the spec api test suite if that is the case. All implementations need to cover the issue. I know it's a bit awkward to figure out how to add tests to the spec suite. Naming there has been a mess. But adding something that can get some feedback and adjusted later is not too bad. At least in the js implementation there are (clunky) features to run single or a group of tests. I use that all the time. It's often as easy as local per-implementation tests and the general tests need to be in the api test suite anyway.
It is absolutely harmful to have general tests that only exist in one implementation! Interoperability is what JSON-LD is about. All implementations need to know they function the same on a test suite shared and approved by the community.
Duplication is a problem. It would mix up which tests are Python specific vs ones that need to be added to the API test suite and removed. If it is a duplicate, than please clearly document why and refer to the API test. But what would that be for? It's now later and it is necessary. Please add it to the spec api test suite. I also find adding to the test suite sometimes encourages me or others to add more variations. Especially when it's about a handful of triples. Like here, do positive, negative, zero, lots of sig digits, values near maximums and minimums, maybe some non-numbers if it makes sense, etc. All that being said, thank you for the test and fix. :-) |
xsd:double value crash toRrdf()xsd:double value crash toRdf()
|
I included a compromise of this in #228 based on the work & comments of @anatoly-scherbakov @davidlehn. Discussion can continue there if desired. |
Why
Here's a JSON-LD document.
{ "@context": { "xsd": "http://www.w3.org/2001/XMLSchema#", "geoLongitude": "http://www.w3.org/2003/01/geo/wgs84_pos#longitude" }, "@graph": [ { "@id": "http://www.wikidata.org/entity/Q399", "geoLongitude": { "@type": "xsd:double", "@value": "45" } } ] }Conversion of this document to a RDF dataset works at JSON-LD playground, but it will crash
pyld2.0.4:What
This PR