schema.sdl 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. schema {
  2. query: query
  3. mutation: mutation
  4. }
  5. "Annotations object"
  6. type Annotation {
  7. "GraphID for annotation node"
  8. graphId: String
  9. context: String!
  10. "id"
  11. id: String!
  12. "object type"
  13. type: EntityType!
  14. "Annotation motivation"
  15. motivation: String!
  16. "The agent responsible for creation of annotation"
  17. creator: Creator!
  18. "The date-time of creation of annotation"
  19. created: String!
  20. "The agent responsible for generation of annotation"
  21. generator: Generator!
  22. "Date-time of generation of annotation"
  23. generated: String!
  24. "Annotation body"
  25. body: [bodyType!]
  26. "Annotation target"
  27. target: [targetType!]!
  28. }
  29. input AnnotationInput {
  30. targetId: String!
  31. motivation: String!
  32. body: BodyInput!
  33. target: Target!
  34. concept: String
  35. }
  36. type AuthPayload {
  37. token: String!
  38. user: User!
  39. }
  40. input BodyInput {
  41. typ: String!
  42. motivation: String!
  43. value: String!
  44. format: String!
  45. language: String!
  46. creator: String!
  47. concept: String
  48. }
  49. input Comment {
  50. targetId: String!
  51. value: String!
  52. }
  53. type Creator {
  54. graphId: String!
  55. typ: EntityType!
  56. name: String!
  57. nickname: String!
  58. }
  59. input CsvIngestInput {
  60. filePath: String!
  61. crosswalk: [FlatRecordMapper!]!
  62. partner: PartnerInput!
  63. }
  64. "Date range, inclusive"
  65. type DateRange {
  66. "Date starting from"
  67. from: String!
  68. "Date ending"
  69. to: String!
  70. }
  71. "ISO-8601 formatted string of format: 2017-06-25"
  72. input DateRangeInput {
  73. from: String!
  74. to: String!
  75. }
  76. type EntityFilter {
  77. blob: String!
  78. lang: [Language!]
  79. dateRange: DateRange
  80. subjects: [Subject!]
  81. people: [Person!]
  82. places: [Place!]
  83. partners: [Partner!]
  84. }
  85. input EntityFilterInput {
  86. blob: String!
  87. dateRange: DateRangeInput
  88. lang: [String!]
  89. subjects: [String!]
  90. people: [String!]
  91. places: [String!]
  92. partners: [String!]
  93. }
  94. enum EntityType {
  95. Text
  96. Sound
  97. Video
  98. Image
  99. Dataset
  100. SpecificResource
  101. TextualBody
  102. LocalResource
  103. Software
  104. Client
  105. Ni
  106. User
  107. Partner
  108. Person
  109. Annotation
  110. MilliEntity
  111. Language
  112. Place
  113. Subject
  114. }
  115. """
  116. Map from a flat-record to any level of
  117. nested record structure. Ensure column names are unique.
  118. """
  119. input FlatRecordMapper {
  120. field: ValidField!
  121. columnName: String!
  122. default: String!
  123. }
  124. type Generator {
  125. graphId: String!
  126. typ: EntityType!
  127. name: String!
  128. homepage: String!
  129. }
  130. type Image {
  131. graphId: String!
  132. typ: EntityType!
  133. src: String!
  134. alt: String
  135. size: ImageSize!
  136. }
  137. enum ImageSize {
  138. LARGE
  139. MEDIUM
  140. SMALL
  141. }
  142. type Language {
  143. graphId: String!
  144. typ: EntityType!
  145. langId: String!
  146. displayName: String!
  147. isSelected: Boolean!
  148. }
  149. "LocalResource wraps a NiosxEntity as the body of the annotation."
  150. type LocalResource {
  151. "One of NiosxEntity types"
  152. entity: NiosxEntityUnion
  153. "IRI of the LocalResource"
  154. iri: String!
  155. "GraphId of the LocalResource"
  156. graphId: String!
  157. "IRI of the Body"
  158. source: String!
  159. "Concept with which the Body is attached to the Entity."
  160. concept: NiosxConcept!
  161. "Type of the Body entity."
  162. type: EntityType!
  163. }
  164. type MilliEntity {
  165. graphId: String!
  166. typ: EntityType!
  167. agencyCode: String!
  168. recordId: String!
  169. unitId: String!
  170. title: String!
  171. creator: String!
  172. dateOfCreation: String!
  173. extent: String!
  174. level: String!
  175. partner: Partner!
  176. subjects: [Subject!]!
  177. images: [Image!]!
  178. description: String
  179. location: String
  180. accessRestrict: String
  181. useRestrict: String
  182. language: String
  183. unitType: String
  184. format: String
  185. annotations: [Annotation!]!
  186. }
  187. "The concept layer connecting all entities via annotations."
  188. type NiosxConcept {
  189. """
  190. Name of the concept.
  191. This is one of system defined values or a user given name.
  192. """
  193. name: String!
  194. }
  195. "All Types identified by the niosx ecosystem"
  196. interface NiosxEntity {
  197. "A unique identity for the entity in the niosx ecosystem."
  198. graphId: String!
  199. "The `type` is a String representation of the entity type."
  200. type: EntityType!
  201. }
  202. input NiosxEntityInput {
  203. agencyCode: String!
  204. recordId: String!
  205. unitId: String!
  206. title: String!
  207. creator: String!
  208. dateOfCreation: String!
  209. extent: String!
  210. level: String!
  211. partner: String!
  212. description: String
  213. location: String
  214. accessRestrict: String
  215. useRestrict: String
  216. language: String
  217. unitType: String
  218. format: String
  219. }
  220. "Is one the the niosx Entities."
  221. union NiosxEntityUnion = TextualBody | LocalResource | Subject
  222. input NiosxUser {
  223. username: String!
  224. password: String!
  225. role: String!
  226. }
  227. type Page {
  228. edges: [PageEdge!]!
  229. pageInfo: PageInfo!
  230. }
  231. type PageEdge {
  232. node: MilliEntity!
  233. cursor: String!
  234. offset: Long!
  235. isDirectMatch: Boolean!
  236. annotationMatchCount: Int!
  237. }
  238. type PageInfo {
  239. pageNumber: Int!
  240. endCursor: String!
  241. hasNextPage: Boolean!
  242. filters: EntityFilter!
  243. }
  244. type Partner {
  245. graphId: String!
  246. typ: EntityType!
  247. displayName: String!
  248. isSelected: Boolean!
  249. }
  250. input PartnerInput {
  251. graphId: String = "4ebb7326-dcbb-4056-bff3-7c76c059a000"
  252. typ: EntityType = Partner
  253. displayName: String!
  254. isSelected: Boolean = true
  255. }
  256. type Person {
  257. graphId: String!
  258. typ: EntityType!
  259. displayName: String!
  260. isSelected: Boolean!
  261. }
  262. type Place {
  263. graphId: String!
  264. typ: EntityType!
  265. lat: Float!
  266. lon: Float!
  267. displayName: String!
  268. isSelected: Boolean!
  269. }
  270. type SpecificResourceType {
  271. graphId: String!
  272. typ: EntityType!
  273. source: String!
  274. targetId: String!
  275. }
  276. type Subject {
  277. graphId: String!
  278. typ: EntityType!
  279. prefLabel: String!
  280. inScheme: String!
  281. id: String!
  282. isSelected: Boolean!
  283. }
  284. input SubjectAnnoInput {
  285. targetId: String!
  286. subjectId: String
  287. prefLabel: String
  288. }
  289. input SubjectIn {
  290. prefLabel: String!
  291. inScheme: String!
  292. id: String!
  293. }
  294. input Target {
  295. source: String!
  296. targetId: String!
  297. }
  298. type TextualBody implements NiosxEntity {
  299. graphId: String!
  300. typ: EntityType!
  301. iri: String!
  302. purpose: String!
  303. value: String!
  304. format: String!
  305. language: String!
  306. creator: String!
  307. concept: NiosxConcept!
  308. "The `type` is a String representation of the entity type."
  309. type: EntityType!
  310. }
  311. type User {
  312. username: String!
  313. permissions: [String!]
  314. }
  315. enum ValidField {
  316. ME_format
  317. ME_unitType
  318. ME_language
  319. ME_useRestrict
  320. ME_accessRestrict
  321. ME_location
  322. ME_description
  323. ME_subject
  324. ME_image
  325. ME_level
  326. ME_extent
  327. ME_dateOfCreation
  328. ME_creator
  329. ME_title
  330. ME_unitId
  331. ME_agencyCode
  332. ME_recordId
  333. }
  334. "Can be one of TextualBodyType, etc."
  335. union bodyType = TextualBody | LocalResource
  336. type mutation {
  337. rdfIngest(rdf_file: String!, schema: String!): Int!
  338. ingestWithCrosswalk(csvIngestInput: CsvIngestInput!): Int!
  339. addEntity(niosxEntityInput: NiosxEntityInput!): MilliEntity
  340. addAnnotation(annotation: AnnotationInput!): Annotation
  341. addSubAnno(subjectAnno: SubjectAnnoInput!): Annotation
  342. addComment(comment: Comment!): Annotation
  343. addSubject(SubjectIn: SubjectIn!): Subject
  344. login(username: String!, password: String!): AuthPayload
  345. register(niosxUserInput: NiosxUser!): String!
  346. }
  347. type query {
  348. "Paginated list of entities"
  349. searchCollections(next: Int!, cursor: String, entityFilterInputArg: EntityFilterInput!): Page
  350. "Returns everything! Be careful!"
  351. crudeSearch(blob: String!): [MilliEntity!]!
  352. "Test if there is an object with this graphId"
  353. isValidGraphId(id: String!): Boolean!
  354. "Look up an entity with its graphId"
  355. findEntity(id: String!): MilliEntity
  356. "Look up a user with its username"
  357. findUser(username: String!): User
  358. }
  359. "Can be one of SpecificResource, etc."
  360. union targetType = SpecificResourceType