-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Here in our case, we need to build ontology based on tables in postgresql databse.
-
There are multi table in database, and they have inherit relation(as postgresql support this), i use
sqlalchemyto describe these part of table as follows, here include base table likeSample, and inherited table likeDrySample; and there are futher inherited table likeAntiSampleandProteinSamplewhich inherited fromDrySample. -
In these case, how should i build ontology in palantir? I thought palantir not support object type inherit, am i right ? hoping for your kindly help and reply @jsmith @jameszhang244 @afloren-palantir @invliD @ericanderson @jmcampanini @akerl @tdeitch
class Sample(Base):
__tablename__ ='samples'
id: Mapped[int] = mapped_column(primary_key=True)
source: Mapped[int] = mapped_column(ForeignKey('experiments.id'))
type: Mapped[str] = mapped_column(String(255))
class DrySample(Sample):
__tablename__ = 'dry_samples'
id: Mapped[int] = mapped_column(ForeignKey('samples.id'), primary_key=True)
sample_id: Mapped[str] = mapped_column(String(255))
freeze_count: Mapped[int] = mapped_column(Integer, default=0)
class AntiSample(DrySample):
__tablename__ = 'anti_samples'
id: Mapped[int] = mapped_column(ForeignKey('dry_sample.id'), primary_key=True)
volume: Mapped[str] = mapped_column(Float)
class ProteinSample(DrySample):
__tablename__ = 'anti_samples'
id: Mapped[int] = mapped_column(ForeignKey('dry_sample.id'), primary_key=True)
protein_id: Mapped[int] = mapped_column(ForeignKey('proteins.id'))
description: Mapped[str] = mapped_column(Text)Metadata
Metadata
Assignees
Labels
No labels