Open DylanVanAssche opened 11 months ago
For which specific case? Are you talking about, e.g. XPath? bc I would be hesitant to change the XPath syntax and just add a claim in the spec that, it the reference contains special characters such as [
and ]
, you should put the template in quotes
Everything actually, not a specify reference formulation or something, it is about the syntax for a POM for example:
po:
- [ foaf:name, $(name), en~lang ]
The array is not 'equal' regarding the types, it is actually an object put into an array where [0]
matches the predicates
, [1]
matches the objects
and en~lang
the language tag as Literal.
Their comment was mostly about that the brackets suggest an array with [
and ]
as in YAML but that it is not an 'array' in practice, but more like an object. Therefore, the shortcut felt a bit non-intuitive when you are used to YAML. I kinda see where this is coming from though. Not sure how to solve it though, just putting it here so we can think about it when standardizing YARRRML.
This issue is open for quite some time, and I agree with @DylanVanAssche's observations. Some thoughts on this were shared already with Dylan and Ben via email some months ago, which led to my proposal using a functional notation pom()
for a future standard.
Proposal
Use pom(<predicate>, <object> [, <object type>])
as a template for a predicate-object mapping (POM) to avoid the current YAML list notation.
Lists of predicates and lists of objects are allowed, as defined in the current YARRRML specification.
The third parameter, which can be used to define the object's type, is optional (default: xsd:string
).
Example with current syntax:
...
po: [[foaf:name, $(name), en~lang]]
Example with proposed syntax:
...
po: [pom(foaf:name, $(name), en~lang)]
Some further points for a discussion:
Shall we allow a single POM as value for the field predicateobjects
, or is always a list of POMs required (as it is defined now)? The example above would then look like
...
po: pom(foaf:name, $(name), en~lang)
The tilde can be used as operator in different parts of a mapping definition with different meanings (in the example: identification of a language tag). In POMs, an IRI object must also be defined using the tilde (e.g. in pom(:id, my:$(ID)~iri)
).
Shall we avoid this type of overloading, e.g. by writing pom(:id, my:$(ID), iri)
?
Shall we add a parameter for conditions?
Note: A shortcut notation for join conditions was proposed already in (Iglesias-Molina et al. 2023), also using functional notation.
During the VAIA course we received the following feedback:
Array brackets conflict with standard YAML as it is a shorthand for arrays. Just putting it here so we can incorporate this later.