kbss-cvut / s-pipes

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

Validation error should have in result-set primitive types resolved #265

Closed blcham closed 2 weeks ago

blcham commented 3 weeks ago

Relates to https://github.com/kbss-cvut/s-pipes/issues/246.

image

Here, we need to improve the values of the row as it contains NUM^^xsd:int. In the case above it would be possible to fix it by:

  "@context": {
    "row": {
      "@id": "http://..../row",
      "@type": "xsd:int"
    }
  }

Alternatively, instead of the solution above, you can try even easier solution to add tripe: <http://.../row> rdfs:range xsd:int .

blcham commented 3 weeks ago

@palagdan Please, before you start working on the task, send here the 1) json-ld output you get now 2) frame that is used to create final json-ld value

I will try to play with JSON-LD playground to pink the best solution how to achieve it.

palagdan commented 3 weeks ago

@blcham I created a ticket yesterday to include the primitive types from the Result-Set.

blcham commented 3 weeks ago

@palagdan Unfortunatelly, I do not understand how https://github.com/orgs/kbss-cvut/projects/10/views/2?filterQuery=pala&pane=issue&itemId=75481315 is relevant to this issue.

palagdan commented 3 weeks ago
  1. I receive this json-ld:

    {
    "@id": "_:b0",
    "@type": "s-pipes:ValidationConstraintError",
    "constraintFailureEvidences": [
        {
            "@id": "_:b1",
            "column": "Failure condition label (CS)",
            "row": "6^^http://www.w3.org/2001/XMLSchema#int"
        },
        {
            "@id": "_:b2",
            "column": "Failure condition label (CS)",
            "row": "4^^http://www.w3.org/2001/XMLSchema#int"
        },
        {
            "@id": "_:b3",
            "column": "Failure condition group id",
            "row": "3^^http://www.w3.org/2001/XMLSchema#int"
        },
        {
            "@id": "_:b4",
            "column": "SNS code",
            "row": "6^^http://www.w3.org/2001/XMLSchema#int"
        },
        {
            "@id": "_:b5",
            "column": "SNS code",
            "row": "5^^http://www.w3.org/2001/XMLSchema#int"
        }
    ],
    "constraintQuery": "# ?row within ?column has empty value\nSELECT ?row ?column\nWHERE {\n\n  ?r csvw:describes ?rd .\n  ?r csvw:rownum ?row .\n\n  ?c a csvw:Column .\n  ?c kbss-csvw:property ?columnProperty .\n  ?c csvw:title ?column .\n\n  FILTER NOT EXISTS {\n    ?rd ?columnProperty ?valueNE .\n  }\n\n  FILTER(?columnProperty in ( :Failure_condition_label__CS_, :Failure_condition_group_id, :SNS_code ))\n}",
    "module": "http://onto.fel.cvut.cz/ontologies/ava/tabular-data-0.1/rdfize-input-data",
    "@context": {
        "module": "http://onto.fel.cvut.cz/ontologies/s-pipes/module",
        "constraintFailureEvidences": {
            "@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/constraintFailureEvidences",
            "@container": "@list"
        },
        "constraintQuery": "http://onto.fel.cvut.cz/ontologies/s-pipes/constraintQuery",
        "column": "http://onto.fel.cvut.cz/ontologies/s-pipes/column",
        "row": "http://onto.fel.cvut.cz/ontologies/s-pipes/row",
        "s-pipes": "http://onto.fel.cvut.cz/ontologies/s-pipes/"
    }
    }
  2. Frame:

    String frameJson = """
            {
              "@context": {
                "module": "http://onto.fel.cvut.cz/ontologies/s-pipes/module",
                "message": "http://onto.fel.cvut.cz/ontologies/s-pipes/message",
                "constraintFailureEvidences": {
                  "@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/constraintFailureEvidences",
                  "@container": "@list"
                },
                "constraintQuery": "http://onto.fel.cvut.cz/ontologies/s-pipes/constraintQuery",
                %s
                "s-pipes": "http://onto.fel.cvut.cz/ontologies/s-pipes/"
              },
              "@type": "http://onto.fel.cvut.cz/ontologies/s-pipes/ValidationConstraintError",
              "constraintFailureEvidences": {
                %s
              }
            }
            """;
blcham commented 3 weeks ago

@palagdan I do not have any new suggestion as i could not test with frame you provided me. There is missing substitution of %s. If you resolve all the issues do not worry about it, otherwise send me frame with substitution -- what i actually need is input of the last transformation of JSON-LD, because we can simulate it directly in https://json-ld.org/playground/