Skip to content

Commit

Permalink
Merge fixes from 'usnistgov/integration' into rel/1.0.X (ark ids & fi…
Browse files Browse the repository at this point in the history
…lepath)
  • Loading branch information
RayPlante committed Oct 9, 2019
2 parents 968ae8f + 255b607 commit 4f7ddd7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docker/ejsonschema/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM oar-metadata/jq:latest
RUN apt-get update && apt-get install -y python python-pip python-dev unzip \
uwsgi uwsgi-plugin-python python-yaml
RUN pip install setuptools --upgrade
RUN pip install json-spec jsonmerge==1.3.0 jsonschema requests pynoid \
RUN pip install json-spec jsonmerge==1.3.0 jsonschema==2.6.0 requests pynoid \
pytest==4.6.5 filelock crossrefapi

WORKDIR /root
Expand Down
28 changes: 11 additions & 17 deletions jq/pod2nerdm.jq
Original file line number Diff line number Diff line change
Expand Up @@ -184,24 +184,18 @@ def componentID(prefix):
def filepath:
if test("https?://s3.amazonaws.com/nist-srd/\\w+/") then
sub("https?://s3.amazonaws.com/nist-srd/\\w+/"; "")
elif test("https?://s3.amazonaws.com/nist-\\w+/\\w+/") then
sub("https?://s3.amazonaws.com/nist-\\w+/\\w+/"; "")
elif test("https?://opendata.nist.gov/\\w+/") then
sub("https?://opendata.nist.gov/\\w+/"; "")
elif test("https?://(test)?data.nist.gov/od/ds/") then
sub("https?://(test)?data.nist.gov/od/ds/"; "") |
if test("ark:/\\w+/") then
sub("ark:/\\w+/"; "")
else . end |
sub("^[\\w+-]+/"; "")
else
if test("https?://s3.amazonaws.com/nist-\\w+/\\w+/") then
sub("https?://s3.amazonaws.com/nist-\\w+/\\w+/"; "")
else
if test("https?://opendata.nist.gov/\\w+/") then
sub("https?://opendata.nist.gov/\\w+/"; "")
else
if test("https?://data.nist.gov/od/ds/\\w+/") then
sub("https?://data.nist.gov/od/ds/\\w+/"; "")
else
if test("https?://testdata.nist.gov/od/ds/\\w+/") then
sub("https?://testdata.nist.gov/od/ds/\\w+/"; "")
else
sub(".*/"; "")
end
end
end
end
sub(".*/"; "")
end | url_decode_plus
;

Expand Down
4 changes: 2 additions & 2 deletions jq/tests/test_pod2nerdm.jqt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ include "pod2nerdm"; map(cvtref)
# testing filepath()
#
include "pod2nerdm"; map(filepath)
[ "http://goob.net/root/doc.txt", "https://s3.amazonaws.com/nist-zub/90210/foo/bar", "http://s3.amazonaws.com/nist-srd/14/data.zip", "https://data.nist.gov/od/ds/2309849843752/my%20data.zip", "https://testdata.nist.gov/od/ds/2309849843752/coll%23/my+%2Bdata.zip" ]
[ "doc.txt", "foo/bar", "data.zip", "my data.zip", "coll#/my +data.zip" ]
[ "http://goob.net/root/doc.txt", "https://s3.amazonaws.com/nist-zub/90210/foo/bar", "http://s3.amazonaws.com/nist-srd/14/data.zip", "https://data.nist.gov/od/ds/2309849843752/my%20data.zip", "https://testdata.nist.gov/od/ds/2309849843752/coll%23/my+%2Bdata.zip", "https://testdata.nist.gov/od/ds/ark:/88888/pdr0-19381/coll%23/my+%2Bdata.zip", "https://data.nist.gov/od/ds/ark:/88888/pdr0-19381/my+%2Bdata.zip" ]
[ "doc.txt", "foo/bar", "data.zip", "my data.zip", "coll#/my +data.zip", "coll#/my +data.zip", "my +data.zip" ]


#---------------
Expand Down
2 changes: 2 additions & 0 deletions model/nerdm-context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"dpr": "https://nist.org/dp/dpr/",
"vcard": "http://www.w3.org/2006/vcard/ns#",
"bibo": "http://purl.org/ontology/bibo/",
"schema": "http://schema.org/",
"npg": "http://ns.nature.com/terms/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"pod": "https://project-open-data.cio.gov/v1.1/schema#",
"rmmperson": "https://nist.org/od/dm/person/",
Expand Down
2 changes: 1 addition & 1 deletion model/pod-schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$extensionSchemas": ["http://mgi.nist.gov/mgi-json-schema/v0.1"],
"id": "http://data.nist.gov/od/dm/pod-schema/v1.1#",
"id": "https://data.nist.gov/od/dm/pod-schema/v1.1#",
"title": "US Project Open Data Schema as Extended JSON Schema",
"description": "This JSON Schema expresses the POD schema (v1.1) so that instances can be validated via a JSON Schema validater",
"definitions": {
Expand Down

0 comments on commit 4f7ddd7

Please sign in to comment.