Closed palagdan closed 2 months ago
@blcham I replaced String with RDFNode in the evidences map, which resolved the primitive type issue. Output now: If I understand correctly, I need to add @type to the evidence columns.
@blcham When I try to add @type to the evidence columns, I receive evidence columns with a "s-pipes" prefix. I have tried various solutions, but I am unable to remove this prefix. But the overall result looks fine for me.
@blcham When I remove prefix I receive this json-ld. It happens when I add types to the variables:
Inputs of last 2 steps of conversion to JSON-LD
1. Frameing expanded JSON-LD
Frame
{
"@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",
"column": { "@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/column", "@type": "http://www.w3.org/2001/XMLSchema#string" },
"row": { "@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/row", "@type": "http://www.w3.org/2001/XMLSchema#int" },
"s-pipes": "http://onto.fel.cvut.cz/ontologies/s-pipes/"
},
"@type": "http://onto.fel.cvut.cz/ontologies/s-pipes/ValidationConstraintError",
"constraintFailureEvidences": {
"column": {},
"row": {}
}
}
Input:
[
{
"@id": "_:b2",
"http://onto.fel.cvut.cz/ontologies/s-pipes/row": [
{
"@value": "6",
"@type": "http://www.w3.org/2001/XMLSchema#int"
}
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/column": [
{
"@value": "SNS code"
}
]
},
{
"@id": "_:b4",
"http://onto.fel.cvut.cz/ontologies/s-pipes/row": [
{
"@value": "3",
"@type": "http://www.w3.org/2001/XMLSchema#int"
}
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/column": [
{
"@value": "Failure condition group id"
}
]
},
{
"@id": "_:b5",
"http://onto.fel.cvut.cz/ontologies/s-pipes/row": [
{
"@value": "4",
"@type": "http://www.w3.org/2001/XMLSchema#int"
}
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/column": [
{
"@value": "Failure condition label (CS)"
}
]
},
{
"@id": "_:b6",
"http://onto.fel.cvut.cz/ontologies/s-pipes/row": [
{
"@value": "5",
"@type": "http://www.w3.org/2001/XMLSchema#int"
}
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/column": [
{
"@value": "SNS code"
}
]
},
{
"@id": "_:b7",
"http://onto.fel.cvut.cz/ontologies/s-pipes/row": [
{
"@value": "6",
"@type": "http://www.w3.org/2001/XMLSchema#int"
}
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/column": [
{
"@value": "Failure condition label (CS)"
}
]
},
{
"@id": "_:b8",
"http://onto.fel.cvut.cz/ontologies/s-pipes/constraintFailureEvidences": [
{
"@list": [
{
"@id": "_:b5"
},
{
"@id": "_:b7"
},
{
"@id": "_:b4"
},
{
"@id": "_:b2"
},
{
"@id": "_:b6"
}
]
}
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/module": [
{
"@value": "http://onto.fel.cvut.cz/ontologies/ava/tabular-data-0.1/rdfize-input-data"
}
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/constraintQuery": [
{
"@value": "# ?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}"
}
],
"@type": [
"http://onto.fel.cvut.cz/ontologies/s-pipes/ValidationConstraintError"
],
"http://onto.fel.cvut.cz/ontologies/s-pipes/message": [
{
"@value": "?row within ?column has empty value"
}
]
},
{
"@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/column",
"http://www.w3.org/2000/01/rdf-schema#range": [
{
"@value": "http://www.w3.org/2001/XMLSchema#string"
}
]
},
{
"@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/constraintFailureEvidences",
"http://www.w3.org/2000/01/rdf-schema#range": [
{
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#List"
}
]
},
{
"@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/row",
"http://www.w3.org/2000/01/rdf-schema#range": [
{
"@value": "http://www.w3.org/2001/XMLSchema#int"
}
]
}
]
Output: https://tinyurl.com/4e6t9yum
@palagdan message above is what i needed before from you to play with it in JSON-LD playground -- i.e. the frame and the input. Hopefully, I have fixed the issue. Note how it works in https://tinyurl.com/4e6t9yum and how I fixed it in the following two commits:
@palagdan one more thing is missing. Could you do a test for getFramedAndCompactedJsonLd() ?
The test should be simple, just testing evidences or possibly something like message using structure of object that the method returns. We can use example above to test it or example from hello world -- i believe it could be done in < 15 mins.
In test called something like testGetFramedAndCompactedJsonLdReturnsFramedOrderedEvidences()
I would assume what the structure of JSON object from the debugger:
@palagdan please before merging this ticket also improve documentation of https://github.com/kbss-cvut/s-pipes/blob/main/doc/examples/constraint-validation/constraint-validation.md:
execution.exitOnError=true
and show how the JSON-LD output would look like
Resolves #265