Closed mchlrch closed 4 years ago
OUTDATED
I think this could be implemented by decorating the source-type (extension carml
) and referenceables (multiReference
).
DSL:
source-types {
xml referenceFormulation "ql:XPath" extension carml;
}
logical-source mySource {
type xml
source "stream-A"
referenceables {
Id "@Id"
SynonymDefinitions multiReference "tokenize(Sprachzonen/Sprachzone[attribute::Sprache='DE']/Synonym[attribute::Nr='1']/Definition[./Typ='ab']/Text, '\s*;\s*')"
}
}
RML output :
rml:source [
a carml:Stream ;
carml:streamName "stream-A" ;
]
...
rr:predicateObjectMap [
rr:predicate schema:alternateName;
rr:objectMap [
carml:multiReference "tokenize(Sprachzonen/Sprachzone[attribute::Sprache='DE']/Synonym[attribute::Nr='1']/Definition[./Typ='ab']/Text, '\s*;\s*')";
rr:language "de" ;
]
] ;
Covering the input stream extension as well as the MultiTermMap extensions.
For using carml:Stream
, the RML output becomes:
<#EmployeeMapping>
rml:logicalSource [
rml:source [
a carml:Stream ;
carml:streamName "stream-A" ;
]
...
The switch for this could be declaringoutput carml
, after implementing #48
For using carml:multiReference
, the RML has to be for example:
<#EmployeeMapping>
...
rr:predicateObjectMap [
rr:predicate employee:team ;
rr:objectMap [
carml:multiReference "teams" ;
];
]
.
The switch for this could be either a flag on the Referenceable
or on the ReferenceValuedTerm
.
I thought initially about flaging the Referenceable
(see older comment above), but now I think that having this on the ReferenceValuedTerm
is A) more descriptive because visible in the mapping and B) easier to implement because availability/validity is dependent on choosing output carml
#48.
map EmployeeMapping from EMPLOYEE {
subject template "http://airport.example.com/{0}" with id;
properties
employee:team multi-reference from teams;
}
Support for carml:Stream
and carml:multiReference
LGTM
Sample DSL:
output carml
map EmployeeMapping from EMPLOYEE {
subject template "http://foo.example.com/{0}" with id;
types
employee:Employee
properties
employee:team multi-reference from teams;
}
results in generated CARML flavored RML:
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX rml: <http://semweb.mmlab.be/ns/rml#>
PREFIX ql: <http://semweb.mmlab.be/ns/ql#>
PREFIX carml: <http://carml.taxonic.com/carml/>
PREFIX employee: <http://example.com/employee>
<#EmployeeMapping>
rml:logicalSource [
rml:source [
a carml:Stream ;
carml:streamName "employee-stream" ;
] ;
rml:referenceFormulation ql:XPath
];
rr:subjectMap [
rr:template "http://foo.example.com/{id}" ;
rr:class employee:Employee ;
];
rr:predicateObjectMap [
rr:predicate employee:team ;
rr:objectMap [
carml:multiReference "teams" ;
];
]
.
carml has some useful proprietary features that we would like to expose in the DSL:
carml:Stream
carml:multiReference
Additionally to the existing standard RML output, this adds another RML output flavor.