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

[Data Model] Relationship between Company and Branch should be OneToMany #86

Open
grichka opened this issue Feb 10, 2021 · 9 comments
Open

Comments

@grichka
Copy link

grichka commented Feb 10, 2021

Hello, I noticed that according to the Ontology and logical data model, a Company can have only one Branch.

Of course, what is needed at the end is a specific Branch of a company that is involved in the freight transportation. However the data model should define that a Company has several Branches. A Company should have a set of Branch.

So I think that anywhere we have Company used in the model, this company should be changed to a companyBranch.
Or if we want to stick with this version of the model, we have to create (and duplicate) one company for each branch.

image

Thanks for your feedback.

@DrPhilippBillion
Copy link
Contributor

Hello Grichka,

your point is correct, there must be an 1:n relationship between company and branch.

From the Excel I use, Cardinality for Branch in company is n, so I´d see it as 1:n. Can you explain why you think it´s currently 1:1?

It´s good to get feedback from you here ;-)

@emtscho
Copy link

emtscho commented Feb 10, 2021

Hello,
we are struggling with the same issue.
I agree that it needs to be changed at least to "CompanyBranch" and should be 1:N.
I even would suggest that carriers are a specific type of company. What do you think about the following approach:
image
Cheers

@grichka
Copy link
Author

grichka commented Feb 10, 2021

Hi @LHDrBillion , thanks for your reply :)

I am referring to the logical datamodel published in the version of November.
And if I refer to the Ontology I use (the latest version), we can see that a Company only has one Branch as it is specified below:

Ontology line 497:

###  https://onerecord.iata.org/Company
:Company rdf:type owl:Class ;
         rdfs:subClassOf [ rdf:type owl:Restriction ;
                           owl:onProperty company:airlineCode ;
                           owl:allValuesFrom xsd:string ;
                           ] ,
                           [ rdf:type owl:Restriction ;
                             owl:onProperty company:airlineCode  ;
                             owl:maxCardinality "1"^^xsd:nonNegativeInteger ;
                           ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:airlinePrefix ;
                           owl:allValuesFrom xsd:integer ;
                         ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:airlinePrefix  ;
                           owl:maxCardinality "1"^^xsd:nonNegativeInteger ;
                         ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:iataCargoAgentCode ;
                           owl:allValuesFrom xsd:integer ;
                         ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:iataCargoAgentCode  ;
                           owl:maxCardinality "1"^^xsd:nonNegativeInteger ;
                         ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:companyName ;
                           owl:allValuesFrom xsd:string ;
                         ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:companyName  ;
                           owl:maxCardinality "1"^^xsd:nonNegativeInteger ;
                         ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:branch ;
                           owl:allValuesFrom <https://onerecord.iata.org/Branch> ;
                         ] ,
                         [ rdf:type owl:Restriction ;
                           owl:onProperty company:branch ;
                           owl:maxCardinality "1"^^xsd:nonNegativeInteger ;
                         ] ;

Max cardinality of Branch is "1"

@lambertciata
Copy link
Collaborator

Hi all,

@grichka
We did not have the time to properly update the ontology but it seems the maxCardinality 1 is a mistake in the ontology, that shall be fixed in the next version (hopefully soon!), thanks for finding this one out :)

Renaming to companyBranch makes sense, will bring the point in the data model taskforce.

@emtscho
I think we could have multiple subtypes of Company if some specific data properties make sense, such as carrier code. This topic can be discussed as well in the data model taskforce.

Cheers
Christophe

@andrablaj andrablaj changed the title Relationship between Company and Branch should be OneToMany [Data Model] Relationship between Company and Branch should be OneToMany Mar 3, 2021
@lambertciata
Copy link
Collaborator

Hi,

Following are the changes that the data model taskforce agreed on:

  • Branch will be renamed to ComanyBranch
  • Relationship between Company and CompanyBranch will be changed to 1-to-many
  • Carrier subtype of Company will be added

@mskopp
Copy link

mskopp commented Mar 24, 2021

Relationship between Company and CompanyBranch will be changed to 1-to-many

Currently, field BookingOption:shipper (and :consignee, :notifyParty and :freightForwarder and possibly some others) refers to a Company.
The address details (street, city etc) are stored on CompanyBranch (formerly called Branch).
With a 1:n relationship of Company:CompanyBranch, it is no longer determined which address is the relevant one.

So all links to Company needs to be checked and probably also changed to CompanyBranch. Others, e.g. maybe bookingOption:carrier, might remain with linking to a Company - but even with Airlines having multiple offices they have this one and only official main address - where to put that?

@lambertciata
Copy link
Collaborator

lambertciata commented Sep 3, 2021

This issue shall be rediscussed with the data model taskforce for next release

@lambertciata lambertciata added help wanted Extra attention is needed Awaiting pilot feedback and removed help wanted Extra attention is needed labels Jan 24, 2022
@DrPhilippBillion
Copy link
Contributor

DrPhilippBillion commented Mar 8, 2022

  • but even with Airlines having multiple offices they have this one and only official main address - where to put that?

Hey Martin, just to keep this discussion up-to-date: We were discussing a "headquater"-flag for one of the branches, which would solve the "bookingOption"-Problem, but still enable a 1:n relation with the company and companyBranch. "This is the way" ;-)

@mskopp
Copy link

mskopp commented Mar 8, 2022

We were discussing a "headquater"-flag for one of the branches
"This is the way"

I am sure there are multiple ways, e.g. one could also add an address in Branch similar and additional to the one on Company in the above diagram - this might solve some of the problems created by a 1:n Company:Branch relationship. A headquarter-flag which then must only be set on one of all the branches of a company produces new problems - e.g. rules about the uniqueness.

This is a non-trivial problem especially with a strong relationship to manage login/credentials/tokens for data access/visibility which from my point of view need to be grantable on Company level for sure and might be additionally grantable on Branch level.

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

No branches or pull requests

5 participants