Sidenote: Not that familiar with sparkjava yet, so if there's something obvious I overlooked, do let me know.
What are the main changes you did:
Fixed a bug where /api/fdp didn’t work if metadata was missing and being accessed by non-MANAGER. New behaviour simply returns the default String (and has a try-catch to set the metadata that fails until a MANAGER tried accessing it at least once).
Fixed a bug where /api/fdp/ returned the output instead of /api/fdp (the latter one should be the actual URL according to the MOLGENIS documentation). Additionally, the non-slash version is used as IRI within the triples to indicate the FAIR data point.
Changed head with text/turtle content type to be only triggered where a GET response is present returning Turtle data (=removed wildcard head call). This way a non text/turtle should indicate the user is using an invalid API URL.
Fixed a bug where the triples belonging to the same subject weren’t outputted together.
Current fix requires the FAIR Data Point root metadata “Advanced settings” key to contain fully valid Turtle data. This will break instances where metadata is already stored in this variable! It will return an error message like “Namespace prefix 'lang' used but not defined [line 8]” and can easily be fixed by removing the keypair, as this will generate a new one which is valid.
how to test:
On a FRESH INSTALL: Create a FAIR_DATA_HUB database with example data & check if /api/fdp works out-of-the-box while anonymous (f.e. curl http://localhost:8080/api/fdp)
curl http://localhost:8080/api/fdp should now return data instead of curl http://localhost:8080/api/fdp/
curl -I http://localhost:8080/api/fdp & curl -I http://localhost:8080/api/fdp/catalog/<fair_data_hub_database>/catalogId01 should still return Content-Type: text/turtle but f.e. curl -I http://localhost:8080/api/fdp/ or curl -I http://localhost:8080/api/fdp/catalog should not.
curl -I http://localhost:8080/api/fdp should now have all triples belonging to http://localhost:8080/api/fdp together instead of some extra triples being pasted at the end.
todo:
[ ] updated docs in case of new feature
[ ] added/updated tests
[ ] added/updated testplan to include a test for this fix, including ref to bug using # notation
Sidenote: Not that familiar with sparkjava yet, so if there's something obvious I overlooked, do let me know.
What are the main changes you did:
/api/fdp
didn’t work if metadata was missing and being accessed by non-MANAGER. New behaviour simply returns the default String (and has a try-catch to set the metadata that fails until a MANAGER tried accessing it at least once)./api/fdp/
returned the output instead of/api/fdp
(the latter one should be the actual URL according to the MOLGENIS documentation). Additionally, the non-slash version is used as IRI within the triples to indicate the FAIR data point.text/turtle
content type to be only triggered where a GET response is present returning Turtle data (=removed wildcard head call). This way a nontext/turtle
should indicate the user is using an invalid API URL.FAIR Data Point root metadata
“Advanced settings” key to contain fully valid Turtle data. This will break instances where metadata is already stored in this variable! It will return an error message like “Namespace prefix 'lang' used but not defined [line 8]” and can easily be fixed by removing the keypair, as this will generate a new one which is valid.how to test:
/api/fdp
works out-of-the-box while anonymous (f.e.curl http://localhost:8080/api/fdp
)curl http://localhost:8080/api/fdp
should now return data instead ofcurl http://localhost:8080/api/fdp/
curl -I http://localhost:8080/api/fdp
&curl -I http://localhost:8080/api/fdp/catalog/<fair_data_hub_database>/catalogId01
should still returnContent-Type: text/turtle
but f.e.curl -I http://localhost:8080/api/fdp/
orcurl -I http://localhost:8080/api/fdp/catalog
should not.curl -I http://localhost:8080/api/fdp
should now have all triples belonging tohttp://localhost:8080/api/fdp
together instead of some extra triples being pasted at the end.todo: