diff --git a/build.sbt b/build.sbt index 6e494c22..6edd85aa 100644 --- a/build.sbt +++ b/build.sbt @@ -101,11 +101,22 @@ lazy val simulation = project moduleName := "nsg-simulation-schemas" ) +lazy val literature = project + .in(file("modules/literature")) + .enablePlugins(WorkbenchPlugin) + .disablePlugins(ScapegoatSbtPlugin, DocumentationPlugin) + .dependsOn(core) + .settings(common) + .settings( + name := "nsg-literature-schemas", + moduleName := "nsg-literature-schemas" + ) + lazy val root = project .in(file(".")) .settings(name := "nsg-schemas", moduleName := "nsg-schemas") .settings(common, noPublish) - .aggregate(core, experiment, atlas, morphology, electrophysiology, simulation, nexusschema,nsgcommons) + .aggregate(core, experiment, atlas, morphology, electrophysiology, simulation, literature, nexusschema,nsgcommons) lazy val common = Seq( scalacOptions in (Compile, console) ~= (_ filterNot (_ == "-Xfatal-warnings")), diff --git a/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/book/v0.1.0.json b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/book/v0.1.0.json new file mode 100644 index 00000000..576bcaf8 --- /dev/null +++ b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/book/v0.1.0.json @@ -0,0 +1,124 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/schema/v0.2.0", + { + "this": "{{base}}/schemas/neurosciencegraph/literature/book/v0.1.0/shapes/" + } + ], + "@type": "nxv:Schema", + "shapes": [ + { + "@id": "this:BookShape", + "@type": "sh:NodeShape", + "label": "schema.org book shape definition.", + "targetClass": "schema:Book", + "nodekind": "sh:BlankNodeOrIRI", + "and": [ + { + "node": "{{base}}/templates/core/entity/v0.1.0/shapes/EntityShape" + }, + { + "property": [ + { + "path": "schema:bookEdition", + "name": "edition", + "description": "The edition of the book", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:isbn", + "name": "ISBN", + "description": "The ISBN of the book", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:author", + "name": "author(s)", + "description": "The author(s) of this book", + "or": [ + { + "class": "schema:Person", + "node": "{{base}}/schemas/nexus/schemaorg/person/v0.1.0/shapes/PersonShape" + }, + { + "class": "schema:Organization", + "node": "{{base}}/schemas/nexus/schemaorg/organization/v0.1.0/shapes/OrganizationShape" + } + ], + "comment": "We should specify that a Book must have either at least one author *or* at least one editor" + }, + { + "path": "schema:datePublished", + "name": "publicationDate", + "description": "Date of first publication", + "datatype": "xsd:date", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:editor", + "name": "editor(s)", + "description": "The editor(s) of this book", + "class": "schema:Person", + "node": "{{base}}/schemas/nexus/schemaorg/person/v0.1.0/shapes/PersonShape" + }, + { + "path": "schema:keywords", + "name": "keywords", + "description": "Keywords or tags used to describe this book. Multiple entries in a keywords list are typically delimited by commas.", + "datatype": "xsd:string" + }, + { + "path": "schema:license", + "name": "license", + "description": "A license document that applies to this book, typically indicated by URL.", + "nodeKind": "sh:IRI" + }, + { + "path": "schema:publisher", + "name": "publisher", + "description": "The publisher of the book.", + "or": [ + { + "class": "schema:Person", + "node": "{{base}}/schemas/nexus/schemaorg/person/v0.1.0/shapes/PersonShape" + }, + { + "class": "schema:Organization", + "node": "{{base}}/schemas/nexus/schemaorg/organization/v0.1.0/shapes/OrganizationShape" + } + ], + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:description", + "name": "description", + "description": "A description of the book.", + "datatype": "xsd:string", + "maxCount": 1 + }, + { + "path": "schema:name", + "name": "title", + "description": "The title of the book.", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:url", + "name": "url", + "description": "URL at which the book can be downloaded or ordered.", + "nodeKind": "sh:IRI" + } + ] + } + ] + } + ] +} diff --git a/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/chapter/v0.1.0.json b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/chapter/v0.1.0.json new file mode 100644 index 00000000..7ce9f3c5 --- /dev/null +++ b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/chapter/v0.1.0.json @@ -0,0 +1,108 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/schema/v0.2.0", + { + "this": "{{base}}/schemas/neurosciencegraph/literature/chapter/v0.1.0/shapes/" + } + ], + "@type": "nxv:Schema", + "shapes": [ + { + "@id": "this:ChapterShape", + "@type": "sh:NodeShape", + "label": "schema.org chapter shape definition.", + "targetClass": "schema:Chapter", + "nodekind": "sh:BlankNodeOrIRI", + "and": [ + { + "node": "{{base}}/templates/core/entity/v0.1.0/shapes/EntityShape" + }, + { + "property": [ + { + "path": "schema:name", + "name": "title", + "description": "The title of the chapter", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:author", + "name": "author(s)", + "description": "The author(s) of this chapter", + "or": [ + { + "class": "schema:Person", + "node": "{{base}}/schemas/nexus/schemaorg/person/v0.1.0/shapes/PersonShape" + }, + { + "class": "schema:Organization", + "node": "{{base}}/schemas/nexus/schemaorg/organization/v0.1.0/shapes/OrganizationShape" + } + ], + "minCount": 1 + }, + { + "path": "schema:datePublished", + "name": "publicationDate", + "description": "Date of first publication", + "datatype": "xsd:date", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:isPartOf", + "name": "book", + "description": "The book in which this chapter appears", + "class": "schema:Book", + "node": "{{base}}/schemas/neurosciencegraph/literature/book/v0.1.0/shapes/BookShape", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:url", + "name": "url", + "description": "URL at which the full text or abstract of the chapter can be obtained.", + "nodeKind": "sh:IRI" + }, + { + "path": "schema:keywords", + "name": "keywords", + "description": "Keywords or tags used to describe this chapter. Multiple entries in a keywords list are typically delimited by commas.", + "datatype": "xsd:string" + }, + { + "path": "schema:license", + "name": "license", + "description": "A license document that applies to this chapter, typically indicated by URL.", + "nodeKind": "sh:IRI" + }, + { + "path": "schema:pagination", + "name": "pagination", + "description": "Start and end page, or other equivalent indicator", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "http://doi.org/", + "name": "DOI", + "description": "Digital Object Identifier", + "datatype": "xsd:string", + "maxCount": 1 + }, + { + "path": "schema:description", + "name": "abstract", + "description": "A description of the chapter, normally the abstract or summary", + "datatype": "xsd:string", + "maxCount": 1 + } + ] + } + ] + } + ] +} diff --git a/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/periodical/v0.1.0.json b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/periodical/v0.1.0.json new file mode 100644 index 00000000..4f352071 --- /dev/null +++ b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/periodical/v0.1.0.json @@ -0,0 +1,77 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/schema/v0.2.0", + { + "this": "{{base}}/schemas/neurosciencegraph/literature/periodical/v0.1.0/shapes/" + } + ], + "@type": "nxv:Schema", + "shapes": [ + { + "@id": "this:PeriodicalShape", + "@type": "sh:NodeShape", + "label": "schema.org periodical shape definition.", + "targetClass": "schema:Periodical", + "nodekind": "sh:BlankNodeOrIRI", + "and": [ + { + "node": "{{base}}/templates/core/entity/v0.1.0/shapes/EntityShape" + }, + { + "property": [ + { + "path": "schema:issn", + "name": "ISSN", + "description": "The International Standard Serial Number (ISSN) that identifies this serial publication", + "datatype": "xsd:string" + }, + { + "path": "schema:publisher", + "name": "publisher", + "description": "The publisher of the periodical.", + "or": [ + { + "class": "schema:Person", + "node": "{{base}}/schemas/nexus/schemaorg/person/v0.1.0/shapes/PersonShape" + }, + { + "class": "schema:Organization", + "node": "{{base}}/schemas/nexus/schemaorg/organization/v0.1.0/shapes/OrganizationShape" + } + ], + "maxCount": 1 + }, + { + "path": "schema:description", + "name": "description", + "description": "A description of the periodical.", + "datatype": "xsd:string", + "maxCount": 1 + }, + { + "path": "schema:name", + "name": "title", + "description": "The title of the periodical.", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:alternateName", + "name": "shortTitle", + "description": "An abbreviated form of the title of the periodical.", + "datatype": "xsd:string", + "maxCount": 1 + }, + { + "path": "schema:url", + "name": "url", + "description": "URL at which the list of volumes of the periodical can be obtained.", + "nodeKind": "sh:IRI" + } + ] + } + ] + } + ] +} diff --git a/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/publicationvolume/v0.1.0.json b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/publicationvolume/v0.1.0.json new file mode 100644 index 00000000..041d931a --- /dev/null +++ b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/publicationvolume/v0.1.0.json @@ -0,0 +1,51 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/schema/v0.2.0", + { + "this": "{{base}}/schemas/neurosciencegraph/literature/publicationvolume/v0.1.0/shapes/" + } + ], + "@type": "nxv:Schema", + "shapes": [ + { + "@id": "this:PublicationVolumeShape", + "@type": "sh:NodeShape", + "label": "schema.org publication volume shape definition.", + "targetClass": "schema:PublicationVolume", + "nodekind": "sh:BlankNodeOrIRI", + "and": [ + { + "node": "{{base}}/templates/core/entity/v0.1.0/shapes/EntityShape" + }, + { + "property": [ + { + "path": "schema:volumeNumber", + "name": "volumeNumber", + "description": "Identifies the volume of publication or multi-part work; for example, 'iii' or '2'", + "or": [ + {"datatype": "xsd:string"}, + {"datatype": "xsd:integer"} + ] + }, + { + "path": "schema:isPartOf", + "name": "periodical", + "description": "The periodical of which this is a volume.", + "class": "schema:Periodical", + "node": "{{base}}/schemas/neurosciencegraph/literature/periodical/v0.1.0/shapes/PeriodicalShape", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:url", + "name": "url", + "description": "URL at which the list of issues or table of contents of the publication volume can be obtained.", + "nodeKind": "sh:IRI" + } + ] + } + ] + } + ] +} diff --git a/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/scholarlyarticle/v0.1.0.json b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/scholarlyarticle/v0.1.0.json new file mode 100644 index 00000000..01103990 --- /dev/null +++ b/modules/literature/src/main/resources/schemas/neurosciencegraph/literature/scholarlyarticle/v0.1.0.json @@ -0,0 +1,115 @@ +{ + "@context": [ + "{{base}}/contexts/nexus/core/schema/v0.2.0", + { + "this": "{{base}}/schemas/neurosciencegraph/literature/scholarlyarticle/v0.1.0/shapes/" + } + ], + "@type": "nxv:Schema", + "shapes": [ + { + "@id": "this:ScholarlyArticleShape", + "@type": "sh:NodeShape", + "label": "schema.org scholarly article shape definition.", + "targetClass": "schema:ScholarlyArticle", + "nodekind": "sh:BlankNodeOrIRI", + "and": [ + { + "node": "{{base}}/templates/core/entity/v0.1.0/shapes/EntityShape" + }, + { + "property": [ + { + "path": "schema:name", + "name": "title", + "description": "The title of the scholarly article", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:author", + "name": "author(s)", + "description": "The author(s) of this scholarly article", + "or": [ + { + "class": "schema:Person", + "node": "{{base}}/schemas/nexus/schemaorg/person/v0.1.0/shapes/PersonShape" + }, + { + "class": "schema:Organization", + "node": "{{base}}/schemas/nexus/schemaorg/organization/v0.1.0/shapes/OrganizationShape" + } + ], + "minCount": 1 + }, + { + "path": "schema:datePublished", + "name": "publicationDate", + "description": "Date of first publication", + "datatype": "xsd:date", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:isPartOf", + "name": "volume", + "description": "The volume in which this article appears", + "class": "schema:PublicationVolume", + "node": "{{base}}/schemas/neurosciencegraph/literature/publicationvolume/v0.1.0/shapes/PublicationVolumeShape", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "schema:url", + "name": "url", + "description": "URL at which the full text or abstract of the scholarly article can be obtained.", + "nodeKind": "sh:IRI" + }, + { + "path": "schema:keywords", + "name": "keywords", + "description": "Keywords or tags used to describe this article. Multiple entries in a keywords list are typically delimited by commas.", + "datatype": "xsd:string" + }, + { + "path": "schema:license", + "name": "license", + "description": "A license document that applies to this article, typically indicated by URL.", + "nodeKind": "sh:IRI" + }, + { + "path": "schema:pagination", + "name": "pagination", + "description": "Start and end page, or other equivalent indicator", + "datatype": "xsd:string", + "minCount": 1, + "maxCount": 1 + }, + { + "path": "http://doi.org/", + "name": "DOI", + "description": "Digital Object Identifier", + "datatype": "xsd:string", + "maxCount": 1 + }, + { + "path": "https://www.ncbi.nlm.nih.gov/pmc/articles", + "name": "Pubmed ID", + "description": "Pubmed ID", + "datatype": "xsd:string", + "maxCount": 1 + }, + { + "path": "schema:description", + "name": "abstract", + "description": "A description of the article, normally the abstract or summary", + "datatype": "xsd:string", + "maxCount": 1 + } + ] + } + ] + } + ] +} diff --git a/modules/literature/src/test/resources/data/neurosciencegraph/literature/book/v0.1.0/min-fields.json b/modules/literature/src/test/resources/data/neurosciencegraph/literature/book/v0.1.0/min-fields.json new file mode 100644 index 00000000..b760346f --- /dev/null +++ b/modules/literature/src/test/resources/data/neurosciencegraph/literature/book/v0.1.0/min-fields.json @@ -0,0 +1,17 @@ +{ + "@context": [ + "{{base}}/contexts/neurosciencegraph/core/data/v0.1.0" + ], + "@type": [ + "prov:Entity", + "schema:Book" + ], + "schema:isbn": "9780195159561", + "schema:datePublished": "2004-01-08", + "schema:name": "The Synaptic Organization of the Brain", + "schema:bookEdition": "5th edition", + "schema:publisher": { + "@id": "{{base}}/data/nexus/schemaorg/organization/v0.1.0/f4880a5e-3096-4527-bbf8-05d797b8c424", + "@type": "schema:Organization" + } +} \ No newline at end of file diff --git a/modules/literature/src/test/resources/data/neurosciencegraph/literature/book/v0.1.0/some-fields.json b/modules/literature/src/test/resources/data/neurosciencegraph/literature/book/v0.1.0/some-fields.json new file mode 100644 index 00000000..fa2e3cdf --- /dev/null +++ b/modules/literature/src/test/resources/data/neurosciencegraph/literature/book/v0.1.0/some-fields.json @@ -0,0 +1,21 @@ +{ + "@context": [ + "{{base}}/contexts/neurosciencegraph/core/data/v0.1.0" + ], + "@type": [ + "prov:Entity", + "schema:Book" + ], + "schema:isbn": "9780195159561", + "schema:editor": { + "@id": "{{base}}/data/nexus/schemaorg/person/v0.1.0/e6880a5e-3096-4527-bbf8-05d797b8c425", + "@type": "schema:Person" + }, + "schema:datePublished": "2004-01-08", + "schema:publisher": { + "@id": "{{base}}/data/nexus/schemaorg/organization/v0.1.0/f4880a5e-3096-4527-bbf8-05d797b8c424", + "@type": "schema:Organization" + }, + "schema:name": "The Synaptic Organization of the Brain", + "schema:bookEdition": "5th edition" +} \ No newline at end of file diff --git a/modules/literature/src/test/resources/data/neurosciencegraph/literature/chapter/v0.1.0/all-fields.json b/modules/literature/src/test/resources/data/neurosciencegraph/literature/chapter/v0.1.0/all-fields.json new file mode 100644 index 00000000..670b59a8 --- /dev/null +++ b/modules/literature/src/test/resources/data/neurosciencegraph/literature/chapter/v0.1.0/all-fields.json @@ -0,0 +1,30 @@ +{ + "@context": [ + "{{base}}/contexts/neurosciencegraph/core/data/v0.1.0" + ], + "@type": [ + "prov:Entity", + "schema:Chapter" + ], + "schema:isPartOf": { + "@id": "{{base}}/data/neurosciencegraph/literature/book/v0.1.0/c3330a5e-3096-4527-bbf8-05d797b8c989", + "@type": "schema:Book" + }, + "schema:name": "Thalamus", + "schema:author": [ + { + "@id": "{{base}}/data/nexus/schemaorg/person/v0.1.0/d8880a5e-3096-4527-bbf8-16d797b8c988", + "@type": "schema:Person" + }, + { + "@id": "{{base}}/data/nexus/schemaorg/person/v0.1.0/e8880a5e-3096-4527-bbf8-17d797b8c989", + "@type": "schema:Person" + } + ], + "schema:datePublished": "2004-01-08", + "schema:pagination": "311-359", + "http://doi.org/": "10.1093/acprof:oso/9780195159561.003.0008", + "schema:keywords": "brain regions, diencephalon, synaptic circuits, neocortex, peripheral sense organs", + "schema:url": {"@id": "http://www.oxfordscholarship.com/view/10.1093/acprof:oso/9780195159561.001.1/acprof-9780195159561-chapter-8"}, + "schema:description": "The thalamus is the largest part of the diencephalon, one of the major subdivisions of the brain, and provides the major route for afferents to the neocortex. Essentially no messages can reach the neocortex without first passing through the thalamus. Messages from many different sources pass through the thalamus on the way to the neocortex, including messages from peripheral sense organs (such as vision, hearing, touch, temperature, pain, taste, olfaction), other regions of the brain (such as the cerebellum and the mamillary bodies), and the neocortex itself. This chapter discusses the general organization of the thalamus, covering its neuronal elements, synaptic connections, basic neuronal circuit, dendritic cable properties, membrane properties, synaptic transmission, and first order and higher order relays" +} \ No newline at end of file diff --git a/modules/literature/src/test/resources/data/neurosciencegraph/literature/periodical/v0.1.0/all-fields.json b/modules/literature/src/test/resources/data/neurosciencegraph/literature/periodical/v0.1.0/all-fields.json new file mode 100644 index 00000000..446c9ab6 --- /dev/null +++ b/modules/literature/src/test/resources/data/neurosciencegraph/literature/periodical/v0.1.0/all-fields.json @@ -0,0 +1,18 @@ +{ + "@context": [ + "{{base}}/contexts/neurosciencegraph/core/data/v0.1.0" + ], + "@type": [ + "prov:Entity", + "schema:Periodical" + ], + "schema:issn": ["0270-6474", "1529-2401"], + "schema:publisher": { + "@id": "{{base}}/data/nexus/schemaorg/organization/v0.1.0/a9880a5e-3096-4527-bbf8-05d797b8c437", + "@type": "schema:Organization" + }, + "schema:name": "The Journal of Neuroscience", + "schema:alternateName": "J. Neurosci.", + "schema:description": "An official journal of the Society for Neuroscience", + "schema:url": {"@id": "http://www.jneurosci.org"} +} \ No newline at end of file diff --git a/modules/literature/src/test/resources/data/neurosciencegraph/literature/publicationvolume/v0.1.0/all-fields.json b/modules/literature/src/test/resources/data/neurosciencegraph/literature/publicationvolume/v0.1.0/all-fields.json new file mode 100644 index 00000000..821e1fb8 --- /dev/null +++ b/modules/literature/src/test/resources/data/neurosciencegraph/literature/publicationvolume/v0.1.0/all-fields.json @@ -0,0 +1,15 @@ +{ + "@context": [ + "{{base}}/contexts/neurosciencegraph/core/data/v0.1.0" + ], + "@type": [ + "prov:Entity", + "schema:PublicationVolume" + ], + "schema:isPartOf": { + "@id": "{{base}}/data/neurosciencegraph/literature/periodical/v0.1.0/b0880a5e-3096-4527-bbf8-05d797b8c431", + "@type": "schema:Periodical" + }, + "schema:volumeNumber": 38, + "schema:url": {"@id": "http://www.jneurosci.org/content/by/volume/38"} +} \ No newline at end of file diff --git a/modules/literature/src/test/resources/data/neurosciencegraph/literature/scholarlyarticle/v0.1.0/all-fields.json b/modules/literature/src/test/resources/data/neurosciencegraph/literature/scholarlyarticle/v0.1.0/all-fields.json new file mode 100644 index 00000000..a35c9bdb --- /dev/null +++ b/modules/literature/src/test/resources/data/neurosciencegraph/literature/scholarlyarticle/v0.1.0/all-fields.json @@ -0,0 +1,30 @@ +{ + "@context": [ + "{{base}}/contexts/neurosciencegraph/core/data/v0.1.0" + ], + "@type": [ + "prov:Entity", + "schema:ScholarlyArticle" + ], + "schema:isPartOf": { + "@id": "{{base}}/data/neurosciencegraph/literature/publicationvolume/v0.1.0/a8880a5e-3096-4527-bbf8-05d797b8c987", + "@type": "schema:PublicationVolume" + }, + "schema:name": "A quantitative description of membrane current and its application to conduction and excitation in nerve", + "schema:author": [ + { + "@id": "{{base}}/data/nexus/schemaorg/person/v0.1.0/d8880a5e-3096-4527-bbf8-05d797b8c988", + "@type": "schema:Person" + }, + { + "@id": "{{base}}/data/nexus/schemaorg/person/v0.1.0/e8880a5e-3096-4527-bbf8-05d797b8c989", + "@type": "schema:Person" + } + ], + "schema:datePublished": "1952-08-28", + "schema:pagination": "500–544", + "http://doi.org/": "10.1113/jphysiol.1952.sp004764/", + "schema:keywords": "squid, axon", + "schema:url": {"@id": "http://onlinelibrary.wiley.com/doi/10.1113/jphysiol.1952.sp004764/abstract"}, + "https://www.ncbi.nlm.nih.gov/pmc/articles": "PMC1392413" +} \ No newline at end of file