Deprecate RDFFormat.forFileName and RDFFormat.forMIMEType

#244 Merged at fa46c0e
Repository
Branch
SES-2015
Repository
Branch
2.8.x
Author
  1. Peter Ansell
Reviewers
Description

This Pull Request deprecates RDFFormat.forFileName and RDFFormat.forMIMEType for Sesame-2.8.0.

It also makes them work slightly better by calling them from the registries, as an interim measure while users recognise the deprecation and move to using the dynamic methods in Rio.

The changes to RDFParserRegistry and RDFWriterRegistry do not fully fix the issue that users have consistently found with third-party instances of RDFFormat, as the registries are not likely to be initialised before the user calls the RDFFormat methods for the first time. This results in them wondering why it works the second time, but not the first time.

Adding the Marmotta developers as reviewers as that is where the issue came up last time, and I noticed a commit that used RDFFormat.forFileName again today:

https://github.com/apache/marmotta/commit/f53b62551b7ad0bd99f245e8b50645d0bf8a76d9#comments

  • Issues SES-2015

Comments (2)

  1. Jakob Frank

    Required changes in Apache Marmotta should be quite straight forward, we'll track that in MARMOTTA-437

    The mechanism to register custom Reader/Writers (ServiceLoader) will not change?

    1. Peter Ansell author

      The ServiceLoader is not changing, other than it (RDFParserRegistry/RDFWriterRegistry) will attempt to register RDFFormat objects that it finds if they are not already registered. However, that may still break for users on the first time through, as they are likely to call RDFFormat.forMIMEType/forFileName before calling Rio.createParser. Best solution is to deprecate the RDFFormat methods and remove them in in a future version.