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

Prototype gizmos.template #95

Open
jamesaoverton opened this issue Aug 19, 2021 · 0 comments
Open

Prototype gizmos.template #95

jamesaoverton opened this issue Aug 19, 2021 · 0 comments

Comments

@jamesaoverton
Copy link
Member

ROBOT template has served us well, but I would like a more general solution that fits in with VALVE. Key features:

  • be more careful about quoting and escaping
    • we've gotten ourselves all tangled up in OBI lately, because I wasn't careful enough in the beginning
    • Excel is important and it's a big pain
  • get away from the second-row template strings, in favour of a 'field' table with 'table', 'column', and 'template' columns
    • this gives up something people like about ROBOT template, but I think the benefits will great
    • this will allow more information to be associated with a template sheet, such as VALVE validation, documentation, data types, and stuff for generating HTML forms
    • this will allow one 'field' table to specify templates for multiple template sheets, such as all OBI templates
  • multi-column templates
    • ROBOT template is limited to substitutions from the current column
    • DOS-DP allows multiple columns, but all columns are required (I think), and they don't use column names in the template string
    • I would like optional columns and to use column names

Here's an example 'field' table:

table column condition template
assay ID   {ID} rdt:type owl:Class
assay logical type any("subClassOf", "equivalentTo")  
assay output   {ID} {logical type} has_specified_output some {output}
assay target entity   {ID} subClassOf has_specified_output some ('is about' some {target entity})

I think that the template strings should be optional: If there's no value for a row in the 'output' column, don't fill this template for this row.

The next level of complexity is that if both 'output' and 'target entity' are defined, then we actually want a combined axiom: {ID} subClassOf has_specified_output some ({output} and ('is about' some {target entity})).

One solution is a Jinja-style templates with conditionals:

{ID} subClassOf has_specified_output some
{% if output and 'target entity' %}
  ({output} and ('is about' some {target entity}))
{% elif output %}
  {output}
{% elif 'target entity' %}
  ('is about' some {target entity})
{% endif %}

Another option is to provide a list of cases, try them all, and use the first one for which all required variables are defined. Maybe this could be more concise than the Jinja-style, but less familiar and probably less explicit?

{ID} subClassOf has_specified_output some
ANY
- ({output} and ('is about' some {target entity}))
- {output}
- ('is about' some {target entity})
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