diff --git a/spec/section/fields.md b/spec/section/fields.md index dddd2dc..18976a1 100644 --- a/spec/section/fields.md +++ b/spec/section/fields.md @@ -246,140 +246,23 @@ If no iterator is declared for a field, a default iterator is implied. If the re For the application of the expression of a [=field=] on the records of the [=field parent=], the parent's reference formulation is used, resulting in [=record sequence=] *R*. Afterwards the field's iterator is applied on this resulting record sequence *R* to obtain the [=field record sequence=] defined by the field. - - - - ### Using field names in triples maps A field reference is a reference expression that references a defined [=field=]. A [=field reference=] MUST be a defined [=field name=]. A [=field reference=] is a special type of reference expression for which no reference formulation need be defined. diff --git a/test-cases/RMLLVTC0006/mapping.ttl b/test-cases/RMLLVTC0006/mapping.ttl index 6d2fe20..f36f971 100644 --- a/test-cases/RMLLVTC0006/mapping.ttl +++ b/test-cases/RMLLVTC0006/mapping.ttl @@ -26,23 +26,26 @@ rml:reference "$.type" ; ] ; rml:field [ rml:fieldName "weight" ; - rml:reference "$.weight" ; ] ; ] . + rml:reference "$.weight" ; + ] ; + ] . :triplesMapItem a rml:TriplesMap ; rml:logicalSource :mixedCSVView ; rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.#}/{item_type}" ; + rml:template "item_{#}_{item.#}" ; + rml:termType rml:BlankNode ; ] ; rml:predicateObjectMap [ rml:predicate :hasType ; rml:objectMap [ - rml:reference "item_type" ; + rml:reference "item.type" ; ] ; ] ; rml:predicateObjectMap [ rml:predicate :hasWeight ; rml:objectMap [ - rml:reference "item_weight" ; + rml:reference "item.weight" ; rml:datatype xsd:integer ; ] ; ] . diff --git a/test-cases/RMLLVTC0006/output.nq b/test-cases/RMLLVTC0006/output.nq index e4bcc39..850a630 100644 --- a/test-cases/RMLLVTC0006/output.nq +++ b/test-cases/RMLLVTC0006/output.nq @@ -1,6 +1,6 @@ - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . +_:item_0_0 "sword" . +_:item_0_0 "1500"^^ . +_:item_0_1 "shield" . +_:item_0_1 "2500"^^ . +_:item_1_0 "flower" . +_:item_1_0 "15"^^ . diff --git a/test-cases/RMLLVTC0007/mapping.ttl b/test-cases/RMLLVTC0007/mapping.ttl index f74dbf0..cedb9dc 100644 --- a/test-cases/RMLLVTC0007/mapping.ttl +++ b/test-cases/RMLLVTC0007/mapping.ttl @@ -25,23 +25,26 @@ rml:reference "$.type" ; ] ; rml:field [ rml:fieldName "weight" ; - rml:reference "$.weight" ; ] ; ] . + rml:reference "$.weight" ; + ] ; + ] . :triplesMapItem a rml:TriplesMap ; rml:logicalSource :mixedCSVView ; rml:subjectMap [ - rml:template "http://example.org/person/{name}/item/{item.#}/{item_type}" ; + rml:template "item_{#}_{item.#}" ; + rml:termType rml:BlankNode ; ] ; rml:predicateObjectMap [ rml:predicate :hasType ; rml:objectMap [ - rml:reference "item_type" ; + rml:reference "item.type" ; ] ; ] ; rml:predicateObjectMap [ rml:predicate :hasWeight ; rml:objectMap [ - rml:reference "item_weight" ; + rml:reference "item.weight" ; rml:datatype xsd:integer ; ] ; ] . diff --git a/test-cases/RMLLVTC0007/output.nq b/test-cases/RMLLVTC0007/output.nq index c2113db..4b359fd 100644 --- a/test-cases/RMLLVTC0007/output.nq +++ b/test-cases/RMLLVTC0007/output.nq @@ -1,6 +1,6 @@ - "sword" . - "1500"^^ . - "shield" . - "2500"^^ . - "flower" . - "15"^^ . +_:item_0_0 "sword" . +_:item_0_0 "1500"^^ . +_:item_1_0 "shield" . +_:item_1_0 "2500"^^ . +_:item_2_0 "flower" . +_:item_2_0 "15"^^ . diff --git a/test-cases/RMLLVTC0008/mapping.ttl b/test-cases/RMLLVTC0008/mapping.ttl index 8af65a1..f8818c5 100644 --- a/test-cases/RMLLVTC0008/mapping.ttl +++ b/test-cases/RMLLVTC0008/mapping.ttl @@ -14,27 +14,39 @@ :mixedJSONView a rml:LogicalView ; rml:viewOn :mixedJSONSource ; rml:field [ - rml:fieldName "hobby" ; - rml:reference "$.hobbies" ; - rml:referenceFormulation rml:CSV; - rml:field [ - rml:fieldName "id" ; - rml:reference "id" ; + rml:fieldName "name" ; + rml:reference "$.name" ; ] ; + rml:field [ + rml:fieldName "item" ; + rml:reference "$.items" ; + rml:referenceFormulation rml:CSV; rml:field [ rml:fieldName "type" ; rml:reference "type" ; ] ; + rml:field [ + rml:fieldName "weight" ; + rml:reference "weight" ; + ] ; ] . :triplesMapItem a rml:TriplesMap ; rml:logicalSource :mixedJSONView ; rml:subjectMap [ - rml:template "http://example.org/person/{name}/hobby/{hobby.#}/{hobby_id}" ; + rml:template "item_{#}_{item.#}" ; + rml:termType rml:BlankNode ; ] ; rml:predicateObjectMap [ rml:predicate :hasType ; rml:objectMap [ - rml:reference "hobby_type" ; + rml:reference "item.type" ; + ] ; + ] ; + rml:predicateObjectMap [ + rml:predicate :hasWeight ; + rml:objectMap [ + rml:reference "item.weight" ; + rml:datatype xsd:integer ; ] ; ] . diff --git a/test-cases/RMLLVTC0008/output.nq b/test-cases/RMLLVTC0008/output.nq index 31cbaa6..850a630 100644 --- a/test-cases/RMLLVTC0008/output.nq +++ b/test-cases/RMLLVTC0008/output.nq @@ -1,4 +1,6 @@ - "volleyball" . - "basketball" . - "horses" . - "football" . +_:item_0_0 "sword" . +_:item_0_0 "1500"^^ . +_:item_0_1 "shield" . +_:item_0_1 "2500"^^ . +_:item_1_0 "flower" . +_:item_1_0 "15"^^ . diff --git a/test-cases/RMLLVTC0008/people.json b/test-cases/RMLLVTC0008/people.json index e810f14..af0dd76 100644 --- a/test-cases/RMLLVTC0008/people.json +++ b/test-cases/RMLLVTC0008/people.json @@ -2,11 +2,11 @@ "people": [ { "name": "alice", - "hobbies": "id;type\n1;volleyball\n2;basketball\n3;horses" + "items": "type,weight\nsword,1500\nshield,2500" }, { "name": "bob", - "hobbies": "id;type\n1;football" + "items": "type,weight\nflower,15" } ] }