kbss-cvut / s-pipes

Tool for execution of RDF-based pipelines.
GNU Lesser General Public License v3.0
4 stars 5 forks source link

Refactor RDFNode to string to separate utils class #264

Closed palagdan closed 3 weeks ago

palagdan commented 3 weeks ago

Resolves #263

blcham commented 3 weeks ago

@palagdan I am merging this as I understand it only as REFACTORING of code. It does not change any functionality.

palagdan commented 3 weeks ago

@blcham I refactored the toString() method to separate it into a utility class and used this method to insert the fields of evidences into the ValidationException map. So it inserts literals in readable form as shown in logs #76 For example, instead of inserting NUM^^xsd:int, it now directly inserts "Num" into the evidence field.

  evidenceMap.put(varName, RDFNodeUtils.toString(value));
blcham commented 3 weeks ago

@palagdan Ohhhh ... I missed that ... it was misleading that you call this issue refactor. I reserve word refactor to do changes that does not effect functionality.

evidenceMap.put(varName, RDFNodeUtils.toString(value));

This is not correct way to solve the issue. We do not want to change data that are outputted by RDF, we want to change @context instead.

blcham commented 3 weeks ago

Thus please, revert this line back, while have a look at my proposal at https://github.com/kbss-cvut/s-pipes/issues/265 . The goal here is output correct RDF and its shape = JSON-LD as well so it looks like classical JSON just with additional @context. But it is important that we do not change initial RDF data just because we want to have nicer JSON.

palagdan commented 3 weeks ago

Sorry, it was a misunderstanding. I thought it would solve the issue with the output of the evidence.