Skip to content

Update flights.yaml example following Summit presentation and fixed small omission in ontology spec#149

Open
kurtStirewalt wants to merge 29 commits into
open-semantic-interchange:mainfrom
kurtStirewalt:main
Open

Update flights.yaml example following Summit presentation and fixed small omission in ontology spec#149
kurtStirewalt wants to merge 29 commits into
open-semantic-interchange:mainfrom
kurtStirewalt:main

Conversation

@kurtStirewalt

Copy link
Copy Markdown
Contributor

Updating examples/flights.yaml to reflect the full example we presented at Summit. Fixed 2 omissions in the ontology spec:

  • requires constraints can be defined on relationships
  • global requires constraints can be defined at the top level (to say things like the population a concept must be non-empty)

… ontology spec that refs the core spec so that both may evolve independently.
…rror changes to the core semantic model spec.
…fixed omissions in the spec regarding where requires fields can appear.
@khush-bhatia khush-bhatia self-requested a review June 9, 2026 20:20
Comment thread examples/flights.yaml Outdated
roles:
- concept: RunwayLength
verbalizes:
- '{Runway} hase {RunwayLength}'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be "has" and not "hase" ?

How are you thinking about validation for these so that we could catch these typos ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a typo. Unfortunately, with verbalization strings there is not a good automated way to catch these kinds of things.

Comment thread examples/flights.yaml Outdated
roles:
- concept: String
verbalizes:
- '{Route} has name- {String}'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to the comment above, the hyphen after name looks like a typo ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is actually not a typo, but I can see why it looks like one. Languages (like object role modeling) that support verbalization use these hyphens to group text around the roles of the relationships when verbalizing constraints. So, for instance, the verbalization of the many to one multiplicity constraint would read:

"Each Route has at most one name String"

rather than:

"Each Route has name at most one String"

Notice how by adding the hyphen after "name" that text floats with the second role (played by String) so that the verbalization of the constraint is more readable.

That said, I can see why folks who aren't familiar with this convention (which admittedly is only supported in a small number of modeling languages) might find it confusing.

What do you think we should do in this case? I will add a comment at the end of the line in the spec to clarify that it is not a typo. Please let me know if you think this suffices.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes a comment would be useful to indicate the difference. Thanks.

Comment thread examples/flights.yaml Outdated
Comment on lines +193 to +194
identify_by: [ tailnum ]
requires: [ tailnum ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are both identify_by and requires needed ? How does one reason about the need for both ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. The requirement on tailnum is implied by its use as an identifier. I'll remove it. Thanks

Comment thread examples/flights.yaml Outdated
verbalizes:
- '{Airport} has average arrival {Delay}'
multiplicity: ManyToOne
derived_by: [ 'Decimal == AVG[Flight.arrival_delay WHERE Airport == Flight.route.destination GROUP BY Airport]' ]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The expression above for average_departure_delay says Delay= .. but here it says Decimal = ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. This is one that we should have caught in CI/CD on the RAI side. I'lll look into what failed there. But it's fixed now. Thanks

@jbonofre jbonofre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. I left some suggestions.

Comment thread examples/flights.yaml
@@ -1,1092 +1,1108 @@
version: 0.2.0.dev0
name: flights
description: Ontology for flight-related concepts and relationships

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe we can keep the description here?

Comment thread examples/flights.yaml
roles:
- concept: String
verbalizes:
- '{Route} has name- {String}' # The hyphen after "name" has significance when verbalizing constraints

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see the comment about hyphen after name. Thanks for that. I just wonder if we should not have details in the spec that we reference here (not necessarily in this PR, but a follow up).

Comment thread examples/flights.yaml
version: 0.2.0.dev0
name: flights
description: Ontology for flight-related concepts and relationships
name: Flights

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ontology.json added requires at top level. Maybe we should use it in this example.

Something like:

  version: 0.2.0.dev0
  name: Flights
  requires:
    - "COUNT[Airport] > 0"         # there must be at least one Airport
    - "COUNT[Carrier] > 0"         # there must be at least one Carrier
  ontology:
    - concept:

Comment thread examples/flights.yaml
roles:
- concept: Carrier
verbalizes:
- '{Aircraft} carrier {Carrier}'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In OSI, verbalizes is a natural-language template that reads the relationship out loud, with {ConceptName} placeholders for each role.
The "convention" is subject + verb + object.

I would suggest to use:

- '{Aircraft} belongs to {Carrier}'

Comment thread examples/flights.yaml
verbalizes:
- '{Flight} cancelled {Boolean}'
multiplicity: ManyToOne
- name: cancellationcode

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- name: cancellationcode
- name: cancellation_code

Comment thread examples/flights.yaml
roles:
- concept: String
verbalizes:
- '{Flight} cancellationCode {String}'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- '{Flight} cancellationCode {String}'
- '{Flight} has cancellation code {String}'

Comment thread examples/flights.yaml
- object_mapping:
concept: String
expression: FLIGHT.cancel_code
relationship: cancellationcode

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
relationship: cancellationcode
relationship: cancellation_code

Comment thread examples/flights.yaml
- object_mapping:
concept: Integer
expression: ROUTE.dist_grp
relationship: distancegroup

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
relationship: distancegroup
relationship: distance_group

Comment thread examples/flights.yaml
verbalizes:
- '{Route} spans {Distance}'
multiplicity: ManyToOne
- name: distancegroup

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- name: distancegroup
- name: distance_group

Comment thread examples/flights.yaml
roles:
- concept: Integer
verbalizes:
- '{Route} distanceGroup {Integer}'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- '{Route} distanceGroup {Integer}'
- '{Route} has distance group {Integer}'

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.

3 participants