WorldModelers / Ontologies

Ontologies for the World Modelers system
Creative Commons Attribution 4.0 International
6 stars 11 forks source link

Root element in new ontology metadata format not a list #151

Closed bgyori closed 2 years ago

bgyori commented 3 years ago

I realized something I want to clarify with respect to the new format. In https://raw.githubusercontent.com/WorldModelers/Ontologies/master/CompositionalOntology.yml, the root element is a list signified by the - before wm:

- wm:
  - concept:
    - agriculture:
...

However, in https://raw.githubusercontent.com/WorldModelers/Ontologies/master/CompositionalOntology_metadata.yml, the root element is not a list:

node:
    name: wm
    children:
        - node:
            name: concept

This causes complications with a corner case on our end where we have to support ontology extensions that can in principle fall outside the wm subtree of the ontology. Should we consider making it the following?

- node:
      name: wm
      children:
          - node:
              name: concept
MihaiSurdeanu commented 3 years ago

Good point. But don't we need just the children to be a list? That is, the root is a single node, which may have a list of children. Just like in any tree data structure. @kwalcock ?

kwalcock commented 3 years ago

It sounds like Ben wants to do

- node:
    name: wm
    children:
    ....
- node: # Special things for INDRA
    name: non-wm
    children:

I have been wondering who is using the versions without the metadata, the ones with a - still in the top level. @bgyori, do you need just that metadataless one (that you linked to as an example) to stay a list or do you need both that and the metadata file to have a list, or do they just need to be consistent, etc.? Having the top level list will probably make a slight exception in other code, and I will double check that it isn't too onerous. I also haven't checked the program that strips the metadata.

bgyori commented 3 years ago

Yes, I was thinking of what @kwalcock wrote here, namely that ontology extensions are (or at least have been before) allowed outside the wm subtree and that requires the root to be a list. Here is what the root type of different versions looked like:

so the new metadata ontology is the odd one out where the root isn't a list. In this sense I think things would be more consistent if we made that a list too. I realize it might require another round of minor adaptation from teams...

kwalcock commented 3 years ago

The metadataless and metadata versions are significantly different in other ways as well. I hadn't planned to change the metadateless representation. Right now there are two separate parsers for these (in this repo). It would be easy to make two "not lists" out of the four, if that consistency is important. Probably more important is getting the list or not list that you need, though.

bgyori commented 3 years ago

I hadn't planned to change the metadateless representation.

I didn't suggest doing that, rather I am suggesting changing the ontology with metadata to make the root a list.

It would be easy to make two "not lists" out of the four, if that consistency is important.

No, I was suggesting the opposite, that is, to make everything consistent by changing the ontology with metadata to be a list as well.

kwalcock commented 3 years ago

Sounds good. They should be consistent and both/all be lists at the top then. It's handy there is a meeting scheduled for tomorrow. Hopefully it's OK with everyone.

kwalcock commented 3 years ago

The PR is #154.