Ostrzyciel opened a new pull request, #2846:
URL: https://github.com/apache/jena/pull/2846
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:
- `XSDDatatype`
- Removed commented-out datatype definitions for ENTITIES, NMTOKENS,
IDREFS.
- Removed some other commented-out temporary code that was supposed to
be cleaned up some time ago (I guess).
- I left in the registered datatypes for QName, ENTITY, ID, IDREF,
NOTATION, because they are not doing any harm here.
- `XSSimpleType`
- Removed method `isIdType()` along with its implementations (was
unused).
- Removed method `getPrimitiveKind()` along with its implementations
(was unused).
- `XSSimpleTypeDecl`
- Removed the registration of type validators for: QName, ENTITY, ID,
IDREF, NOTATION.
- Removed validation code for these datatypes.
- Removed all code related to XSD unions and lists (not needed in RDF).
Notably, this left atomic types as the only possible types, which greatly
reduced the number of branches.
- *Note:* there was some weirdness in the code where anySimpleType was
treated as NOTATION for some reason. I have untangled this. I think any changes
to this won't matter anyway, because neither NOTATION nor xsd:anySimpleType
make particular sense in RDF.
- `XSSimpleTypeDefinition`
- Removed constants VARIETY_UNION, VARIETY_LIST.
- Removed methods related to handling lists and unions.
- `BaseSchemaDVFactory` and `FullDVFactory`
- Replaced the code for: QName, ENTITY, ID, IDREF, NOTATION, ENTITIES,
NMTOKENS, IDREFS with dummy registrations. We still need to register something
for these datatypes here, because this is used by `XSDDatatype` in a public
interface.
- Removed the code for XSD lists and unions.
- `BaseDVFactory` and `SchemaDVFactory`
- Removed the code for XSD lists and unions.
- Removed validator classes (now unused): IDDV, IDREFDV, EntityDV, ListDV,
UnionDV
----
- [x] Tests are included.
- [x] Documentation change and updates are provided for the [Apache Jena
website](https://github.com/apache/jena-site/)
- [x] Commits have been squashed to remove intermediate development commit
messages.
- [x] Key commit messages start with the issue number (GH-xxxx)
By 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](https://www.apache.org/licenses/contributor-agreements.html).
----
See the [Apache Jena "Contributing"
guide](https://github.com/apache/jena/blob/main/CONTRIBUTING.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]