Skip to content

Commit

Permalink
chore: add schema diagram for apiv2 (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadling authored Aug 30, 2024
1 parent 4f5fcee commit 2a9e248
Show file tree
Hide file tree
Showing 5 changed files with 642 additions and 334 deletions.
1 change: 1 addition & 0 deletions apiv2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ build: ## Build docker containers
update-schema: codegen alembic-autogenerate alembic-upgrade-head
# $(docker_compose_run) $(CONTAINER) ruff check --fix .
$(docker_compose_run) $(APP_CONTAINER) sh -c 'strawberry export-schema main:schema > /app/graphql_api/schema.graphql'
linkml generate erdiagram --structural --classes Alignment --classes AnnotationAuthor --classes AnnotationFile --classes AnnotationShape --classes Annotation --classes DatasetAuthor --classes DatasetFunding --classes Dataset --classes DepositionAuthor --classes Deposition --classes Frame --classes PerSectionAlignmentParameters --classes PerSectionParameters --classes Run --classes Tiltseries --classes TomogramAuthor --classes TomogramVoxelSpacing --classes Tomogram schema/schema.yaml> schema/README.md
docker compose up -d
sleep 5 # wait for the app to reload after having files updated.
docker compose exec $(APP_CONTAINER) python3 -m sgqlc.introspection --exclude-deprecated --exclude-description http://localhost:9009/graphql graphql_api/schema.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""autogenerated
Create Date: 2024-08-30 19:40:30.881995
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = '20240830_154027'
down_revision = '20240828_194323'
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
29 changes: 29 additions & 0 deletions apiv2/graphql_api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ type Alignment implements EntityInterface & Node {
): PerSectionAlignmentParametersConnection!
perSectionAlignmentsAggregate(where: PerSectionAlignmentParametersWhereClause = null): PerSectionAlignmentParametersAggregate
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int
tiltseries(where: TiltseriesWhereClause = null, orderBy: [TiltseriesOrderByClause!] = []): Tiltseries
tiltseriesId: Int
tomograms(
where: TomogramWhereClause = null
orderBy: [TomogramOrderByClause!] = []
Expand All @@ -59,6 +61,7 @@ type Alignment implements EntityInterface & Node {
): TomogramConnection!
tomogramsAggregate(where: TomogramWhereClause = null): TomogramAggregate
run(where: RunWhereClause = null, orderBy: [RunOrderByClause!] = []): Run
runId: Int

"""Type of alignment included, i.e. is a non-rigid alignment included?"""
alignmentType: alignment_type_enum
Expand Down Expand Up @@ -339,6 +342,7 @@ type Annotation implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
run(where: RunWhereClause = null, orderBy: [RunOrderByClause!] = []): Run
runId: Int
annotationShapes(
where: AnnotationShapeWhereClause = null
orderBy: [AnnotationShapeOrderByClause!] = []
Expand Down Expand Up @@ -374,6 +378,7 @@ type Annotation implements EntityInterface & Node {
): AnnotationAuthorConnection!
authorsAggregate(where: AnnotationAuthorWhereClause = null): AnnotationAuthorAggregate
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int

"""Path to the file in s3"""
s3MetadataPath: String!
Expand Down Expand Up @@ -472,6 +477,7 @@ type AnnotationAuthor implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
annotation(where: AnnotationWhereClause = null, orderBy: [AnnotationOrderByClause!] = []): Annotation
annotationId: Int

"""The order that the author is listed as in the associated publication"""
authorListOrder: Int!
Expand Down Expand Up @@ -814,8 +820,11 @@ type AnnotationFile implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
alignment(where: AlignmentWhereClause = null, orderBy: [AlignmentOrderByClause!] = []): Alignment
alignmentId: Int
annotationShape(where: AnnotationShapeWhereClause = null, orderBy: [AnnotationShapeOrderByClause!] = []): AnnotationShape
annotationShapeId: Int
tomogramVoxelSpacing(where: TomogramVoxelSpacingWhereClause = null, orderBy: [TomogramVoxelSpacingOrderByClause!] = []): TomogramVoxelSpacing
tomogramVoxelSpacingId: Int

"""File format label"""
format: String!
Expand Down Expand Up @@ -1072,6 +1081,7 @@ type AnnotationShape implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
annotation(where: AnnotationWhereClause = null, orderBy: [AnnotationOrderByClause!] = []): Annotation
annotationId: Int
annotationFiles(
where: AnnotationFileWhereClause = null
orderBy: [AnnotationFileOrderByClause!] = []
Expand Down Expand Up @@ -1349,6 +1359,7 @@ type Dataset implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int
fundingSources(
where: DatasetFundingWhereClause = null
orderBy: [DatasetFundingOrderByClause!] = []
Expand Down Expand Up @@ -1512,6 +1523,7 @@ type DatasetAuthor implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
dataset(where: DatasetWhereClause = null, orderBy: [DatasetOrderByClause!] = []): Dataset
datasetId: Int

"""The order that the author is listed as in the associated publication"""
authorListOrder: Int!
Expand Down Expand Up @@ -1873,6 +1885,7 @@ type DatasetFunding implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
dataset(where: DatasetWhereClause = null, orderBy: [DatasetOrderByClause!] = []): Dataset
datasetId: Int

"""The name of the funding source."""
fundingAgencyName: String
Expand Down Expand Up @@ -2415,6 +2428,7 @@ type DepositionAuthor implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int

"""The order that the author is listed as in the associated publication"""
authorListOrder: Int!
Expand Down Expand Up @@ -2714,6 +2728,7 @@ type DepositionType implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int
type: deposition_types_enum
}

Expand Down Expand Up @@ -2903,6 +2918,7 @@ type Frame implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int
perSectionParameters(
where: PerSectionParametersWhereClause = null
orderBy: [PerSectionParametersOrderByClause!] = []
Expand All @@ -2921,6 +2937,7 @@ type Frame implements EntityInterface & Node {
): PerSectionParametersConnection!
perSectionParametersAggregate(where: PerSectionParametersWhereClause = null): PerSectionParametersAggregate
run(where: RunWhereClause = null, orderBy: [RunOrderByClause!] = []): Run
runId: Int

"""Camera angle for a frame"""
rawAngle: Float!
Expand Down Expand Up @@ -3235,6 +3252,7 @@ type PerSectionAlignmentParameters implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
alignment(where: AlignmentWhereClause = null, orderBy: [AlignmentOrderByClause!] = []): Alignment
alignmentId: Int!

"""z-index of the frame in the tiltseries"""
zIndex: Int!
Expand Down Expand Up @@ -3416,7 +3434,9 @@ type PerSectionParameters implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
frame(where: FrameWhereClause = null, orderBy: [FrameOrderByClause!] = []): Frame
frameId: Int!
tiltseries(where: TiltseriesWhereClause = null, orderBy: [TiltseriesOrderByClause!] = []): Tiltseries
tiltseriesId: Int!

"""z-index of the frame in the tiltseries"""
zIndex: Int!
Expand Down Expand Up @@ -3646,6 +3666,7 @@ type Run implements EntityInterface & Node {
): AnnotationConnection!
annotationsAggregate(where: AnnotationWhereClause = null): AnnotationAggregate
dataset(where: DatasetWhereClause = null, orderBy: [DatasetOrderByClause!] = []): Dataset
datasetId: Int!
frames(
where: FrameWhereClause = null
orderBy: [FrameOrderByClause!] = []
Expand Down Expand Up @@ -3924,7 +3945,9 @@ type Tiltseries implements EntityInterface & Node {
): PerSectionParametersConnection!
perSectionParametersAggregate(where: PerSectionParametersWhereClause = null): PerSectionParametersAggregate
run(where: RunWhereClause = null, orderBy: [RunOrderByClause!] = []): Run
runId: Int!
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int

"""S3 path to this tiltseries in multiscale OME-Zarr format"""
s3OmezarrDir: String
Expand Down Expand Up @@ -4561,6 +4584,7 @@ type Tomogram implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
alignment(where: AlignmentWhereClause = null, orderBy: [AlignmentOrderByClause!] = []): Alignment
alignmentId: Int
authors(
where: TomogramAuthorWhereClause = null
orderBy: [TomogramAuthorOrderByClause!] = []
Expand All @@ -4579,8 +4603,11 @@ type Tomogram implements EntityInterface & Node {
): TomogramAuthorConnection!
authorsAggregate(where: TomogramAuthorWhereClause = null): TomogramAuthorAggregate
deposition(where: DepositionWhereClause = null, orderBy: [DepositionOrderByClause!] = []): Deposition
depositionId: Int
run(where: RunWhereClause = null, orderBy: [RunOrderByClause!] = []): Run
runId: Int
tomogramVoxelSpacing(where: TomogramVoxelSpacingWhereClause = null, orderBy: [TomogramVoxelSpacingOrderByClause!] = []): TomogramVoxelSpacing
tomogramVoxelSpacingId: Int

"""Short name for this tomogram"""
name: String
Expand Down Expand Up @@ -4689,6 +4716,7 @@ type TomogramAuthor implements EntityInterface & Node {
"""An identifier to refer to a specific instance of this type"""
id: Int!
tomogram(where: TomogramWhereClause = null, orderBy: [TomogramOrderByClause!] = []): Tomogram
tomogramId: Int

"""The order that the author is listed as in the associated publication"""
authorListOrder: Int!
Expand Down Expand Up @@ -5275,6 +5303,7 @@ type TomogramVoxelSpacing implements EntityInterface & Node {
): AnnotationFileConnection!
annotationFilesAggregate(where: AnnotationFileWhereClause = null): AnnotationFileAggregate
run(where: RunWhereClause = null, orderBy: [RunOrderByClause!] = []): Run
runId: Int
tomograms(
where: TomogramWhereClause = null
orderBy: [TomogramOrderByClause!] = []
Expand Down
Loading

0 comments on commit 2a9e248

Please sign in to comment.