Disable @reverse in API output

Via Add JSON-LD @reverse properties to resources by jimsafley · Pull Request #1795 · omeka/omeka-s · GitHub the @reverse property came to the JSON-LD API output. But I wonder, why was it chosen for to be always present, not optional? I have some Items which have serveral thousand incoming links make the gathering and outputting of the the @reverse propeprty a “heavy” operation.

As I am harvesting all JSON-LD regularly to import in a triplestore, For this harvest performance is an issue and the @reverse is not used at all. As a workaround, I changed Api/Representation/AbstractResourceEntityRepresentation.php so that if the noreverse parameter is present, no reverse is gathered and outputted.

A test with one particular item showed the default output was 2.6Mb and took 2.6 seconds, the noreverse output was 3Kb and took .2 seconds.

It’s a reasonable request. It’s defiantly something that we should address. I’ve just created a pull request that adds a setting to disable JSON-LD @reverse. We’re going to consider it for the next minor release.