Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Entity vs. ClassInstance #56

Open
selewis opened this issue May 10, 2016 · 1 comment
Open

Entity vs. ClassInstance #56

selewis opened this issue May 10, 2016 · 1 comment
Assignees
Labels

Comments

@selewis
Copy link
Contributor

selewis commented May 10, 2016

To educate myself (and others, because I'm trying to sell our approach) about phenopackets I went through the Java code and drew up a little diagram (see #10)

The question is this:
Associations are between 2 Entities
Both EnvironmentAssociation and PhenotypeAssociation isa Association with one Entity being an Environment class (or Phenotype class respectively)
But an neither Environment class nor Phenotype class are Entities. Both are ClassInstance

Shouldn't Entity be a subclass (isa) of ClassInstance?

@julesjacobsen
Copy link
Contributor

This is a good question!

Shouldn't Entity be a subclass (isa) of ClassInstance?

It is, sort of. Entity is an interface and all implementations of Entity extend ClassInstance (apart from GenomicEntity) such that it is a ClassInstance with an id and label. This should probably be better typed and have an AbstractEntity which all Entities extend. I have a deep, amost irrational mistrust of multiple levels of inheritance and I wanted to avoid this which is why I made Entity an interface, this was probably a mistake - I've opened a ticket for this #58.

Originally I tried to define an Association as an association between a typed Condition and an arbitrary Entity i.e. the state of a thing, possibly at defined point(s) in time with a source of evidence(s), but this is probably too strict as we already have a VariantAssociation which can associate a Variant Entity with any other Entity.

Part of the reason for doing this was that the yaml has the entities declared first, then the associations of the entities with their observed states are listed afterwards. Entities are listed in full in the entities section, but are referred to by id in the association section in order to avoid duplication of the entities in the output. Maybe there's a better way to do this.

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

No branches or pull requests

2 participants