Skip to content

Commit ea0abab

Browse files
committed
add ResourceType enum and assocaite with Resource model
1 parent e6cc5a0 commit ea0abab

File tree

1 file changed

+106
-3
lines changed

1 file changed

+106
-3
lines changed

dandischema/models.py

Lines changed: 106 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,103 @@ class RoleType(Enum):
336336
Other = "dcite:Other"
337337

338338

339+
class ResourceType(Enum):
340+
"""An enumeration of resource types"""
341+
342+
#: Audiovisual: A series of visual representations imparting an impression of motion when shown in succession. May
343+
# or may not include sound.
344+
Audiovisual = "dcite:Audiovisual"
345+
346+
#: Book: A medium for recording information in the form of writing or images, typically composed of many pages bound
347+
# together and protected by a cover.
348+
Book = "dcite:Book"
349+
350+
#: BookChapter: One of the main divisions of a book.
351+
BookChapter = "dcite:BookChapter"
352+
353+
#: Collection: An aggregation of resources, which may encompass collections of one resourceType as well as those of
354+
# mixed types. A collection is described as a group; its parts may also be separately described.
355+
Collection = "dcite:Collection"
356+
357+
#: ComputationalNotebook: A virtual notebook environment used for literate programming.
358+
ComputationalNotebook = "dcite:ComputationalNotebook"
359+
360+
#: ConferencePaper: Article that is written with the goal of being accepted to a conference.
361+
ConferencePaper = "dcite:ConferencePaper"
362+
363+
#: ConferenceProceeding: Collection of academic papers published in the context of an academic conference.
364+
ConferenceProceeding = "dcite:ConferenceProceeding"
365+
366+
#: DataPaper: A factual and objective publication with a focused intent to identify and describe specific data, sets of data, or data collections to facilitate discoverability.
367+
DataPaper = "dcite:DataPaper"
368+
369+
#: Dataset: Data encoded in a defined structure.
370+
Dataset = "dcite:Dataset"
371+
372+
#: Dissertation: A written essay, treatise, or thesis, especially one written by a candidate for the degree of Doctor of Philosophy.
373+
Dissertation = "dcite:Dissertation"
374+
375+
#: Event: A non-persistent, time-based occurrence.
376+
Event = "dcite:Event"
377+
378+
#: Image: A visual representation other than text.
379+
Image = "dcite:Image"
380+
381+
#: Instrument: A device, tool or apparatus used to obtain, measure and/or analyze data.
382+
Instrument = "dcite:Instrument"
383+
384+
#: InteractiveResource: A resource requiring interaction from the user to be understood, executed, or experienced.
385+
InteractiveResource = "dcite:InteractiveResource"
386+
387+
#: Journal: A scholarly publication consisting of articles that is published regularly throughout the year.
388+
Journal = "dcite:Journal"
389+
390+
#: JournalArticle: A written composition on a topic of interest, which forms a separate part of a journal.
391+
JournalArticle = "dcite:JournalArticle"
392+
393+
#: Model: An abstract, conceptual, graphical, mathematical or visualization model that represents empirical objects, phenomena, or physical processes.
394+
Model = "dcite:Model"
395+
396+
#: OutputManagementPlan: A formal document that outlines how research outputs are to be handled both during a research project and after the project is completed.
397+
OutputManagementPlan = "dcite:OutputManagementPlan"
398+
399+
#: PeerReview: Evaluation of scientific, academic, or professional work by others working in the same field.
400+
PeerReview = "dcite:PeerReview"
401+
402+
#: PhysicalObject: A physical object or substance.
403+
PhysicalObject = "dcite:PhysicalObject"
404+
405+
#: Preprint: A version of a scholarly or scientific paper that precedes formal peer review and publication in a peer-reviewed scholarly or scientific journal.
406+
Preprint = "dcite:Preprint"
407+
408+
#: Report: A document that presents information in an organized format for a specific audience and purpose.
409+
Report = "dcite:Report"
410+
411+
#: Service: An organized system of apparatus, appliances, staff, etc., for supplying some function(s) required by end users.
412+
Service = "dcite:Service"
413+
414+
#: Software: A computer program other than a computational notebook, in either source code (text) or compiled form. Use this type for general software components supporting scholarly research. Use the “ComputationalNotebook” value for virtual notebooks.
415+
Software = "dcite:Software"
416+
417+
#: Sound: A resource primarily intended to be heard.
418+
Sound = "dcite:Sound"
419+
420+
#: Standard: Something established by authority, custom, or general consent as a model, example, or point of reference.
421+
Standard = "dcite:Standard"
422+
423+
#: StudyRegistration: A detailed, time-stamped description of a research plan, often openly shared in a registry or published in a journal before the study is conducted to lend accountability and transparency in the hypothesis generating and testing process.
424+
StudyRegistration = "dcite:StudyRegistration"
425+
426+
#: Text: A resource consisting primarily of words for reading that is not covered by any other textual resource type in this list.
427+
Text = "dcite:Text"
428+
429+
#: Workflow: A structured series of steps which can be executed to produce a final outcome, allowing users a means to specify and enact their work in a more reproducible manner.
430+
Workflow = "dcite:Workflow"
431+
432+
#: Other: A resource that does not fit into any of the other categories.
433+
Other = "dcite:Other"
434+
435+
339436
class AgeReferenceType(Enum):
340437
"""An enumeration of age reference"""
341438

@@ -888,6 +985,12 @@ class Resource(DandiBaseModel):
888985
"This relation should satisfy: dandiset <relation> resource.",
889986
json_schema_extra={"nskey": "dandi"},
890987
)
988+
resourceType: Optional[ResourceType] = Field(
989+
title="Resource type",
990+
description="The type of resource.",
991+
json_schema_extra={"nskey": "dandi"},
992+
)
993+
891994
schemaKey: Literal["Resource"] = Field(
892995
"Resource", validate_default=True, json_schema_extra={"readOnly": True}
893996
)
@@ -1045,9 +1148,9 @@ class Activity(DandiBaseModel):
10451148

10461149
# isPartOf: Optional["Activity"] = Field(None, json_schema_extra={"nskey": "schema"})
10471150
# hasPart: Optional["Activity"] = Field(None, json_schema_extra={"nskey": "schema"})
1048-
wasAssociatedWith: Optional[List[Union[Person, Organization, Software, Agent]]] = (
1049-
Field(None, json_schema_extra={"nskey": "prov"})
1050-
)
1151+
wasAssociatedWith: Optional[
1152+
List[Union[Person, Organization, Software, Agent]]
1153+
] = Field(None, json_schema_extra={"nskey": "prov"})
10511154
used: Optional[List[Equipment]] = Field(
10521155
None,
10531156
description="A listing of equipment used for the activity.",

0 commit comments

Comments
 (0)