Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:mod + constant in figure/table references: trouble with inverses #235

Open
nschneid opened this issue Aug 13, 2018 · 1 comment
Open

:mod + constant in figure/table references: trouble with inverses #235

nschneid opened this issue Aug 13, 2018 · 1 comment

Comments

@nschneid
Copy link
Collaborator

The rule for figure references involves putting a string under :mod:

Example: Figure 6a [isi_0002.564]

(f / figure
    :mod "6a")

Similarly, a number for table references:

Example: Table 5 [isi_0002.563]

(t / table
    :mod 5)

As raised by goodmami/penman#19 (comment), this breaks code which assumes that all :mod relations are the inverse of :domain, which suggests that they will only link variables, not a variable and a constant (string or number).

So: Should VARIABLE :mod CONSTANT not be considered equivalent to VARIABLE :domain-of CONSTANT? I.e. is this an exception where :mod has no inverse? Or should we assume that a :domain relation can be headed by a constant?

Or, should we change the guideline for references to treat the figure/table as a named entity, thus putting the constant under name :op1 rather than :mod?

Related: #194, snowblink14/smatch#10

@goodmami
Copy link
Contributor

FWIW in Penman I decided to treat both :domain and :mod as primary (non-inverse) roles. This is following @ULFULF's advice in #194

All roles listed at http://www.isi.edu/~ulf/amr/lib/roles.html are primary (i.e. non-inverse) roles [...]

Thus, :domain-of is the inverse of :domain and :mod-of is the inverse of :mod. In order to resolve the idea described in the Guidelines that the inverse of :domain is :mod and vice-versa, I now have a penman.transform.canonicalize_roles() function that normalizes :domain-of to :mod and :mod-of to :domain, but this step is optional.

This method allows both :domain and :mod to links variables with constants, however such edges cannot be inverted as the source of a relation must always be a variable.

From my point of view this issue can be closed. If anything, the Guidelines can be updated to more carefully describe how :domain and :mod can be inverses of the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants