Skip to content

Commit

Permalink
Pull in science theme, in-press refs support from integration into re…
Browse files Browse the repository at this point in the history
…l/1.0.X
  • Loading branch information
RayPlante committed May 22, 2022
2 parents 263d831 + d803ea6 commit 53723fa
Show file tree
Hide file tree
Showing 30 changed files with 5,673 additions and 370 deletions.
2 changes: 1 addition & 1 deletion docker/dockbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -e

## These are set by default via _run.sh; if necessary, uncomment and customize
#
# PACKAGE_NAME=oar-build
PACKAGE_NAME=oar-metadata
#
## list the names of the image directories (each containing a Dockerfile) for
## containers to be built. List them in dependency order (where a latter one
Expand Down
239 changes: 238 additions & 1 deletion etc/help/nerdm-guide.html

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions etc/merge/dev/nerdm-pub-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,10 @@
"valid": {
"type": "boolean",
"description": "A flag, if True, indicating the the hash value contained in this ChecksumFile is confirmed to be correct for its associated data file."
}

},
"describes": {
"type": "string",
"format": "uri-reference"
"format": "uri-reference",
"asOntology": {
"@context": "profile-schema-onto.json",
"prefLabel": "Checksum for",
Expand Down
46 changes: 44 additions & 2 deletions jq/nerdm2pod.jq
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,47 @@ def findDOIdist:
if length > 0 then .[0] else null end
;

# convert an isPartOf reference to a suitable string substitute
#
# Input: a ResourceReference object
# Output: a string representation of the enclosing resource
#
def isPartOfRef2str:
if .proxyFor then
.proxyFor
else
if .location then
.location
else
if .title then
.title
else
if .["@id"] then
.["@id"]
else
null
end
end
end
end
;

# given a list of NERDm isPartOf references, return a POD-compatible
# rendering of the first reference
#
# Input: array of ResourceReference objects
# Output: a string representation of the enclosing resource or null if
# there are no objects in the input array
#
def selectIsPartOf:
(
(arrays |
map(select(.)|isPartOfRef2str) |
if (.|length) > 0 then .[0] else null end),
(objects | isPartOfRef2str)
)
;

# Converts a NERDm Resource to a POD Dataset
#
# Input: a NERDm Resource node
Expand Down Expand Up @@ -152,8 +193,9 @@ def resource2midaspodds:
if (.identifier|not) then .identifier = .["@id"] else . end | del(.["@id"]) |
if (.description|length) > 0 then .description = (.description|join_para)
else .description = "" end |
if .isPartOf and .isPart["@id"] then .isPartOf = .isPartOf["@id"]
else del(.isPartOf) end |
if .isPartOf then
.isPartOf = (.isPartOf | selectIsPartOf)
else del(.isPartOf) end |
if .references then .references = [ .references[] | select(.location) |
.location ]
else del(.references) end |
Expand Down
43 changes: 43 additions & 0 deletions jq/tests/test_nerdm2pod.jqt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,49 @@ include "nerdm2pod"; findDOIdist
[{"goob": "gurn"},{"@type": "dcat:Distribution","accessURL": "https://doi.org/12345/TES32843","format": "text/html","title": "DOI Access" },{"accessURL": "https://doi.org/10.18434/T4/1503328","format": "text/html","description": "DOI Access","title": "DOI Access","@type": ["nrd:Hidden","dcat:Distribution"],"@id": "#doi:10.18434/T4/1503328"},{"@type":["nrdp:IncludedResource"],"title":"X"}]
{"@type": "dcat:Distribution","accessURL": "https://doi.org/12345/TES32843","format": "text/html","title": "DOI Access" }

#--------------
# testing isPartOfRef2str
#
include "nerdm2pod"; isPartOfRef2str
{"proxyFor":"doi:10.8888/sample","title":"My Story","@id":"#localref","location":"https://ego.net/mystory.pdf","@type":["dcat:Dataset"]}
"doi:10.8888/sample"

#--------------
# testing isPartOfRef2str
#
include "nerdm2pod"; isPartOfRef2str
{"title":"My Story","@id":"#localref","location":"https://ego.net/mystory.pdf","@type":["dcat:Dataset"]}
"https://ego.net/mystory.pdf"

#--------------
# testing isPartOfRef2str
#
include "nerdm2pod"; isPartOfRef2str
{"title":"My Story","@id":"#localref","@type":["dcat:Dataset"]}
"My Story"

#--------------
# testing isPartOfRef2str
#
include "nerdm2pod"; isPartOfRef2str
{"@id":"#localref","@type":["dcat:Dataset"]}
"#localref"

#--------------
# testing selectIsPartOf
#
include "nerdm2pod"; selectIsPartOf
{"title":"My Story","@id":"#localref","location":"https://ego.net/mystory.pdf","@type":["dcat:Dataset"]}
"https://ego.net/mystory.pdf"

#--------------
# testing selectIsPartOf
#
include "nerdm2pod"; selectIsPartOf
[{"title":"My Story","@id":"#localref","@type":["dcat:Dataset"]},{"title":"My Story","@id":"#localref","location":"https://ego.net/mystory.pdf","@type":["dcat:Dataset"]}]
"My Story"


#--------------
# testing resource2midaspodds
#
Expand Down
129 changes: 129 additions & 0 deletions model/examples/forensics/BiometricsScienceTheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"_schema": "https://data.nist.gov/od/dm/nerdm-schema/v0.6#",
"topic": [
{
"scheme": "https://data.nist.gov/od/dm/nist-themes-forensics/v1.0",
"tag": "Forensics: Biometrics",
"@type": "Concept"
},
{
"scheme": "https://data.nist.gov/od/dm/nist-themes/v1.1",
"tag": "Information Technology: Biometrics",
"@type": "Concept"
}
],
"keyword": [
"latent",
"biometrics",
"forensics"
],
"_extensionSchemas": [
"https://data.nist.gov/od/dm/nerdm-schema/pub/v0.6#/definitions/PublicDataResource",
"https://data.nist.gov/od/dm/nerdm-schema/agg/v0.1#/definitions/ScienceTheme"
],
"landingPage": "https://www.nist.gov/itl/iad/image-group",
"title": "NIST Research in Biometric forensics.",
"theme": [
"Information Technology: Biometrics",
"Forensics: Biometrics"
],
"version": "1.0.0",
"programCode": [
"006:045"
],
"@context": [
"https://data.nist.gov/od/dm/nerdm-pub-context.jsonld",
{
"@base": "ark:/88434/mds991122"
}
],
"description": [
"This is Biometrics research projects collection. There are many different projects are created here."
],
"bureauCode": [
"006:55"
],
"contactPoint": {
"hasEmail": "mailto:[email protected]",
"fn": "NIST Biometrics Group"
},
"accessLevel": "public",
"@id": "ark:/88434/mds991122",
"publisher": {
"name": "National Institute of Standards and Technology",
"@type": "org:Organization"
},
"doi": "doi:10.18434/T4/1502474",
"license": "https://www.nist.gov/open/license",
"language": [
"en"
],
"modified": "2022-02-15 12:01:02",
"ediid": "ark:/88434/mds991122",
"versionHistory": [
{
"issued": "2021-12-31",
"version": "1.0.0",
"@id": "ark:/88434/mds991122",
"location": "https://data.nist.gov/od/id/ark:/88434/mds991122",
"description": "initial release"
}
],
"@type": [
"nrda: ScienceTheme",
"nrdp: PublicDataResource"
],
"facilitators": [
{
"familyName": "Fiumara",
"affiliation": [
{
"@type": "org:Organization",
"title": "NIST Forensics division"
}
],
"givenName": "Gregory",
"@type": "foaf:Person",
"fn": "Greg Fiumara",
"jobTitle": "PI"
}
],
"creators": [
{
"familyName": "Brady",
"affiliation": [
{
"@type": "org:Organization",
"title": "NIST Forensics division"
}
],
"givenName": "Mary",
"@type": "foaf:Person",
"fn": "Mary Brady"
}
],
"components": [
{
"@type": [
"nrda:DynamicResourceSet",
"nrdp:SearchPage"
],
"_extensionSchemas": [
"https://data.nist.gov/od/dm/nerdm-schema/agg/v0.1#/definitions/DynamicResourceSet"
],
"searchURL": "/rmm/records?isPartOf.@id=ark:/88434/mds991122",
"accessURL": "https://data.nist.gov/sdp/#/search?q=isPartOf.@id%3Dark:/88434/mds991122",
"title": "Biometrics Data Collection"
}
],
"isPartOf": [
{
"title": "NIST Forensics Research Data",
"@id": "ark:/88434/mds9911",
"@type": [
"nrda:Aggregation",
"nrdp:PublicDataResource"
]
}
]
}
123 changes: 123 additions & 0 deletions model/examples/forensics/DNAScienceTheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"_schema": "https://data.nist.gov/od/dm/nerdm-schema/v0.6#",
"topic": [
{
"scheme": "https://data.nist.gov/od/dm/nist-themes-forensics/v1.0",
"tag": "Forensics: DNA and biological evidence",
"@type": "Concept"
}
],
"keyword": [
"forensics",
"dna"
],
"_extensionSchemas": [
"https://data.nist.gov/od/dm/nerdm-schema/pub/v0.6#/definitions/PublicDataResource",
"https://data.nist.gov/od/dm/nerdm-schema/agg/v0.1#/definitions/ScienceTheme"
],
"landingPage": "https://www.nist.gov/itl/iad/image-group",
"title": "NIST Research in DNA and biological evidence.",
"theme": [
"Forensics:DNA and biological evidence"
],
"version": "1.0.0",
"programCode": [
"006:045"
],
"@context": [
"https://data.nist.gov/od/dm/nerdm-pub-context.jsonld",
{
"@base": "ark:/88434/mds991133"
}
],
"description": [
"DNA is a complex molecule that contains the instructions for building and maintaining the bodies of humans and other organisms. With the exception of red blood cells, every cell in your body has DNA. And with the exception of identical twins, everyone’s DNA is different. If someone leaves blood, semen or other biological material at a crime scene, scientists can use it as DNA evidence and create a DNA profile, or genetic fingerprint of that person. That profile can be used to search a DNA database for a possible suspect, to associate a suspect with evidence left at a crime scene, or to link two crimes that may have been committed by the same person."
],
"bureauCode": [
"006:55"
],
"contactPoint": {
"hasEmail": "mailto:[email protected]",
"fn": "NIST DNA research Group"
},
"accessLevel": "public",
"@id": "ark:/88434/mds991122",
"publisher": {
"name": "National Institute of Standards and Technology",
"@type": "org:Organization"
},
"doi": "doi:10.18434/T4/1502474",
"license": "https://www.nist.gov/open/license",
"language": [
"en"
],
"modified": "2022-01-01 12:01:02",
"ediid": "ark:/88434/mds991122",
"versionHistory": [
{
"issued": "2021-12-31",
"version": "1.0.0",
"@id": "ark:/88434/mds991122",
"location": "https://data.nist.gov/od/id/ark:/88434/mds991122",
"description": "initial release"
}
],
"@type": [
"nrda:ScienceTheme",
"nrdp:PublicDataResource"
],
"facilitators": [
{
"familyName": "Fiumara",
"affiliation": [
{
"@type": "org:Organization",
"title": "NIST Forensics division"
}
],
"givenName": "Gregory",
"@type": "foaf:Person",
"fn": "Greg Fiumara",
"jobTitle": "PI"
}
],
"creators": [
{
"familyName": "Brady",
"affiliation": [
{
"@type": "org:Organization",
"title": "NIST Forensics division"
}
],
"givenName": "Mary",
"@type": "foaf:Person",
"fn": "Mary Brady",
"jobTitle": "PI"
}
],
"components": [
{
"@type": [
"nrda:DynamicResourceSet",
"nrdp:SearchPage"
],
"_extensionSchemas": [
"https://data.nist.gov/od/dm/nerdm-schema/agg/v0.1#/definitions/DynamicResourceSet"
],
"searchURL": "/rmm/records?isPartOf.@id=ark:/88434/mds991133",
"accessURL": "https://data.nist.gov/sdp/#/search?q=isPartOf.@id%3Dark:/88434/mds991133",
"title": "DNA and Biological Evidence data collection"
}
],
"isPartOf": [
{
"title": "Forensics Data Collection",
"@id": "ark:/88434/mds9911",
"@type": [
"nrda:Aggregation",
"nrdp:PublicDataResource"
]
}
]
}
Loading

0 comments on commit 53723fa

Please sign in to comment.