Skip to content

MultiClause zero2many support#349

Merged
balhoff merged 6 commits intomasterfrom
clause_zero2many
Nov 3, 2021
Merged

MultiClause zero2many support#349
balhoff merged 6 commits intomasterfrom
clause_zero2many

Conversation

@hkir-dev
Copy link
Copy Markdown
Contributor

@hkir-dev hkir-dev commented Aug 31, 2021

In relation with #334, list (MultiValue) support added to multi_clause construct.

Now list_vars and data_list_vars can be used with clauses. This feature is supported in texts (def, comment, etc.), logical axioms and annotations. GCI (general class inclusion axioms) are not supported yet and not in short term plan.

Axioms supports " and ", " or " as separator and consecutively generates IntersectionOf and UnionOf constructs. When used with annotations, generates a separate axiom per list item.

Limitations (these restrictions are checked by https://github.com/INCATools/dead_simple_owl_design_patterns validator):

  • Only one list variable is supported per multi_clause.
  • Nesting is not supported (and logically incorrect) for logical axioms and annotations.

Example usage

list_vars:
  Expresses: "'thing'"

data_list_vars:
  Expresses_pub: "xsd:string"

logical_axioms:
   - axiom_type: subClassOf
     multi_clause:
      sep: " and "
      clauses:
        - text: "'expresses' some %s"
          vars:
            - Expresses
     annotations:
       - annotationProperty: rdfsComment
         text: "%s"
         vars:
           - Expresses_comment
       - annotationProperty: hasDbXref
         multi_clause:
           sep: " "
           clauses:
             - text: '%s'
               vars:
                 - Expresses_pub

Copy link
Copy Markdown

@dosumis dosumis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have successfully used this so happy to approve. But @balhoff needs to give it the nod.

@cmungall
Copy link
Copy Markdown
Contributor

cmungall commented Nov 3, 2021

Would be great to see documentation on how this works with equiv axioms, and whether lists of length zero are supported. This could come as a later PR but ideally we could see it all working together

@dosumis
Copy link
Copy Markdown

dosumis commented Nov 3, 2021

Zero-length lists are supported in multi-clause statements (but not outside). SubClauses are dependent on a non-zero-length list in their parent clause. There is no special treatment for equivalentTo axioms. I can see that this is potentially dangerous, but in the end, this is just a dumb templating system. The same basic rules apply for multi-clause templating of any text field. I

Copy link
Copy Markdown
Member

@balhoff balhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the long delay @hkir-dev! Just left a minor comment; I will make the change now. Let me know if I misinterpreted the code.

@balhoff balhoff merged commit fe7187b into master Nov 3, 2021
@balhoff balhoff deleted the clause_zero2many branch November 3, 2021 19:24
@dosumis dosumis mentioned this pull request Jul 31, 2024
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

Successfully merging this pull request may close these issues.

4 participants