You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add example mixing use of rml-views and gather maps #30
This example should be added only when the fields specification is released.
Anyway, the issue does not prevent from releasing a first version of the specification.
@dachafra@chrdebru@andimou : To finalize this example I need the spec of the Fields (rml:field... ) but I fail to find it... Shouldn't it be in rml-io? Did i miss something?
Fields is still in discussion. Indeed, in the joins task force, we are going to present the solution again and see if it covers all the requirements that we need. In any case, the issues that are labeled with pending do not need to be fixed now, as others need to be resolved before (as in this one)!
This question was discussed during the meeting in Santiago de Compostela. Here is the solution that was agreed: @dachafra@chrdebru@andimou@bjdmeest@pmaria: could you please confirm that we understood the same thing?
Input document "source.json":
{
"id": 1,
"a" : [ [1,2,3], [4,5,6] ]
}
The expected output is to generate a list of lists, where the head node of the outer list has a URI:
This reshapes the input document into a table with 2 lines:
id
a_string
a_list
1
[1,2,3]
1,2,3
1
[4,5,6]
4,5,6
Here, a_string is a string representation of the json array: "[1,2,3]", "[4,5,6]", so not really usable unless it would be parsed by a function for instance.
Conversely, a_list is built by parsing the json arrays returned by "$.a.*", so it is an enumeration of the terms 1, 2, 3, and 4, 5, 6. The datatype of that list field has not been specified yet and requires further discussions.
Now applying the following term map should generate the expected result:
rr:subjectMap [
rr:template "http://my.list/{id}";
rml:gather ( [
rml:gather ( [
# "a_list" is multi-valued, it evaluates to the 3 terms in each arrays: first iteration: 1, 2, 3, then 4, 5, 6.
rml:reference "a_list" ;
rml:gatherAs rdf:List;
] )
] );
rml:gatherAs rdf:List;
] ;
Activity
frmichel commentedon Sep 11, 2023
@dachafra @chrdebru @andimou : To finalize this example I need the spec of the Fields (rml:field... ) but I fail to find it... Shouldn't it be in rml-io? Did i miss something?
dachafra commentedon Sep 11, 2023
Fields is still in discussion. Indeed, in the joins task force, we are going to present the solution again and see if it covers all the requirements that we need. In any case, the issues that are labeled with
pendingdo not need to be fixed now, as others need to be resolved before (as in this one)!frmichel commentedon Dec 15, 2023
This question was discussed during the meeting in Santiago de Compostela. Here is the solution that was agreed:
@dachafra @chrdebru @andimou @bjdmeest @pmaria: could you please confirm that we understood the same thing?
Input document "source.json":
{ "id": 1, "a" : [ [1,2,3], [4,5,6] ] }The expected output is to generate a list of lists, where the head node of the outer list has a URI:
The solution involves a logical source for the json file, and a logical view that declares fields:
This reshapes the input document into a table with 2 lines:
Here,
a_stringis a string representation of the json array: "[1,2,3]", "[4,5,6]", so not really usable unless it would be parsed by a function for instance.Conversely,
a_listis built by parsing the json arrays returned by "$.a.*", so it is an enumeration of the terms 1, 2, 3, and 4, 5, 6.The datatype of that list field has not been specified yet and requires further discussions.
Now applying the following term map should generate the expected result:
pmaria commentedon Dec 17, 2023
Hi @frmichel,
Indeed! Only the object of the
rml:groupBystatement would bea_string, but I think that was your intention.So the logical view would be defined as such:
frmichel commentedon Dec 17, 2023
Yes you're right, sorry for the typo. I renamed a and a2 into a_string and a_list for clarification, but I forgot to change a in groupBy ;).
dachafra commentedon Dec 20, 2023
Ok for me, I've also changed the label from pending to proposal
[-]Add example mixing use of fields and gather maps[/-][+]Add example mixing use of rml-views and gather maps[/+]