pyLODE
pyLODE copied to clipboard
Internal Server Error when processing resource
We have pyLODE master branch running as a service at http://cor.esipfed.org/pylode
The following resource triggers an Internal Server Error
http://cor.esipfed.org/pylode?url=http://cor.esipfed.org/ont/api/v0/ont%3Firi=http://purl.dataone.org/provone/2015/01/15/ontology%23
This does not generate any log so I am struggling to debug what the issue actually is.
I know the service is stable and as other resources render correctly for example http://cor.esipfed.org/pylode?url=http://cor.esipfed.org/ont/api/v0/ont%3Firi=http://sweetontology.net/stateSpaceScale
Have another look at your identifier after the 'iri='. I don't think it's valid.
We've been having a long chat on the slack channel where Lewis brought this up. The identifier of the ontology (not just the namespace) ends in # (which I think is goofy but I won't out-argue the W3C). So when we escape the # in COR I believe the purl resolver is not reconstituting it into a #. I'm not making the argument that the purl resolver is wrong; I'm just not sure what the right answer is. As I say, we're discussing it. :-)
But maybe once we figure out what pylode gets from the purl server, you can handle it with something that mentions the purl server error, to take the heat off of pylode. :-)
@nicholascar The cause of the issue is a missing URL-encoding for a proper request in this line:
https://github.com/RDFLib/pyLODE/blob/c9581dbc1df0caa0d8f823872dafd2e47e476435/pylode/common.py#L103
In our local pyLODE copy I just added a line with the specific # -> %23 replacement:

and this solves our most immediate problem. A more proper solution would involve a general url-encoding of the query string.
I'll submit a PR shortly @carueda thank you.