Skip to content

Reference

Bases: UUIDBaseNode

Definition

The Reference node contains the metadata for a literature publication, book, or anything external to CRIPT. The reference node does NOT contain the base attributes.

The reference node is always used inside the citation sub-object to enable users to specify the context of the reference.

Attributes

attribute type example description required vocab
type str journal_article type of literature True True
title str 'Living' Polymers title of publication True
author list[str] Michael Szwarc list of authors
journal str Nature journal of the publication
publisher str Springer publisher of publication
year int 1956 year of publication
volume int 178 volume of publication
issue int 0 issue of publication
pages list[int] [1168, 1169] page range of publication
doi str 10.1038/1781168a0 DOI: digital object identifier Conditionally
issn str 1476-4687 ISSN: international standard serial number Conditionally
arxiv_id str 1501 arXiv identifier
pmid int ######## PMID: PubMed ID
website str https://www.nature.com/artic les/1781168a0 website where the publication can be accessed

Can be added to

Available Subobjects

  • None

Reference will always be public

Reference node is meant to always be public and static to allow globally link data to the reference

JSON Representation

{
   "node":["Reference"],
   "uid":"_:c681a947-0554-4acd-a01c-06ad76e34b87",
   "uuid":"c681a947-0554-4acd-a01c-06ad76e34b87",
   "author":["Ludwig Schneider","Marcus Müller"],
   "doi":"10.1016/j.cpc.2018.08.011",
   "issn":"0010-4655",
   "journal":"Computer Physics Communications",
   "pages":[463,476],
   "publisher":"Elsevier",
   "title":"Multi-architecture Monte-Carlo (MC) simulation of soft coarse-grained polymeric materials: SOft coarse grained Monte-Carlo Acceleration (SOMA)",
   "type":"journal_article",
   "website":"https://www.sciencedirect.com/science/article/pii/S0010465518303072",
   "year":2019
}
Source code in src/cript/nodes/primary_nodes/reference.py
  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
class Reference(UUIDBaseNode):
    """
    ## Definition

    The
    [Reference node](https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf#page=15)
    contains the metadata for a literature publication, book, or anything external to CRIPT.
    The reference node does NOT contain the base attributes.

    The reference node is always used inside the citation
    sub-object to enable users to specify the context of the reference.

    ## Attributes
    | attribute | type      | example                                    | description                                   | required      | vocab |
    |-----------|-----------|--------------------------------------------|-----------------------------------------------|---------------|-------|
    | type      | str       | journal_article                            | type of literature                            | True          | True  |
    | title     | str       | 'Living' Polymers                          | title of publication                          | True          |       |
    | author    | list[str] | Michael Szwarc                             | list of authors                               |               |       |
    | journal   | str       | Nature                                     | journal of the publication                    |               |       |
    | publisher | str       | Springer                                   | publisher of publication                      |               |       |
    | year      | int       | 1956                                       | year of publication                           |               |       |
    | volume    | int       | 178                                        | volume of publication                         |               |       |
    | issue     | int       | 0                                          | issue of publication                          |               |       |
    | pages     | list[int] | [1168, 1169]                               | page range of publication                     |               |       |
    | doi       | str       | 10.1038/1781168a0                          | DOI: digital object identifier                | Conditionally |       |
    | issn      | str       | 1476-4687                                  | ISSN: international standard serial number    | Conditionally |       |
    | arxiv_id  | str       | 1501                                       | arXiv identifier                              |               |       |
    | pmid      | int       | ########                                   | PMID: PubMed ID                               |               |       |
    | website   | str       | https://www.nature.com/artic les/1781168a0 | website where the publication can be accessed |               |       |


    ## Can be added to
    * [Citation](../../subobjects/citation)

    ## Available Subobjects
    * None

    !!! warning "Reference will always be public"
        Reference node is meant to always be public and static to allow globally link data to the reference

    ## JSON Representation
    ```json
    {
       "node":["Reference"],
       "uid":"_:c681a947-0554-4acd-a01c-06ad76e34b87",
       "uuid":"c681a947-0554-4acd-a01c-06ad76e34b87",
       "author":["Ludwig Schneider","Marcus Müller"],
       "doi":"10.1016/j.cpc.2018.08.011",
       "issn":"0010-4655",
       "journal":"Computer Physics Communications",
       "pages":[463,476],
       "publisher":"Elsevier",
       "title":"Multi-architecture Monte-Carlo (MC) simulation of soft coarse-grained polymeric materials: SOft coarse grained Monte-Carlo Acceleration (SOMA)",
       "type":"journal_article",
       "website":"https://www.sciencedirect.com/science/article/pii/S0010465518303072",
       "year":2019
    }
    ```
    """

    @dataclass(frozen=True)
    class JsonAttributes(UUIDBaseNode.JsonAttributes):
        """
        all reference nodes attributes

        all int types are also None type in case they are not present it should be properly shown as None
        instead of a placeholder number such as 0 or -1
        """

        type: str = ""
        title: str = ""
        author: List[str] = field(default_factory=list)
        journal: str = ""
        publisher: str = ""
        year: Optional[int] = None
        volume: Optional[int] = None
        issue: Optional[int] = None
        pages: List[int] = field(default_factory=list)
        doi: str = ""
        issn: str = ""
        arxiv_id: str = ""
        pmid: Optional[int] = None
        website: str = ""

    _json_attrs: JsonAttributes = JsonAttributes()

    @beartype
    def __init__(
        self,
        type: str,
        title: str,
        author: Optional[List[str]] = None,
        journal: str = "",
        publisher: str = "",
        year: Optional[int] = None,
        volume: Optional[int] = None,
        issue: Optional[int] = None,
        pages: Optional[List[int]] = None,
        doi: str = "",
        issn: str = "",
        arxiv_id: str = "",
        pmid: Optional[int] = None,
        website: str = "",
        **kwargs,
    ):
        """
        create a reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")

        Parameters
        ----------
        type: str
            type of literature.
            The [reference type](https://app.criptapp.org/vocab/reference_type/)
            must come from CRIPT controlled vocabulary
        title: str
            title of publication
        author: List[str] default=""
            list of authors
        journal: str default=""
            journal of publication
        publisher: str default=""
            publisher of publication
        year: int default=None
            year of publication
        volume: int default=None
            volume of publication
        issue: int default=None
            issue of publication
        pages: List[int] default=None
            page range of publication
        doi: str default=""
            DOI: digital object identifier
        issn: str default=""
            ISSN: international standard serial number
        arxiv_id: str default=""
            arXiv identifier
        pmid: int default=None
            PMID: PubMed ID
        website: str default=""
            website where the publication can be accessed

        Returns
        -------
        None
            Instantiate a reference node
        """
        if author is None:
            author = []

        if pages is None:
            pages = []

        super().__init__(**kwargs)

        new_attrs = replace(self._json_attrs, type=type, title=title, author=author, journal=journal, publisher=publisher, year=year, volume=volume, issue=issue, pages=pages, doi=doi, issn=issn, arxiv_id=arxiv_id, pmid=pmid, website=website)

        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def type(self) -> str:
        """
        Type of reference.

        The [reference type](https://app.criptapp.org/vocab/reference_type)
        must come from the CRIPT controlled vocabulary

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.type = "web_site"

        Returns
        -------
        str
            reference type
        """
        return self._json_attrs.type

    @type.setter
    @beartype
    def type(self, new_reference_type: str) -> None:
        """
        set the reference type attribute

        reference type must come from the CRIPT controlled vocabulary

        Parameters
        ----------
        new_reference_type: str

        Returns
        -------
        None
        """
        # TODO validate the reference type with CRIPT controlled vocabulary
        new_attrs = replace(self._json_attrs, type=new_reference_type)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def title(self) -> str:
        """
        title of publication

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.title = "my new title"

        Returns
        -------
        str
            title of publication
        """
        return self._json_attrs.title

    @title.setter
    @beartype
    def title(self, new_title: str) -> None:
        """
        set the title for the reference node

        Parameters
        ----------
        new_title: str

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, title=new_title)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def author(self) -> List[str]:
        """
        List of authors for this reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.author += ["Navid Hariri"]

        Returns
        -------
        List[str]
            list of authors
        """
        return self._json_attrs.author.copy()

    @author.setter
    @beartype
    def author(self, new_author: List[str]) -> None:
        """
        set the list of authors for the reference node

        Parameters
        ----------
        new_author: List[str]

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, author=new_author)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def journal(self) -> str:
        """
        journal of publication

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.journal = "my new journal"

        Returns
        -------
        str
            journal of publication
        """
        return self._json_attrs.journal

    @journal.setter
    @beartype
    def journal(self, new_journal: str) -> None:
        """
        set the journal attribute for this reference node

        Parameters
        ----------
        new_journal: str

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, journal=new_journal)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def publisher(self) -> str:
        """
        publisher for this reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.publisher = "my new publisher"

        Returns
        -------
        str
            publisher of this publication
        """
        return self._json_attrs.publisher

    @publisher.setter
    @beartype
    def publisher(self, new_publisher: str) -> None:
        """
        set the publisher for this reference node

        Parameters
        ----------
        new_publisher: str

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, publisher=new_publisher)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def year(self) -> Union[int, None]:
        """
        year for the scholarly work

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.year = 2023

        Returns
        -------
        int
        """
        return self._json_attrs.year

    @year.setter
    @beartype
    def year(self, new_year: Union[int, None]) -> None:
        """
        set the year for the scholarly work within the reference node

        Parameters
        ----------
        new_year: int


        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, year=new_year)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def volume(self) -> Union[int, None]:
        """
        Volume of the scholarly work from the reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.volume = 1

        Returns
        -------
        int
            volume number of the publishing
        """
        return self._json_attrs.volume

    @volume.setter
    @beartype
    def volume(self, new_volume: Union[int, None]) -> None:
        """
        set the volume of the scholarly work for this reference node

        Parameters
        ----------
        new_volume: int

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, volume=new_volume)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def issue(self) -> Union[int, None]:
        """
        issue of the scholarly work for the reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.issue = 2

        Returns
        -------
        None
        """
        return self._json_attrs.issue

    @issue.setter
    @beartype
    def issue(self, new_issue: Union[int, None]) -> None:
        """
        set the issue of the scholarly work

        Parameters
        ----------
        new_issue: int

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, issue=new_issue)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def pages(self) -> List[int]:
        """
        pages of the scholarly work used in the reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.pages = [123, 456]

        Returns
        -------
        int
        """
        return self._json_attrs.pages.copy()

    @pages.setter
    @beartype
    def pages(self, new_pages_list: List[int]) -> None:
        """
        set the list of pages of the scholarly work for this reference node

        Parameters
        ----------
        new_pages_list: List[int]

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, pages=new_pages_list)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def doi(self) -> str:
        """
        get the digital object identifier (DOI) for this reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.doi = "100.1038/1781168a0"

        Returns
        -------
        str
            digital object identifier (DOI) for this reference node
        """
        return self._json_attrs.doi

    @doi.setter
    @beartype
    def doi(self, new_doi: str) -> None:
        """
        set the digital object identifier (DOI) for the scholarly work for this reference node

        Parameters
        ----------
        new_doi: str

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.doi = "100.1038/1781168a0"

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, doi=new_doi)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def issn(self) -> str:
        """
        The international standard serial number (ISSN) for this reference node

        Examples
        ---------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.issn = "1456-4687"

        Returns
        -------
        str
            ISSN for this reference node
        """
        return self._json_attrs.issn

    @issn.setter
    @beartype
    def issn(self, new_issn: str) -> None:
        """
        set the international standard serial number (ISSN) for the scholarly work for this reference node

        Parameters
        ----------
        new_issn: str

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, issn=new_issn)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def arxiv_id(self) -> str:
        """
        The arXiv identifier for the scholarly work for this reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.arxiv_id = "1501"

        Returns
        -------
        str
            arXiv identifier for the scholarly work for this publishing
        """
        return self._json_attrs.arxiv_id

    @arxiv_id.setter
    @beartype
    def arxiv_id(self, new_arxiv_id: str) -> None:
        """
        set the arXiv identifier for the scholarly work for this reference node

        Parameters
        ----------
        new_arxiv_id: str

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, arxiv_id=new_arxiv_id)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def pmid(self) -> Union[int, None]:
        """
        The PubMed ID (PMID) for this reference node

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.pmid = 12345678

        Returns
        -------
        int
            the PubMedID of this publishing
        """
        return self._json_attrs.pmid

    @pmid.setter
    @beartype
    def pmid(self, new_pmid: Union[int, None]) -> None:
        """

        Parameters
        ----------
        new_pmid

        Returns
        -------

        """
        # TODO can possibly add validations, possibly in forms of length checking
        #  to be sure its the correct length
        new_attrs = replace(self._json_attrs, pmid=new_pmid)
        self._update_json_attrs_if_valid(new_attrs)

    @property
    @beartype
    def website(self) -> str:
        """
        The website URL for the scholarly work

        Examples
        --------
        >>> import cript
        >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
        >>> my_reference.website = "https://criptapp.org"

        Returns
        -------
        str
            the website URL of this publishing
        """
        return self._json_attrs.website

    @website.setter
    @beartype
    def website(self, new_website: str) -> None:
        """
        set the website URL for the scholarly work

        Parameters
        ----------
        new_website: str

        Returns
        -------
        None
        """
        new_attrs = replace(self._json_attrs, website=new_website)
        self._update_json_attrs_if_valid(new_attrs)

arxiv_id: str property writable

The arXiv identifier for the scholarly work for this reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.arxiv_id = "1501"

Returns:

Type Description
str

arXiv identifier for the scholarly work for this publishing

author: List[str] property writable

List of authors for this reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.author += ["Navid Hariri"]

Returns:

Type Description
List[str]

list of authors

doi: str property writable

get the digital object identifier (DOI) for this reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.doi = "100.1038/1781168a0"

Returns:

Type Description
str

digital object identifier (DOI) for this reference node

issn: str property writable

The international standard serial number (ISSN) for this reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.issn = "1456-4687"

Returns:

Type Description
str

ISSN for this reference node

issue: Union[int, None] property writable

issue of the scholarly work for the reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.issue = 2

Returns:

Type Description
None

journal: str property writable

journal of publication

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.journal = "my new journal"

Returns:

Type Description
str

journal of publication

pages: List[int] property writable

pages of the scholarly work used in the reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.pages = [123, 456]

Returns:

Type Description
int

pmid: Union[int, None] property writable

The PubMed ID (PMID) for this reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.pmid = 12345678

Returns:

Type Description
int

the PubMedID of this publishing

publisher: str property writable

publisher for this reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.publisher = "my new publisher"

Returns:

Type Description
str

publisher of this publication

title: str property writable

title of publication

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.title = "my new title"

Returns:

Type Description
str

title of publication

type: str property writable

Type of reference.

The reference type must come from the CRIPT controlled vocabulary

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.type = "web_site"

Returns:

Type Description
str

reference type

volume: Union[int, None] property writable

Volume of the scholarly work from the reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.volume = 1

Returns:

Type Description
int

volume number of the publishing

website: str property writable

The website URL for the scholarly work

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.website = "https://criptapp.org"

Returns:

Type Description
str

the website URL of this publishing

year: Union[int, None] property writable

year for the scholarly work

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")
>>> my_reference.year = 2023

Returns:

Type Description
int

JsonAttributes dataclass

Bases: JsonAttributes

all reference nodes attributes

all int types are also None type in case they are not present it should be properly shown as None instead of a placeholder number such as 0 or -1

Source code in src/cript/nodes/primary_nodes/reference.py
@dataclass(frozen=True)
class JsonAttributes(UUIDBaseNode.JsonAttributes):
    """
    all reference nodes attributes

    all int types are also None type in case they are not present it should be properly shown as None
    instead of a placeholder number such as 0 or -1
    """

    type: str = ""
    title: str = ""
    author: List[str] = field(default_factory=list)
    journal: str = ""
    publisher: str = ""
    year: Optional[int] = None
    volume: Optional[int] = None
    issue: Optional[int] = None
    pages: List[int] = field(default_factory=list)
    doi: str = ""
    issn: str = ""
    arxiv_id: str = ""
    pmid: Optional[int] = None
    website: str = ""

__init__(type, title, author=None, journal='', publisher='', year=None, volume=None, issue=None, pages=None, doi='', issn='', arxiv_id='', pmid=None, website='', **kwargs)

create a reference node

Examples:

>>> import cript
>>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")

Parameters:

Name Type Description Default
type str

type of literature. The reference type must come from CRIPT controlled vocabulary

required
title str

title of publication

required
author Optional[List[str]]

list of authors

None
journal str

journal of publication

''
publisher str

publisher of publication

''
year Optional[int]

year of publication

None
volume Optional[int]

volume of publication

None
issue Optional[int]

issue of publication

None
pages Optional[List[int]]

page range of publication

None
doi str

DOI: digital object identifier

''
issn str

ISSN: international standard serial number

''
arxiv_id str

arXiv identifier

''
pmid Optional[int]

PMID: PubMed ID

None
website str

website where the publication can be accessed

''

Returns:

Type Description
None

Instantiate a reference node

Source code in src/cript/nodes/primary_nodes/reference.py
@beartype
def __init__(
    self,
    type: str,
    title: str,
    author: Optional[List[str]] = None,
    journal: str = "",
    publisher: str = "",
    year: Optional[int] = None,
    volume: Optional[int] = None,
    issue: Optional[int] = None,
    pages: Optional[List[int]] = None,
    doi: str = "",
    issn: str = "",
    arxiv_id: str = "",
    pmid: Optional[int] = None,
    website: str = "",
    **kwargs,
):
    """
    create a reference node

    Examples
    --------
    >>> import cript
    >>> my_reference = cript.Reference(type="journal_article", title="'Living' Polymers")

    Parameters
    ----------
    type: str
        type of literature.
        The [reference type](https://app.criptapp.org/vocab/reference_type/)
        must come from CRIPT controlled vocabulary
    title: str
        title of publication
    author: List[str] default=""
        list of authors
    journal: str default=""
        journal of publication
    publisher: str default=""
        publisher of publication
    year: int default=None
        year of publication
    volume: int default=None
        volume of publication
    issue: int default=None
        issue of publication
    pages: List[int] default=None
        page range of publication
    doi: str default=""
        DOI: digital object identifier
    issn: str default=""
        ISSN: international standard serial number
    arxiv_id: str default=""
        arXiv identifier
    pmid: int default=None
        PMID: PubMed ID
    website: str default=""
        website where the publication can be accessed

    Returns
    -------
    None
        Instantiate a reference node
    """
    if author is None:
        author = []

    if pages is None:
        pages = []

    super().__init__(**kwargs)

    new_attrs = replace(self._json_attrs, type=type, title=title, author=author, journal=journal, publisher=publisher, year=year, volume=volume, issue=issue, pages=pages, doi=doi, issn=issn, arxiv_id=arxiv_id, pmid=pmid, website=website)

    self._update_json_attrs_if_valid(new_attrs)