kbss-cvut / s-pipes

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

Fix construct-matched-person lastName binding #270

Closed palagdan closed 2 months ago

palagdan commented 2 months ago

Resolves #269

palagdan commented 2 months ago

@blcham I tried using different variables for lastName in the inner and outer queries, and it worked. I’m not sure why this makes a difference. Do you have any suggestions?

Screenshot from 2024-09-02 16-37-05

palagdan commented 2 months ago

@blcham

I worked on the JSON-LD output and identified several issues that I want to explain below:

  1. RDFNode as a Resource: If the RDFNode is a resource, I added "@type": "@id". This change addresses an error I encountered on the frontend, where I needed to retrieve just a URI but instead received a nested object with @id.

    Screenshot from 2024-09-02 19-43-57

    Now, it does not nest the object and resolves the URI properly.

    Screenshot from 2024-09-02 19-41-28

  2. Primitive Types: I removed @type for primitives because adding it for strings broke the JSON-LD, and for other primitives like integers, it did not resolve the prefix at all.

    Screenshot from 2024-09-02 19-35-03

    Without the @type, it works correctly:

    Screenshot from 2024-09-02 19-45-29

  3. Prefix Resolution: I added "ValidationConstraintError": "http://onto.fel.cvut.cz/ontologies/s-pipes/ValidationConstraintError" to the context because the prefix wasn't resolving before:

    Screenshot from 2024-09-02 19-48-11

    Now it resolves correctly:

    Screenshot from 2024-09-02 19-49-01

blcham commented 2 months ago

@palagdan I believe we discussed that null values are not shown properly so PR should handle it as well. Thus not merging the PR yet.

palagdan commented 2 months ago

@blcham Currently, the output includes input variables that are null. In the case of the lastName example, when it is null, the context contains information about the variable, but it is not included in the evidence because we don't include these variables in the model

  e.forEach((key, value) -> {
                    if(value != null){
                        model.add(
                                r,
                                getP(key),
                                value);
                    }
             });
            evidenceRe

Screenshot from 2024-09-12 10-56-53

blcham commented 2 months ago

@palagdan yes, that is correct behaviour. Maybe it will be harder to visualize in backend and thus more appropriate solution would be also to include ordered column list as well ... so think about it if it is not needed to simplify frontend visualization of the table, closing this issue