Closed Alfiva closed 4 years ago
Thanks for your advice. I created a branch fixing the mentioned issues. I think gonna be a good idea detect which serializer is using (to avoid some hardcode), keep it and use it en getParser(). Im working on it
@Alfiva can you test the code in issue_500 branch?
The core issue is solved but there are new issues: For instance, when posting a new Publisher, the response is server error 500. This is because Activator.hasRegisteredParsers() in Publishers:118 returns false. That method seems "upside down", returning serializerListener.parsers.isEmpty(). Also, remember to remove the System.out.println()s before the final merge.
I found the error and fixed it. Additionally i added some debug lines to easy debuging. Please, test it.
OK now it seems it works OK. However, while in this topic... Does this all mean taht every module that imports the serializer service has to be checked now for whehter it is the JSON serializer or Turtle serializer? Because this breaks the CHe, and I don't know how many modules more.
Serializer can be selected, if not, Turtle serializer is selected by default; we put thought in retrocompatibility. However, test it any way there may be issues.
Because of how serializer is discovered in CHE, JSONLD serializer could arbitrarily be chosen. I had to go in and check serializer type, it is updated now.
After the latest updates, it seems the inclusion of JSON-LD serializater/parser is incomplete. I get JSON-LD parsing exceptions in various situations, like publishing an event or restoring the previous state from the database when the REST API re-starts. For instance in this last case:
I have checked the code and it's like the migration to including JSON-LD serializer is incomplete. This stems from the fact that in some cases it uses .getTurtleParser(), getJsonParser() and getParser() not consistently. For instance I think getParser() should no longer be used used because it returns an arbitrary serializer without discriminating type. In the case of the exceptions caused, it returns a JSON-LD serializer (I guess it's the first in the list) while being used in a Turtle context. Also, there is a "serializerJSONLDListener" in Activator that is not used anywhere... I don't know if that means there is some missing code...