Open matyaskopp opened 1 year ago
The relations order-follows
and order-precedes
always puzzled me. I never know what is supposed to follow what.
The consistent behaviour is the one implemented in btred evaluator, i.e. the relation defines the property of the subsequently mentioned/defined node (similarly to other relations, such as child, parent etc.), i.e. order-follows $b should mean that node $b is the following one.
The consistent behaviour is the one implemented in btred evaluator, i.e. the relation defines the property of the subsequently mentioned/defined node (similarly to other relations, such as child, parent etc.), i.e. order-follows $b should mean that node $b is the following one.
I am not sure if I agree, If I correctly understand this note inside implementation: https://github.com/ufal/perl-pmltq/blob/03718a4b0af59ab906f14154c5153ce3d6d7db5b/lib/PMLTQ/BtredEvaluator.pm#L182-L199 it is the BtredEvaluation which is wrong.
But the implementation says different things: https://github.com/ufal/perl-pmltq/blob/03718a4b0af59ab906f14154c5153ce3d6d7db5b/lib/PMLTQ/BtredEvaluator.pm#L756-L760
In SQLEvaluator, notes are missing, and the implementation is just reversion: https://github.com/ufal/perl-pmltq/blob/03718a4b0af59ab906f14154c5153ce3d6d7db5b/lib/PMLTQ/SQLEvaluator.pm#L858-L860
in SQLEvaluator, depth-first-follows
behaves consistently with order-follows
: http://hdl.handle.net/11346/PMLTQ-ATS3
a-node $A:=[ depth-first-follows a-node $B :=[ ] ];
The consistent behaviour is the one implemented in btred evaluator, i.e. the relation defines the property of the subsequently mentioned/defined node (similarly to other relations, such as child, parent etc.), i.e. order-follows $b should mean that node $b is the following one.
Regardless whether the comments in the source code support it or not, this behavior would be consistent (between parent/child on one side and order-precedes/follows on the other) and thus would make sense.
But even then the name of the relation is unfortunate and confusing. Since it sounds like the English language, the most natural interpretation of "order follows node B" is that something follows B, not that B follows something. So we have a conflict between consistency with parent/child and natural interpretation of the name. Ideally, I would maintain consistency with parent/child relations, but rename the order relations to avoid third-person finite verbs. Maybe something like order-following
and order-preceding
would be better. It would still not be self-explanatory w.r.t. the relation direction, but at least it would not hint at the wrong direction. And the full string with "node" would actually read naturally to me:
a-node $a := [order-following a-node $b := [...]]
The consistent behaviour is the one implemented in btred evaluator, i.e. the relation defines the property of the subsequently mentioned/defined node (similarly to other relations, such as child, parent etc.), i.e. order-follows $b should mean that node $b is the following one.
Regardless whether the comments in the source code support it or not, this behavior would be consistent (between parent/child on one side and order-precedes/follows on the other) and thus would make sense.
But even then the name of the relation is unfortunate and confusing. Since it sounds like the English language, the most natural interpretation of "order follows node B" is that something follows B, not that B follows something. So we have a conflict between consistency with parent/child and natural interpretation of the name. Ideally, I would maintain consistency with parent/child relations, but rename the order relations to avoid third-person finite verbs. Maybe something like
order-following
andorder-preceding
would be better. It would still not be self-explanatory w.r.t. the relation direction, but at least it would not hint at the wrong direction. And the full string with "node" would actually read naturally to me:a-node $a := [order-following a-node $b := [...]]
Agree, and this naming is also consistent with the XPath query language.
Safer is probably adding new relations and not removing the old ones:
Email report (@lauma, subj:Possible bug in LINDAT's PMLTQ instance?, 20230524) :