-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.graphql
More file actions
1099 lines (979 loc) · 32.3 KB
/
schema.graphql
File metadata and controls
1099 lines (979 loc) · 32.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
scalar DateTime
scalar Upload
scalar Latitude
scalar Longitude
""" These unions are a way for a property to hold references to different types """
union Enterable = Group | Person | Reference | Schema | Character | State | Description | CharacterInstance | Specimen | Collection
union Groupable = Reference | Schema | Character | State | Description | CharacterInstance | Specimen | Collection
union Authorable = Reference | Schema
union Statable = Character | State
union Characterable = Schema | Character
union Citer = Schema | Description | Specimen
union Commentable = Synonym | Comment
type Group {
pbotID: ID!
name: String
purpose: String
members: [Person!]! @relation(name: "MEMBER_OF", direction: IN)
elements: [Groupable!]! @relation(name: "ELEMENT_OF", direction: IN)
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
enteredBy: [GroupEnteredBy]
}
""" Note that I had to use the cypher directive to populate the entered property.
Ideally, this would be handled by a relation directive, but that does not appear to
work with unions. """
type Person {
pbotID: ID!
password: String
given: String
middle: String
surname: String
email: String
orcid: String
reason: String
bio: String
registered: Boolean @cypher(
statement: "return this.password is not null"
)
entered: [Enterable] @cypher(
statement: "match (n)-[:ENTERED_BY]->(this) return n"
)
authored: [Authorable!]! @relation(name: "AUTHORED_BY", direction: IN)
identified: [Specimen] @relation(name: "HAS_IDENTIFIED", direction: OUT)
memberOf: [Group] @relation(name: "MEMBER_OF", direction: OUT)
enteredBy: [PersonEnteredBy]
}
type Reference {
pbotID: ID!
title: String
year: String
publicationType: String
firstPage: String
lastPage: String
journal: String
bookTitle: String
publicationVolume: String
publicationNumber: String
publisher: String
description: String
bookType: String
editors: String
notes: String
doi: String
pbdbid: String
citedBy: [Citer!]! @relation(name: "CITED_BY", direction: OUT)
authoredBy: [ReferenceAuthoredBy!]!
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
enteredBy: [ReferenceEnteredBy]
}
type Schema {
pbotID: ID!
title: String
year: String
acknowledgments: String
purpose: String
partsPreserved: [Organ] @relation(name: "HAS_PART", direction: OUT)
notableFeatures: [Feature] @relation(name: "HAS_FEATURE", direction: OUT)
references: [SchemaCitedBy]
characters: [Character] @relation(name: "CHARACTER_OF", direction: IN)
authoredBy: [SchemaAuthoredBy]
appliedBy: [Description]! @relation(name: "APPLICATION_OF", direction: IN)
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
enteredBy: [SchemaEnteredBy]
}
type Character {
pbotID: ID!
name: String
definition: String
order: String
deepOrder: String @cypher(
statement: """
MATCH path = (this)-[:CHARACTER_OF*0..]->(root:Character)
WITH nodes(path) AS ns
ORDER BY length(path) DESC
LIMIT 1
WITH [n IN reverse(ns) | n.order] AS orders
RETURN apoc.text.join(orders, ".")
"""
)
characterOf: Characterable! @cypher(
statement: "match (this)-[:CHARACTER_OF]->(n) return n limit 1"
)
characters: [Character!]! @relation(name: "CHARACTER_OF", direction: IN)
states: [State!]! @relation(name: "STATE_OF", direction: IN)
characterInstances: [CharacterInstance!]! @relation(name: "INSTANCE_OF" direction: IN)
enteredBy: [CharacterEnteredBy]
}
type State {
pbotID: ID!
name: String
definition: String
order: String
deepOrder: String @cypher(
statement: """
MATCH path = (this)-[:STATE_OF*0..]->(root:State)
WITH nodes(path) AS ns
ORDER BY length(path) DESC
LIMIT 1
WITH [n IN reverse(ns) | n.order] AS orders
RETURN apoc.text.join(orders, ".")
"""
)
stateOf: Statable! @cypher(
statement: "match (this)-[:STATE_OF]->(n) return n limit 1"
)
states: [State!]! @relation(name: "STATE_OF", direction: IN)
characterInstances: [HasState]
enteredBy: [StateEnteredBy]
}
""" Description Complex types """
type Organ {
pbotID: ID!
type: String
specimens: [Specimen!]! @relation(name: "HAS_PART" direction: IN)
otus: [OTU!]! @relation(name: "HAS_PART" direction: IN)
enteredBy: [OrganEnteredBy]
}
type Feature {
pbotID: ID!
name: String
specimens: [Specimen!]! @relation(name: "HAS_FEATURE" direction: IN)
otus: [OTU!]! @relation(name: "HAS_FEATURE" direction: IN)
enteredBy: [FeatureEnteredBy]
}
type PreservationMode {
pbotID: ID!
name: String
specimens: [Specimen!]! @relation(name: "PRESERVED_BY" direction: IN)
enteredBy: [PreservationModeEnteredBy]
}
"""Note: schema should be non null, but isn't right now due to missing data"""
type Description {
pbotID: ID!
name: String
writtenDescription: String
notes: String
characterInstances: [CharacterInstance!]! @relation(name: "DEFINED_BY", direction: OUT)
specimens: [DescribedBy]
schema: Schema @relation(name: "APPLICATION_OF", direction: OUT)
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
references: [DescriptionCitedBy]
enteredBy: [DescriptionEnteredBy]
}
type CharacterInstance {
pbotID: ID!
character: Character @relation(name: "INSTANCE_OF", direction: OUT)
state: HasState
candidateForArchtype: Description @relation(name: "CANDIDATE_FOR", direction: OUT)
description: Description @relation(name: "DEFINED_BY" direction: IN)
enteredBy: [CharacterInstanceEnteredBy]
}
type PseudoCharacterInstance {
schema: String
characterName: String
characterID: String
characterDeepOrder: String
stateDeepOrder: String
stateName: String
stateID: String
stateOrder: String
stateValue: String
}
"""Note: Ideally, we'd return this for mergedDescription, but neo4j-graphql-js seems to choke when
types are nested more than one level. Keeping it here as a reminder down the line."""
type PseudoDescription {
schema: String!
characterInstances: [PseudoCharacterInstance!]!
}
type OTU {
pbotID: ID!
name: String
authority: String
diagnosis: String
qualityIndex: String
majorTaxonGroup: String
pbdbParentTaxon: String
family: String
genus: String
pfnGenusLink: String
species: String
pfnSpeciesLink: String
additionalClades: String
identifiedSpecimens: [IdentifiedSpecimenOf!]!
typeSpecimens: [TypeSpecimenOf!]!
holotypeSpecimen: HolotypeSpecimenOf
synonyms: [Synonym] @relation(name: "SAME_AS", direction: OUT)
references: [OTUCitedBy]
partsPreserved: [Organ] @relation(name: "HAS_PART", direction: OUT)
notableFeatures: [Feature] @relation(name: "HAS_FEATURE", direction: OUT)
notes: String
mergedDescription: [PseudoCharacterInstance!]! @cypher(
statement: """
MATCH
(otu:OTU {pbotID:this.pbotID})<-[:TYPE_OF|:HOLOTYPE_OF]-(specimen:Specimen)-[:DESCRIBED_BY]->(d:Description)
WITH
DISTINCT d //This gets rid of possible TYPE_OF/HOLOTYPE_OF duplicates
MATCH
(d)-[:DEFINED_BY]->(ci:CharacterInstance),
(ci)-[:INSTANCE_OF]->(c:Character),
(ci)-[hs:HAS_STATE]->(s:State),
(d)-[:APPLICATION_OF]->(schema:Schema)
WITH
DISTINCT c, schema, s, hs.value AS stateValue, hs.order AS stateOrder
// Combined subquery for both Character and State deepOrder
CALL {
WITH c, s
// Calculate Character deepOrder
MATCH path1 = (c)-[:CHARACTER_OF*0..]->(rootChar:Character)
WITH c, s, path1
ORDER BY length(path1) DESC
LIMIT 1
// Calculate State deepOrder
MATCH path2 = (s)-[:STATE_OF*0..]->(rootState:State)
WITH c, s, path1, path2
ORDER BY length(path2) DESC
LIMIT 1
RETURN
c.pbotID AS charID,
s.pbotID AS stateID,
apoc.text.join([n IN reverse(nodes(path1)) | n.order], ".") AS charDeepOrder,
apoc.text.join([n IN reverse(nodes(path2)) | n.order], ".") AS stateDeepOrder
}
RETURN
{
schema: schema.title,
characterName: c.name,
characterID: c.pbotID,
characterDeepOrder: charDeepOrder,
stateName: s.name,
stateID: s.pbotID,
stateOrder: stateOrder,
stateDeepOrder: stateDeepOrder,
stateValue: stateValue
} AS md
"""
)
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
enteredBy: [OTUEnteredBy]
}
type Synonym {
pbotID: ID!
explanation: String
comments: [Comment!] @relation(name: "REFERS_TO", direction: IN)
references: [SynonymCitedBy]
otus: [OTU!]! @relation(name: "SAME_AS", direction: IN)
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
enteredBy: [SynonymEnteredBy]
}
type Comment {
pbotID: ID!
content: String
subject: Commentable! @cypher(
statement: "match (this)-[:REFERS_TO]->(n) return n limit 1"
)
references: [CommentCitedBy]
comments: [Comment!] @relation(name: "REFERS_TO", direction: IN)
enteredBy: [CommentEnteredBy]
}
type Specimen {
pbotID: ID!
name: String
specimenNumber: String @cypher(
statement: "return this.name"
)
preservationModes: [PreservationMode] @relation(name: "PRESERVED_BY", direction: OUT)
repository: String
otherRepositoryLink: String
notes: String
gbifID: String
idigbioInstitutionCode: String
idigbioCatalogNumber: String
idigbiouuid: String
pbdbcid: String
pbdboccid: String
partsPreserved: [Organ] @relation(name: "HAS_PART", direction: OUT)
notableFeatures: [Feature] @relation(name: "HAS_FEATURE", direction: OUT)
images: [Image] @relation(name: "IMAGE_OF", direction: IN)
describedBy: [DescribedBy]
identifiedAs: [IdentifiedSpecimenOf]
typeOf: [TypeSpecimenOf]
holotypeOf: [HolotypeSpecimenOf]
identifiers: [Person] @relation(name: "HAS_IDENTIFIED", direction: IN)
references: [SpecimenCitedBy]
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
collection: Collection! @relation(name: "COLLECTED_IN", direction: OUT)
enteredBy: [SpecimenEnteredBy]
}
type Image {
pbotID: ID!
link: String!
category: String
citation: String
caption: String
type: String
imageOf: Specimen! @relation(name: "IMAGE_OF", direction: OUT)
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
}
"""Note: lat and lon have been replaced by location. Keeping them here with @cyphers for api consistency. """
type Collection {
pbotID: ID!
name: String!
collectionType: String
sizeClasses: [String]
timescale: String
mininterval: String
maxinterval: String
lithology: String
additionalLithology: String
stratigraphicGroup: String
stratigraphicFormation: String
stratigraphicMember: String
stratigraphicBed: String
stratigraphicComments: String
preservationModes: [PreservationMode] @relation(name: "PRESERVED_BY", direction: OUT)
environment: String
environmentComments: String
collectors: String
collectionMethods: [String]
collectingComments: String
lat: Latitude @cypher(statement: "match (this) return this.location.latitude")
lon: Longitude @cypher(statement: "match (this) return this.location.longitude")
location: Point
gpsCoordinateUncertainty: Float
geographicResolution: String
geographicComments: String
directDate: Float
directDateError: Float
directDateType: String
numericAgeMin: Float
numericAgeMinError: Float
numericAgeMinType: String
numericAgeMax: Float
numericAgeMaxError: Float
numericAgeMaxType: String
ageComments: String
protectedSite: Boolean
country: String
state: String
pbdbid: String
specimens: [Specimen] @relation(name: "COLLECTED_IN", direction: IN)
references: [CollectionCitedBy!]!
elementOf: [Group!]! @relation(name: "ELEMENT_OF", direction: OUT)
enteredBy: [CollectionEnteredBy]
}
""" In order to access relationship properties, the relationship must be specified with a standalone type.
Ideally, there would be one of these for the ENTERED_BY relationship, with the Enterable union in the
from property. That does not work. So, I've had to resort to creating a separate type for each node type
that could be in the from property. I'm not sure of the cons here. It looks like crap though. """
type GroupEnteredBy @relation(name: "ENTERED_BY") {
from: Group
to: Person
timestamp: DateTime
type: String
}
type PersonEnteredBy @relation(name: "ENTERED_BY") {
from: Person
to: Person
timestamp: DateTime
type: String
}
type ReferenceEnteredBy @relation(name: "ENTERED_BY") {
from: Reference
to: Person
timestamp: DateTime
type: String
}
type SchemaEnteredBy @relation(name: "ENTERED_BY") {
from: Schema
to: Person
timestamp: DateTime
type: String
}
type CharacterEnteredBy @relation(name: "ENTERED_BY") {
from: Character
to: Person
timestamp: DateTime
type: String
}
type StateEnteredBy @relation(name: "ENTERED_BY") {
from: State
to: Person
timestamp: DateTime
type: String
}
type OrganEnteredBy @relation(name: "ENTERED_BY") {
from: Organ
to: Person
timestamp: DateTime
type: String
}
type FeatureEnteredBy @relation(name: "ENTERED_BY") {
from: Feature
to: Person
timestamp: DateTime
type: String
}
type PreservationModeEnteredBy @relation(name: "ENTERED_BY") {
from: PreservationMode
to: Person
timestamp: DateTime
type: String
}
type DescriptionEnteredBy @relation(name: "ENTERED_BY") {
from: Description
to: Person
timestamp: DateTime
type: String
}
type CharacterInstanceEnteredBy @relation(name: "ENTERED_BY") {
from: CharacterInstance
to: Person
timestamp: DateTime
type: String
}
type SpecimenEnteredBy @relation(name: "ENTERED_BY") {
from: Specimen
to: Person
timestamp: DateTime
type: String
}
type CollectionEnteredBy @relation(name: "ENTERED_BY") {
from: Collection
to: Person
timestamp: DateTime
type: String
}
type OTUEnteredBy @relation(name: "ENTERED_BY") {
from: OTU
to: Person
timestamp: DateTime
type: String
}
type SynonymEnteredBy @relation(name: "ENTERED_BY") {
from: Synonym
to: Person
timestamp: DateTime
type: String
}
type CommentEnteredBy @relation(name: "ENTERED_BY") {
from: Comment
to: Person
timestamp: DateTime
type: String
}
"""AUTHORED_BY for access to order"""
type ReferenceAuthoredBy @relation(name: "AUTHORED_BY") {
from: Reference
to: Person
order: String
}
type SchemaAuthoredBy @relation(name: "AUTHORED_BY") {
from: Schema
to: Person
order: String
}
"""CITED_BY for access to order"""
type SchemaCitedBy @relation(name: "CITED_BY") {
from: Reference
to: Schema
order: String
}
type DescriptionCitedBy @relation(name: "CITED_BY") {
from: Reference
to: Description
order: String
}
type SpecimenCitedBy @relation(name: "CITED_BY") {
from: Reference
to: Specimen
order: String
}
type CollectionCitedBy @relation(name: "CITED_BY") {
from: Reference
to: Collection
order: String
}
type OTUCitedBy @relation(name: "CITED_BY") {
from: Reference
to: OTU
order: String
}
type SynonymCitedBy @relation(name: "CITED_BY") {
from: Reference
to: Synonym
order: String
}
type CommentCitedBy @relation(name: "CITED_BY") {
from: Reference
to: Comment
order: String
}
""" HAS_STATE for access to value and order"""
type HasState @relation(name: "HAS_STATE") {
from: CharacterInstance
to: State
value: String
order: String
}
""" IDENTIFIED_AS for access to entered_by and timestamp """
type IdentifiedSpecimenOf @relation(name: "IDENTIFIED_AS") {
from: Specimen
to: OTU
entered_by: ID!
timestamp: DateTime
}
""" TYPE_OF for access to entered_by and timestamp """
type TypeSpecimenOf @relation(name: "TYPE_OF") {
from: Specimen
to: OTU
entered_by: ID!
timestamp: DateTime
}
""" HOLOTYPE_OF for access to entered_by and timestamp """
type HolotypeSpecimenOf @relation(name: "HOLOTYPE_OF") {
from: Specimen
to: OTU
entered_by: ID!
timestamp: DateTime
}
""" DESCRIBED_BY for access to entered_by and timestamp """
type DescribedBy @relation(name: "DESCRIBED_BY") {
from: Specimen
to: Description
entered_by: ID!
timestamp: DateTime
}
type Query {
echoLat(lat: Latitude!): Latitude!
echoLon(lon: Longitude!): Longitude!
"""
Not sure this will be useful, but it's a way to get at the leaf states in state hierarchies."""
GetLeafStates(characterID: String!): [State]
@cypher(
statement: """
match
(:Character {pbotID: $characterID})<-[:STATE_OF*1..100]-(n:State)
where
not (n)<-[:STATE_OF]-(:State)
return n
"""
)
GetAllStates(characterID: String!): [State]
@cypher(
statement: """
match
(:Character {pbotID: $characterID})<-[:STATE_OF*1..100]-(n:State)
return n
"""
)
GetAllCharacters(schemaID: String!): [Character]
@cypher(
statement: """
match
(:Schema {pbotID: $schemaID})<-[:CHARACTER_OF*1..100]-(n:Character)
return n
"""
)
GetAllComments(synonymID: String!): [Comment]
@cypher(
statement: """
match
(:Synonym {pbotID: $synonymID})<-[:REFERS_TO*1..100]-(n:Comment)
return n
"""
)
GetNodeCount(nodeType: String!): Int
@cypher(
statement: """
CALL apoc.when(
'Contributor' = $nodeType,
'match (n:Person) where n.password is not null return count(n)',
'match (n) where $nodeType in labels(n) return count(n)',
{nodeType:$nodeType}
) yield value
return value.`count(n)`
"""
)
}
""" //////////////////////////////////////////////////////////////////////////////////////////////////////
Mutations overrides. We might want to think about only using these, rather than any generated mutations.
TODO: To make these true overrides, delete the 'Custom' prefix. """
input GroupInput {
pbotID: String
name: String
purpose: String
members: [String]
elements: [String]
groups: [String]
enteredByPersonID: String
}
input PersonInput {
pbotID: String
given: String
middle: String
surname: String
email: String
orcid: String
reason: String
bio: String
enteredByPersonID: String
}
input AuthoredBy {
pbotID: String
order: String
}
input ReferenceInput {
pbotID: String
title: String
year: String
publicationType: String
firstPage: String
lastPage: String
journal: String
bookTitle: String
publicationVolume: String
publicationNumber: String
publisher: String
description: String
bookType: String
editors: String
notes: String
doi: String
pbdbid: String
authors: [AuthoredBy!]!
groups: [String]
enteredByPersonID: String
}
input CitedByInput {
pbotID: String
order: String
}
input SchemaInput {
pbotID: String
title: String!
year: String
acknowledgments: String
purpose: String!
partsPreservedIDs: [String!]!
notableFeaturesIDs: [String]
references: [CitedByInput!]!
authors: [AuthoredBy]
groups: [String]
enteredByPersonID: String
cascade: Boolean
}
input CharacterInput {
pbotID: String
name: String
definition: String
order: String
parentID: String
schemaID: String
enteredByPersonID: String
cascade: Boolean
}
input StateInput {
pbotID: String
name: String
definition: String
order: String
parentID: String
schemaID: String
enteredByPersonID: String
cascade: Boolean
}
input DescriptionInput {
pbotID: String
specimenIDs: [String]
name: String!
writtenDescription: String
notes: String
schemaID: String!
references: [CitedByInput]
groups: [String]
enteredByPersonID: String
cascade: Boolean
}
input CharacterInstanceInput {
pbotID: String
descriptionID: String!
characterID: String!
stateID: String!
quantity: String
order: String
enteredByPersonID: String
}
input OTUInput {
pbotID: String
name: String!
authority: String!
diagnosis: String!
qualityIndex: String!
majorTaxonGroup: String!
pbdbParentTaxon: String!
family: String
genus: String
pfnGenusLink: String
species: String
pfnSpeciesLink: String
additionalClades: String
identifiedSpecimens: [String]
typeSpecimens: [String]
holotypeSpecimen: String
synonyms: [String]
references: [CitedByInput!]!
partsPreservedIDs: [String!]!
notableFeaturesIDs: [String]
notes: String
groups: [String!]!
}
input SynonymInput {
pbotID: String
explanation: String
references: [CitedByInput]
otus: [String!]!
groups: [String]
}
input CommentInput {
pbotID: String
content: String
subjectID: String
references: [CitedByInput]
}
input ImageUpload {
image: Upload!,
specimenID: String!,
order: String
}
type ImageReturn {
link: String!,
}
input SpecimenInput {
pbotID: String
name: String!
preservationModeIDs: [String!]!
repository: String!
otherRepositoryLink: String
notes: String
gbifID: String
idigbioInstitutionCode: String
idigbioCatalogNumber: String
idigbiouuid: String
pbdbcid: String
pbdboccid: String
images: [ImageInput]
descriptionIDs: [String]
partsPreservedIDs: [String!]!
notableFeaturesIDs: [String]
identifiers: [String]
references: [CitedByInput]
collection: String!
uploadImages: [ImageUpload]
groups: [String]
enteredByPersonID: String
cascade: Boolean
}
input ImageInput {
pbotID: String
link: String
image: Upload
category: String
citation: String
caption: String
type: String
groups: [String]
imageOf: String
}
input OrganInput {
pbotID: String
type: String!
enteredByPersonID: String
}
input FeatureInput {
pbotID: String
name: String!
enteredByPersonID: String
}
input PreservationModeInput {
pbotID: String
name: String!
enteredByPersonID: String
}
"""Note: location is required, but it shown optional here for api consistency. This is caught in resolver."""
input CollectionInput {
pbotID: String
name: String!
collectionType: String!
sizeClasses: [String!]!
timescale: String!
mininterval: String
maxinterval: String!
lithology: String!
additionalLithology: String
stratigraphicGroup: String
stratigraphicFormation: String
stratigraphicMember: String
stratigraphicBed: String
stratigraphicComments: String
preservationModeIDs: [String!]!
environment: String
environmentComments: String
collectors: String
collectionMethods: [String]
collectingComments: String
lat: Latitude
lon: Longitude
location: Point
gpsCoordinateUncertainty: Float!
geographicResolution: String
geographicComments: String
directDate: Float
directDateError: Float
directDateType: String
numericAgeMin: Float
numericAgeMinError: Float
numericAgeMinType: String
numericAgeMax: Float
numericAgeMaxError: Float
numericAgeMaxType: String
ageComments: String
protectedSite: Boolean!
country: String!
state: String
pbdbid: String
references: [CitedByInput]
groups: [String]
enteredByPersonID: String
cascade: Boolean
}
type File {
filename: String!
mimetype: String!
encoding: String!
}
type Mutation {
singleUpload(file: Upload!): File!
CreateGroup(data: GroupInput!): Group! @neo4j_ignore
UpdateGroup(data: GroupInput!): Group! @neo4j_ignore
DeleteGroup(data: GroupInput!): Group! @neo4j_ignore
CreatePerson(data: PersonInput!): Person! @neo4j_ignore
UpdatePerson(data: PersonInput!): Person! @neo4j_ignore
DeletePerson(data: PersonInput!): Person! @neo4j_ignore
CreateReference(data: ReferenceInput!): Reference! @neo4j_ignore
UpdateReference(data: ReferenceInput!): Reference! @neo4j_ignore
DeleteReference(data: ReferenceInput!): Reference! @neo4j_ignore
CreateSchema(data: SchemaInput!): Schema! @neo4j_ignore
UpdateSchema(data: SchemaInput!): Schema! @neo4j_ignore
DeleteSchema(data: SchemaInput!): Schema! @neo4j_ignore
CreateCharacter(data: CharacterInput!): Character! @neo4j_ignore
UpdateCharacter(data: CharacterInput!): Character! @neo4j_ignore
DeleteCharacter(data: CharacterInput!): Character! @neo4j_ignore
CreateState(data: StateInput!): State! @neo4j_ignore
UpdateState(data: StateInput!): State! @neo4j_ignore
DeleteState(data: StateInput!): State! @neo4j_ignore
CreateOTU(data: OTUInput!): OTU! @neo4j_ignore
UpdateOTU(data: OTUInput!): OTU! @neo4j_ignore
DeleteOTU(data: OTUInput!): OTU! @neo4j_ignore
CreateSynonym(data: SynonymInput!): Synonym! @neo4j_ignore
UpdateSynonym(data: SynonymInput!): Synonym! @neo4j_ignore
DeleteSynonym(data: SynonymInput!): Synonym! @neo4j_ignore
CreateComment(data: CommentInput!): Comment! @neo4j_ignore
UpdateComment(data: CommentInput!): Comment! @neo4j_ignore
DeleteComment(data: CommentInput!): Comment! @neo4j_ignore
CreateDescription(data: DescriptionInput!): Description! @neo4j_ignore
UpdateDescription(data: DescriptionInput!): Description! @neo4j_ignore
DeleteDescription(data: DescriptionInput!): Description! @neo4j_ignore
"""NOTE: Keeping CharacterInstance create and update here rather than in Resolvers.js because of the need
to check that the State is associated with the Character. It's too specific to fit with the generic approach