GH-2828: Remove validation for XML-only datatypes#2846
Merged
afs merged 1 commit intoapache:mainfrom Nov 20, 2024
Merged
Conversation
afs
reviewed
Nov 20, 2024
| // If you see this, remove commented lines. | ||
| // Merely temporary during switch over and testing. | ||
| // public static final XSDDatatype XSDQName = new XSDDatatype("QName"); | ||
| public static final XSDDatatype XSDQName = new XSDPlainType("QName"); |
Member
There was a problem hiding this comment.
Lets' add @deprecated(forRemoval = true) and /** @deprected Do not use */ to XSDQname and the other non-RDF XSD datatypes.
Member
There was a problem hiding this comment.
Other than that, the rest looks great!
Contributor
Author
There was a problem hiding this comment.
Done. I've also added a note to remove these in Jena 6, together with the associated dummy code in BaseSchemaDVFactory.
Issue: apache#2828 Remove the code for validating datatypes that according to the RDF 1.1 spec SHOULD NOT be used: QName, ENTITY, ID, IDREF, NOTATION, ENTITIES, NMTOKENS, IDREFS. Also remove code for validating XSD lists and unions.
afs
approved these changes
Nov 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub issue resolved #2828
Pull request Description:
Remove the code for validating datatypes that according to the RDF 1.1 spec SHOULD NOT be used: QName, ENTITY, ID, IDREF, NOTATION, ENTITIES, NMTOKENS, IDREFS. Also remove code for validating XSD lists and unions. This should not change the behavior of Jena for users, unless they were relying on it to validate their weird XML data, which I don't think is an official functionality of Jena.
This is the first step to resolving #2828 – first I wanted to focus on untangling the unneeded the logic. In future PRs, I will remove all the dead code.
After applying these changes, the size of the jena-core JAR was reduced by 13 489 bytes. Not huge, but still something.
Details:
XSDDatatypeXSSimpleTypeisIdType()along with its implementations (was unused).getPrimitiveKind()along with its implementations (was unused).XSSimpleTypeDeclXSSimpleTypeDefinitionBaseSchemaDVFactoryandFullDVFactoryXSDDatatypein a public interface.BaseDVFactoryandSchemaDVFactoryBy submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.
See the Apache Jena "Contributing" guide.