-
Notifications
You must be signed in to change notification settings - Fork 42
/
types.R
4626 lines (4417 loc) · 162 KB
/
types.R
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
# This file was automatically generated by `r.ts`.
# Do not modify it by hand. Instead, modify the source `.schema.yaml` files
# in the `schema` directory and run `npm run build:r` to regenerate it.
#' @include typing.R
NULL
#' The most simple compound (ie. non-atomic like `number`, `string` etc) type.
#'
#' @name Entity
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @return A `list` of class `Entity`
#' @export
Entity <- function(
id,
meta
){
self <- list()
self$type <- as_scalar("Entity")
self[["id"]] <- check_property("Entity", "id", FALSE, missing(id), "character", id)
self[["meta"]] <- check_property("Entity", "meta", FALSE, missing(meta), "list", meta)
class(self) <- c(class(self), "Entity")
self
}
#' A reference to a CreativeWork that is cited in another CreativeWork.
#'
#' @name Cite
#' @param target The target of the citation (URL or reference ID). \bold{Required}.
#' @param citationIntent The type/s of the citation, both factually and rhetorically.
#' @param citationMode Determines how the citation is shown within the surrounding text.
#' @param citationPrefix Text to show before the citation.
#' @param citationSuffix Text to show after the citation.
#' @param content Optional structured content/text of this citation.
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @param pageEnd The page on which the work ends; for example "138" or "xvi".
#' @param pageStart The page on which the work starts; for example "135" or "xiii".
#' @param pagination Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55".
#' @return A `list` of class `Cite`
#' @seealso \code{\link{Entity}}
#' @export
Cite <- function(
target,
citationIntent,
citationMode,
citationPrefix,
citationSuffix,
content,
id,
meta,
pageEnd,
pageStart,
pagination
){
self <- Entity(
id = id,
meta = meta
)
self$type <- as_scalar("Cite")
self[["target"]] <- check_property("Cite", "target", TRUE, missing(target), "character", target)
self[["citationIntent"]] <- check_property("Cite", "citationIntent", FALSE, missing(citationIntent), Array(CitationIntentEnumeration), citationIntent)
self[["citationMode"]] <- check_property("Cite", "citationMode", FALSE, missing(citationMode), Enum("Parenthetical", "Narrative", "NarrativeAuthor", "NarrativeYear", "normal", "suppressAuthor"), citationMode)
self[["citationPrefix"]] <- check_property("Cite", "citationPrefix", FALSE, missing(citationPrefix), "character", citationPrefix)
self[["citationSuffix"]] <- check_property("Cite", "citationSuffix", FALSE, missing(citationSuffix), "character", citationSuffix)
self[["content"]] <- check_property("Cite", "content", FALSE, missing(content), Array(InlineContent), content)
self[["pageEnd"]] <- check_property("Cite", "pageEnd", FALSE, missing(pageEnd), Union("numeric", "character"), pageEnd)
self[["pageStart"]] <- check_property("Cite", "pageStart", FALSE, missing(pageStart), Union("numeric", "character"), pageStart)
self[["pagination"]] <- check_property("Cite", "pagination", FALSE, missing(pagination), "character", pagination)
class(self) <- c(class(self), "Cite")
self
}
#' A group of Cite nodes.
#'
#' @name CiteGroup
#' @param items One or more `Cite`s to be referenced in the same surrounding text. \bold{Required}.
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @return A `list` of class `CiteGroup`
#' @seealso \code{\link{Entity}}
#' @export
CiteGroup <- function(
items,
id,
meta
){
self <- Entity(
id = id,
meta = meta
)
self$type <- as_scalar("CiteGroup")
self[["items"]] <- check_property("CiteGroup", "items", TRUE, missing(items), Array(Cite), items)
class(self) <- c(class(self), "CiteGroup")
self
}
#' Base type for non-executable (e.g. `CodeBlock`) and executable (e.g. `CodeExpression`) code nodes.
#'
#' @name Code
#' @param text The text of the code. \bold{Required}.
#' @param id The identifier for this item.
#' @param mediaType Media type, typically expressed using a MIME format, of the code.
#' @param meta Metadata associated with this item.
#' @param programmingLanguage The programming language of the code.
#' @return A `list` of class `Code`
#' @seealso \code{\link{Entity}}
#' @export
Code <- function(
text,
id,
mediaType,
meta,
programmingLanguage
){
self <- Entity(
id = id,
meta = meta
)
self$type <- as_scalar("Code")
self[["text"]] <- check_property("Code", "text", TRUE, missing(text), "character", text)
self[["mediaType"]] <- check_property("Code", "mediaType", FALSE, missing(mediaType), "character", mediaType)
self[["programmingLanguage"]] <- check_property("Code", "programmingLanguage", FALSE, missing(programmingLanguage), "character", programmingLanguage)
class(self) <- c(class(self), "Code")
self
}
#' A code block.
#'
#' @name CodeBlock
#' @param text The text of the code. \bold{Required}.
#' @param id The identifier for this item.
#' @param mediaType Media type, typically expressed using a MIME format, of the code.
#' @param meta Metadata associated with this item.
#' @param programmingLanguage The programming language of the code.
#' @return A `list` of class `CodeBlock`
#' @seealso \code{\link{Code}}
#' @export
CodeBlock <- function(
text,
id,
mediaType,
meta,
programmingLanguage
){
self <- Code(
text = text,
id = id,
mediaType = mediaType,
meta = meta,
programmingLanguage = programmingLanguage
)
self$type <- as_scalar("CodeBlock")
class(self) <- c(class(self), "CodeBlock")
self
}
#' Base type for executable code nodes (i.e. `CodeChunk` and `CodeExpression`).
#'
#' @name CodeExecutable
#' @param programmingLanguage The programming language of the code. \bold{Required}.
#' @param text The text of the code. \bold{Required}.
#' @param codeDependencies The upstream dependencies of the code.
#' @param codeDependents The downstream dependents of the code.
#' @param compileDigest A digest of the content, semantics and dependencies of the node.
#' @param errors Errors when compiling (e.g. syntax errors) or executing the chunk.
#' @param executeCount A count of the number of times that the node has been executed.
#' @param executeDigest The `compileDigest` of the node when it was last executed.
#' @param executeDuration Duration in seconds of the last execution of the code.
#' @param executeEnded The date-time that the the last execution of the code ended.
#' @param executeRequired Whether, and why, a node requires execution or re-execution.
#' @param executeStatus Status of the most recent, including any current, execution of the code.
#' @param id The identifier for this item.
#' @param mediaType Media type, typically expressed using a MIME format, of the code.
#' @param meta Metadata associated with this item.
#' @return A `list` of class `CodeExecutable`
#' @seealso \code{\link{Code}}
#' @export
CodeExecutable <- function(
programmingLanguage,
text,
codeDependencies,
codeDependents,
compileDigest,
errors,
executeCount,
executeDigest,
executeDuration,
executeEnded,
executeRequired,
executeStatus,
id,
mediaType,
meta
){
self <- Code(
programmingLanguage = programmingLanguage,
text = text,
id = id,
mediaType = mediaType,
meta = meta
)
self$type <- as_scalar("CodeExecutable")
self[["programmingLanguage"]] <- check_property("CodeExecutable", "programmingLanguage", TRUE, missing(programmingLanguage), "character", programmingLanguage)
self[["codeDependencies"]] <- check_property("CodeExecutable", "codeDependencies", FALSE, missing(codeDependencies), Array(Union(CodeChunk, Parameter)), codeDependencies)
self[["codeDependents"]] <- check_property("CodeExecutable", "codeDependents", FALSE, missing(codeDependents), Array(Union(CodeChunk, CodeExpression)), codeDependents)
self[["compileDigest"]] <- check_property("CodeExecutable", "compileDigest", FALSE, missing(compileDigest), "character", compileDigest)
self[["errors"]] <- check_property("CodeExecutable", "errors", FALSE, missing(errors), Array(CodeError), errors)
self[["executeCount"]] <- check_property("CodeExecutable", "executeCount", FALSE, missing(executeCount), "numeric", executeCount)
self[["executeDigest"]] <- check_property("CodeExecutable", "executeDigest", FALSE, missing(executeDigest), "character", executeDigest)
self[["executeDuration"]] <- check_property("CodeExecutable", "executeDuration", FALSE, missing(executeDuration), "numeric", executeDuration)
self[["executeEnded"]] <- check_property("CodeExecutable", "executeEnded", FALSE, missing(executeEnded), Date, executeEnded)
self[["executeRequired"]] <- check_property("CodeExecutable", "executeRequired", FALSE, missing(executeRequired), Enum("No", "NeverExecuted", "SemanticsChanged", "DependenciesChanged", "DependenciesFailed"), executeRequired)
self[["executeStatus"]] <- check_property("CodeExecutable", "executeStatus", FALSE, missing(executeStatus), Enum("Scheduled", "ScheduledPreviouslyFailed", "Running", "RunningPreviouslyFailed", "Succeeded", "Failed", "Cancelled"), executeStatus)
class(self) <- c(class(self), "CodeExecutable")
self
}
#' A executable chunk of code.
#'
#' @name CodeChunk
#' @param programmingLanguage The programming language of the code. \bold{Required}.
#' @param text The text of the code. \bold{Required}.
#' @param caption A caption for the CodeChunk.
#' @param codeDependencies The upstream dependencies of the code.
#' @param codeDependents The downstream dependents of the code.
#' @param compileDigest A digest of the content, semantics and dependencies of the node.
#' @param errors Errors when compiling (e.g. syntax errors) or executing the chunk.
#' @param executeAuto Under which circumstances the node should be automatically executed.
#' @param executeCount A count of the number of times that the node has been executed.
#' @param executeDigest The `compileDigest` of the node when it was last executed.
#' @param executeDuration Duration in seconds of the last execution of the code.
#' @param executeEnded The date-time that the the last execution of the code ended.
#' @param executePure Whether the code should be treated as side-effect free when executed.
#' @param executeRequired Whether, and why, a node requires execution or re-execution.
#' @param executeStatus Status of the most recent, including any current, execution of the code.
#' @param id The identifier for this item.
#' @param label A short label for the CodeChunk.
#' @param mediaType Media type, typically expressed using a MIME format, of the code.
#' @param meta Metadata associated with this item.
#' @param outputs Outputs from executing the chunk.
#' @return A `list` of class `CodeChunk`
#' @seealso \code{\link{CodeExecutable}}
#' @export
#' @examples
#' CodeChunk(
#' programmingLanguage = "r",
#' text = "plot(1)",
#' label = "Figure 1",
#' id = "fig1",
#' caption = list(
#' Heading(
#' content = list("Figure title"),
#' depth = 2
#' ),
#' Paragraph(
#' content = list(
#' "A paragraph with some",
#' Strong(content = list("strong emphasis")),
#' "in it."
#' )
#' )
#' )
#' )
CodeChunk <- function(
programmingLanguage,
text,
caption,
codeDependencies,
codeDependents,
compileDigest,
errors,
executeAuto,
executeCount,
executeDigest,
executeDuration,
executeEnded,
executePure,
executeRequired,
executeStatus,
id,
label,
mediaType,
meta,
outputs
){
self <- CodeExecutable(
programmingLanguage = programmingLanguage,
text = text,
codeDependencies = codeDependencies,
codeDependents = codeDependents,
compileDigest = compileDigest,
errors = errors,
executeCount = executeCount,
executeDigest = executeDigest,
executeDuration = executeDuration,
executeEnded = executeEnded,
executeRequired = executeRequired,
executeStatus = executeStatus,
id = id,
mediaType = mediaType,
meta = meta
)
self$type <- as_scalar("CodeChunk")
self[["programmingLanguage"]] <- check_property("CodeChunk", "programmingLanguage", TRUE, missing(programmingLanguage), "character", programmingLanguage)
self[["caption"]] <- check_property("CodeChunk", "caption", FALSE, missing(caption), Union(Array(BlockContent), "character"), caption)
self[["executeAuto"]] <- check_property("CodeChunk", "executeAuto", FALSE, missing(executeAuto), Enum("Never", "Needed", "Always"), executeAuto)
self[["executePure"]] <- check_property("CodeChunk", "executePure", FALSE, missing(executePure), "logical", executePure)
self[["label"]] <- check_property("CodeChunk", "label", FALSE, missing(label), "character", label)
self[["outputs"]] <- check_property("CodeChunk", "outputs", FALSE, missing(outputs), Array(Node), outputs)
class(self) <- c(class(self), "CodeChunk")
self
}
#' An executable programming code expression.
#'
#' @name CodeExpression
#' @param programmingLanguage The programming language of the code. \bold{Required}.
#' @param text The text of the code. \bold{Required}.
#' @param codeDependencies The upstream dependencies of the code.
#' @param codeDependents The downstream dependents of the code.
#' @param compileDigest A digest of the content, semantics and dependencies of the node.
#' @param errors Errors when compiling (e.g. syntax errors) or executing the chunk.
#' @param executeCount A count of the number of times that the node has been executed.
#' @param executeDigest The `compileDigest` of the node when it was last executed.
#' @param executeDuration Duration in seconds of the last execution of the code.
#' @param executeEnded The date-time that the the last execution of the code ended.
#' @param executeRequired Whether, and why, a node requires execution or re-execution.
#' @param executeStatus Status of the most recent, including any current, execution of the code.
#' @param id The identifier for this item.
#' @param mediaType Media type, typically expressed using a MIME format, of the code.
#' @param meta Metadata associated with this item.
#' @param output The value of the expression when it was last evaluated.
#' @return A `list` of class `CodeExpression`
#' @seealso \code{\link{CodeExecutable}}
#' @export
CodeExpression <- function(
programmingLanguage,
text,
codeDependencies,
codeDependents,
compileDigest,
errors,
executeCount,
executeDigest,
executeDuration,
executeEnded,
executeRequired,
executeStatus,
id,
mediaType,
meta,
output
){
self <- CodeExecutable(
programmingLanguage = programmingLanguage,
text = text,
codeDependencies = codeDependencies,
codeDependents = codeDependents,
compileDigest = compileDigest,
errors = errors,
executeCount = executeCount,
executeDigest = executeDigest,
executeDuration = executeDuration,
executeEnded = executeEnded,
executeRequired = executeRequired,
executeStatus = executeStatus,
id = id,
mediaType = mediaType,
meta = meta
)
self$type <- as_scalar("CodeExpression")
self[["programmingLanguage"]] <- check_property("CodeExpression", "programmingLanguage", TRUE, missing(programmingLanguage), "character", programmingLanguage)
self[["output"]] <- check_property("CodeExpression", "output", FALSE, missing(output), Node, output)
class(self) <- c(class(self), "CodeExpression")
self
}
#' Inline code.
#'
#' @name CodeFragment
#' @param text The text of the code. \bold{Required}.
#' @param id The identifier for this item.
#' @param mediaType Media type, typically expressed using a MIME format, of the code.
#' @param meta Metadata associated with this item.
#' @param programmingLanguage The programming language of the code.
#' @return A `list` of class `CodeFragment`
#' @seealso \code{\link{Code}}
#' @export
CodeFragment <- function(
text,
id,
mediaType,
meta,
programmingLanguage
){
self <- Code(
text = text,
id = id,
mediaType = mediaType,
meta = meta,
programmingLanguage = programmingLanguage
)
self$type <- as_scalar("CodeFragment")
class(self) <- c(class(self), "CodeFragment")
self
}
#' An error that occurred when parsing, compiling or executing a Code node.
#'
#' @name CodeError
#' @param errorMessage The error message or brief description of the error. \bold{Required}.
#' @param errorType The type of error e.g. "SyntaxError", "ZeroDivisionError".
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @param stackTrace Stack trace leading up to the error.
#' @return A `list` of class `CodeError`
#' @seealso \code{\link{Entity}}
#' @export
CodeError <- function(
errorMessage,
errorType,
id,
meta,
stackTrace
){
self <- Entity(
id = id,
meta = meta
)
self$type <- as_scalar("CodeError")
self[["errorMessage"]] <- check_property("CodeError", "errorMessage", TRUE, missing(errorMessage), "character", errorMessage)
self[["errorType"]] <- check_property("CodeError", "errorType", FALSE, missing(errorType), "character", errorType)
self[["stackTrace"]] <- check_property("CodeError", "stackTrace", FALSE, missing(stackTrace), "character", stackTrace)
class(self) <- c(class(self), "CodeError")
self
}
#' A date encoded as a ISO 8601 string.
#'
#' @name Date
#' @param value The date as an ISO 8601 string. \bold{Required}.
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @return A `list` of class `Date`
#' @seealso \code{\link{Entity}}
#' @export
Date <- function(
value,
id,
meta
){
self <- Entity(
id = id,
meta = meta
)
self$type <- as_scalar("Date")
self[["value"]] <- check_property("Date", "value", TRUE, missing(value), "character", value)
class(self) <- c(class(self), "Date")
self
}
#' A base class for nodes that mark some other inline content in some way (e.g. as being emphasised, or quoted).
#'
#' @name Mark
#' @param content The content that is marked. \bold{Required}.
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @return A `list` of class `Mark`
#' @seealso \code{\link{Entity}}
#' @export
Mark <- function(
content,
id,
meta
){
self <- Entity(
id = id,
meta = meta
)
self$type <- as_scalar("Mark")
self[["content"]] <- check_property("Mark", "content", TRUE, missing(content), Array(InlineContent), content)
class(self) <- c(class(self), "Mark")
self
}
#' Content that is marked for deletion
#'
#' @name Delete
#' @param content The content that is marked. \bold{Required}.
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @return A `list` of class `Delete`
#' @seealso \code{\link{Mark}}
#' @export
Delete <- function(
content,
id,
meta
){
self <- Mark(
content = content,
id = id,
meta = meta
)
self$type <- as_scalar("Delete")
class(self) <- c(class(self), "Delete")
self
}
#' Emphasised content.
#'
#' @name Emphasis
#' @param content The content that is marked. \bold{Required}.
#' @param id The identifier for this item.
#' @param meta Metadata associated with this item.
#' @return A `list` of class `Emphasis`
#' @seealso \code{\link{Mark}}
#' @export
Emphasis <- function(
content,
id,
meta
){
self <- Mark(
content = content,
id = id,
meta = meta
)
self$type <- as_scalar("Emphasis")
class(self) <- c(class(self), "Emphasis")
self
}
#' The most generic type of item.
#'
#' @name Thing
#' @param alternateNames Alternate names (aliases) for the item.
#' @param description A description of the item.
#' @param id The identifier for this item.
#' @param identifiers Any kind of identifier for any kind of Thing.
#' @param images Images of the item.
#' @param meta Metadata associated with this item.
#' @param name The name of the item.
#' @param url The URL of the item.
#' @return A `list` of class `Thing`
#' @seealso \code{\link{Entity}}
#' @export
Thing <- function(
alternateNames,
description,
id,
identifiers,
images,
meta,
name,
url
){
self <- Entity(
id = id,
meta = meta
)
self$type <- as_scalar("Thing")
self[["alternateNames"]] <- check_property("Thing", "alternateNames", FALSE, missing(alternateNames), Array("character"), alternateNames)
self[["description"]] <- check_property("Thing", "description", FALSE, missing(description), Union(Array(BlockContent), Array(InlineContent), "character"), description)
self[["identifiers"]] <- check_property("Thing", "identifiers", FALSE, missing(identifiers), Array(Union(PropertyValue, "character")), identifiers)
self[["images"]] <- check_property("Thing", "images", FALSE, missing(images), Array(Union(ImageObject, "character")), images)
self[["name"]] <- check_property("Thing", "name", FALSE, missing(name), "character", name)
self[["url"]] <- check_property("Thing", "url", FALSE, missing(url), "character", url)
class(self) <- c(class(self), "Thing")
self
}
#' A brand used by an organization or person for labeling a product, product group, or similar.
#'
#' @name Brand
#' @param name The name of the item. \bold{Required}.
#' @param alternateNames Alternate names (aliases) for the item.
#' @param description A description of the item.
#' @param id The identifier for this item.
#' @param identifiers Any kind of identifier for any kind of Thing.
#' @param images Images of the item.
#' @param logo A logo associated with the brand.
#' @param meta Metadata associated with this item.
#' @param reviews Reviews of the brand.
#' @param url The URL of the item.
#' @return A `list` of class `Brand`
#' @seealso \code{\link{Thing}}
#' @export
Brand <- function(
name,
alternateNames,
description,
id,
identifiers,
images,
logo,
meta,
reviews,
url
){
self <- Thing(
name = name,
alternateNames = alternateNames,
description = description,
id = id,
identifiers = identifiers,
images = images,
meta = meta,
url = url
)
self$type <- as_scalar("Brand")
self[["name"]] <- check_property("Brand", "name", TRUE, missing(name), "character", name)
self[["logo"]] <- check_property("Brand", "logo", FALSE, missing(logo), Union(ImageObject, "character"), logo)
self[["reviews"]] <- check_property("Brand", "reviews", FALSE, missing(reviews), Array("character"), reviews)
class(self) <- c(class(self), "Brand")
self
}
#' A contact point, usually within an organization.
#'
#' @name ContactPoint
#' @param alternateNames Alternate names (aliases) for the item.
#' @param availableLanguages Languages (human not programming) in which it is possible to communicate with the organization/department etc.
#' @param description A description of the item.
#' @param emails Email address for correspondence.
#' @param id The identifier for this item.
#' @param identifiers Any kind of identifier for any kind of Thing.
#' @param images Images of the item.
#' @param meta Metadata associated with this item.
#' @param name The name of the item.
#' @param telephoneNumbers Telephone numbers for the contact point.
#' @param url The URL of the item.
#' @return A `list` of class `ContactPoint`
#' @seealso \code{\link{Thing}}
#' @export
ContactPoint <- function(
alternateNames,
availableLanguages,
description,
emails,
id,
identifiers,
images,
meta,
name,
telephoneNumbers,
url
){
self <- Thing(
alternateNames = alternateNames,
description = description,
id = id,
identifiers = identifiers,
images = images,
meta = meta,
name = name,
url = url
)
self$type <- as_scalar("ContactPoint")
self[["availableLanguages"]] <- check_property("ContactPoint", "availableLanguages", FALSE, missing(availableLanguages), Array("character"), availableLanguages)
self[["emails"]] <- check_property("ContactPoint", "emails", FALSE, missing(emails), Array("character"), emails)
self[["telephoneNumbers"]] <- check_property("ContactPoint", "telephoneNumbers", FALSE, missing(telephoneNumbers), Array("character"), telephoneNumbers)
class(self) <- c(class(self), "ContactPoint")
self
}
#' A creative work, including books, movies, photographs, software programs, etc.
#'
#' @name CreativeWork
#' @param about The subject matter of the content.
#' @param alternateNames Alternate names (aliases) for the item.
#' @param authors The authors of this creative work.
#' @param comments Comments about this creative work.
#' @param content The structured content of this creative work c.f. property `text`.
#' @param dateAccepted Date/time of acceptance.
#' @param dateCreated Date/time of creation.
#' @param dateModified Date/time of most recent modification.
#' @param datePublished Date of first publication.
#' @param dateReceived Date/time that work was received.
#' @param description A description of the item.
#' @param editors People who edited the `CreativeWork`.
#' @param fundedBy Grants that funded the `CreativeWork`; reverse of `fundedItems`.
#' @param funders People or organizations that funded the `CreativeWork`.
#' @param genre Genre of the creative work, broadcast channel or group.
#' @param id The identifier for this item.
#' @param identifiers Any kind of identifier for any kind of Thing.
#' @param images Images of the item.
#' @param isPartOf An item or other CreativeWork that this CreativeWork is a part of.
#' @param keywords Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.
#' @param licenses License documents that applies to this content, typically indicated by URL.
#' @param maintainers The people or organizations who maintain this CreativeWork.
#' @param meta Metadata associated with this item.
#' @param name The name of the item.
#' @param parts Elements of the collection which can be a variety of different elements, such as Articles, Datatables, Tables and more.
#' @param publisher A publisher of the CreativeWork.
#' @param references References to other creative works, such as another publication, web page, scholarly article, etc.
#' @param text The textual content of this creative work.
#' @param title The title of the creative work.
#' @param url The URL of the item.
#' @param version The version of the creative work.
#' @return A `list` of class `CreativeWork`
#' @seealso \code{\link{Thing}}
#' @export
CreativeWork <- function(
about,
alternateNames,
authors,
comments,
content,
dateAccepted,
dateCreated,
dateModified,
datePublished,
dateReceived,
description,
editors,
fundedBy,
funders,
genre,
id,
identifiers,
images,
isPartOf,
keywords,
licenses,
maintainers,
meta,
name,
parts,
publisher,
references,
text,
title,
url,
version
){
self <- Thing(
alternateNames = alternateNames,
description = description,
id = id,
identifiers = identifiers,
images = images,
meta = meta,
name = name,
url = url
)
self$type <- as_scalar("CreativeWork")
self[["about"]] <- check_property("CreativeWork", "about", FALSE, missing(about), Array(ThingTypes), about)
self[["authors"]] <- check_property("CreativeWork", "authors", FALSE, missing(authors), Array(Union(Person, Organization)), authors)
self[["comments"]] <- check_property("CreativeWork", "comments", FALSE, missing(comments), Array(Comment), comments)
self[["content"]] <- check_property("CreativeWork", "content", FALSE, missing(content), Union(Array("Node"), "character"), content)
self[["dateAccepted"]] <- check_property("CreativeWork", "dateAccepted", FALSE, missing(dateAccepted), Date, dateAccepted)
self[["dateCreated"]] <- check_property("CreativeWork", "dateCreated", FALSE, missing(dateCreated), Date, dateCreated)
self[["dateModified"]] <- check_property("CreativeWork", "dateModified", FALSE, missing(dateModified), Date, dateModified)
self[["datePublished"]] <- check_property("CreativeWork", "datePublished", FALSE, missing(datePublished), Date, datePublished)
self[["dateReceived"]] <- check_property("CreativeWork", "dateReceived", FALSE, missing(dateReceived), Date, dateReceived)
self[["editors"]] <- check_property("CreativeWork", "editors", FALSE, missing(editors), Array(Person), editors)
self[["fundedBy"]] <- check_property("CreativeWork", "fundedBy", FALSE, missing(fundedBy), Array(Union(Grant, MonetaryGrant)), fundedBy)
self[["funders"]] <- check_property("CreativeWork", "funders", FALSE, missing(funders), Array(Union(Person, Organization)), funders)
self[["genre"]] <- check_property("CreativeWork", "genre", FALSE, missing(genre), Array("character"), genre)
self[["isPartOf"]] <- check_property("CreativeWork", "isPartOf", FALSE, missing(isPartOf), CreativeWorkTypes, isPartOf)
self[["keywords"]] <- check_property("CreativeWork", "keywords", FALSE, missing(keywords), Array("character"), keywords)
self[["licenses"]] <- check_property("CreativeWork", "licenses", FALSE, missing(licenses), Array(Union(CreativeWorkTypes, "character")), licenses)
self[["maintainers"]] <- check_property("CreativeWork", "maintainers", FALSE, missing(maintainers), Array(Union(Person, Organization)), maintainers)
self[["parts"]] <- check_property("CreativeWork", "parts", FALSE, missing(parts), Array(CreativeWorkTypes), parts)
self[["publisher"]] <- check_property("CreativeWork", "publisher", FALSE, missing(publisher), Union(Person, Organization), publisher)
self[["references"]] <- check_property("CreativeWork", "references", FALSE, missing(references), Array(Union(CreativeWorkTypes, "character")), references)
self[["text"]] <- check_property("CreativeWork", "text", FALSE, missing(text), "character", text)
self[["title"]] <- check_property("CreativeWork", "title", FALSE, missing(title), Union(Array(InlineContent), "character"), title)
self[["version"]] <- check_property("CreativeWork", "version", FALSE, missing(version), Union("character", "numeric"), version)
class(self) <- c(class(self), "CreativeWork")
self
}
#' An article, including news and scholarly articles.
#'
#' @name Article
#' @param about The subject matter of the content.
#' @param alternateNames Alternate names (aliases) for the item.
#' @param authors The authors of this creative work.
#' @param comments Comments about this creative work.
#' @param content The structured content of this article.
#' @param dateAccepted Date/time of acceptance.
#' @param dateCreated Date/time of creation.
#' @param dateModified Date/time of most recent modification.
#' @param datePublished Date of first publication.
#' @param dateReceived Date/time that work was received.
#' @param description A description of the item.
#' @param editors People who edited the `CreativeWork`.
#' @param fundedBy Grants that funded the `CreativeWork`; reverse of `fundedItems`.
#' @param funders People or organizations that funded the `CreativeWork`.
#' @param genre Genre of the creative work, broadcast channel or group.
#' @param id The identifier for this item.
#' @param identifiers Any kind of identifier for any kind of Thing.
#' @param images Images of the item.
#' @param isPartOf An item or other CreativeWork that this CreativeWork is a part of.
#' @param keywords Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.
#' @param licenses License documents that applies to this content, typically indicated by URL.
#' @param maintainers The people or organizations who maintain this CreativeWork.
#' @param meta Metadata associated with this item.
#' @param name The name of the item.
#' @param pageEnd The page on which the article ends; for example "138" or "xvi".
#' @param pageStart The page on which the article starts; for example "135" or "xiii".
#' @param pagination Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55".
#' @param parts Elements of the collection which can be a variety of different elements, such as Articles, Datatables, Tables and more.
#' @param publisher A publisher of the CreativeWork.
#' @param references References to other creative works, such as another publication, web page, scholarly article, etc.
#' @param text The textual content of this creative work.
#' @param title The title of the creative work.
#' @param url The URL of the item.
#' @param version The version of the creative work.
#' @return A `list` of class `Article`
#' @seealso \code{\link{CreativeWork}}
#' @export
Article <- function(
about,
alternateNames,
authors,
comments,
content,
dateAccepted,
dateCreated,
dateModified,
datePublished,
dateReceived,
description,
editors,
fundedBy,
funders,
genre,
id,
identifiers,
images,
isPartOf,
keywords,
licenses,
maintainers,
meta,
name,
pageEnd,
pageStart,
pagination,
parts,
publisher,
references,
text,
title,
url,
version
){
self <- CreativeWork(
about = about,
alternateNames = alternateNames,
authors = authors,
comments = comments,
dateAccepted = dateAccepted,
dateCreated = dateCreated,
dateModified = dateModified,
datePublished = datePublished,
dateReceived = dateReceived,
description = description,
editors = editors,
fundedBy = fundedBy,
funders = funders,
genre = genre,
id = id,
identifiers = identifiers,
images = images,
isPartOf = isPartOf,
keywords = keywords,
licenses = licenses,
maintainers = maintainers,
meta = meta,
name = name,
parts = parts,
publisher = publisher,
references = references,
text = text,
title = title,
url = url,
version = version
)
self$type <- as_scalar("Article")
self[["content"]] <- check_property("Article", "content", FALSE, missing(content), Array(BlockContent), content)
self[["pageEnd"]] <- check_property("Article", "pageEnd", FALSE, missing(pageEnd), Union("numeric", "character"), pageEnd)
self[["pageStart"]] <- check_property("Article", "pageStart", FALSE, missing(pageStart), Union("numeric", "character"), pageStart)
self[["pagination"]] <- check_property("Article", "pagination", FALSE, missing(pagination), "character", pagination)
class(self) <- c(class(self), "Article")
self
}
#' A claim represents specific reviewable facts or statements.
#'
#' @name Claim
#' @param content Content of the claim, usually a single paragraph. \bold{Required}.
#' @param about The subject matter of the content.
#' @param alternateNames Alternate names (aliases) for the item.
#' @param authors The authors of this creative work.
#' @param claimType Kind of the claim.
#' @param comments Comments about this creative work.
#' @param dateAccepted Date/time of acceptance.
#' @param dateCreated Date/time of creation.
#' @param dateModified Date/time of most recent modification.
#' @param datePublished Date of first publication.
#' @param dateReceived Date/time that work was received.
#' @param description A description of the item.
#' @param editors People who edited the `CreativeWork`.
#' @param fundedBy Grants that funded the `CreativeWork`; reverse of `fundedItems`.
#' @param funders People or organizations that funded the `CreativeWork`.
#' @param genre Genre of the creative work, broadcast channel or group.
#' @param id The identifier for this item.
#' @param identifiers Any kind of identifier for any kind of Thing.
#' @param images Images of the item.
#' @param isPartOf An item or other CreativeWork that this CreativeWork is a part of.
#' @param keywords Keywords or tags used to describe this content. Multiple entries in a keywords list are typically delimited by commas.
#' @param label A short label for the claim.
#' @param licenses License documents that applies to this content, typically indicated by URL.
#' @param maintainers The people or organizations who maintain this CreativeWork.
#' @param meta Metadata associated with this item.
#' @param name The name of the item.
#' @param parts Elements of the collection which can be a variety of different elements, such as Articles, Datatables, Tables and more.
#' @param publisher A publisher of the CreativeWork.
#' @param references References to other creative works, such as another publication, web page, scholarly article, etc.
#' @param text The textual content of this creative work.
#' @param title The title of the creative work.
#' @param url The URL of the item.
#' @param version The version of the creative work.
#' @return A `list` of class `Claim`
#' @seealso \code{\link{CreativeWork}}
#' @export
Claim <- function(
content,
about,
alternateNames,
authors,
claimType,
comments,
dateAccepted,
dateCreated,
dateModified,
datePublished,
dateReceived,
description,
editors,
fundedBy,
funders,
genre,
id,
identifiers,
images,
isPartOf,
keywords,
label,
licenses,
maintainers,
meta,
name,
parts,
publisher,
references,
text,
title,
url,
version
){
self <- CreativeWork(
about = about,
alternateNames = alternateNames,
authors = authors,
comments = comments,
dateAccepted = dateAccepted,
dateCreated = dateCreated,
dateModified = dateModified,
datePublished = datePublished,
dateReceived = dateReceived,