Skip to content

Commit

Permalink
Merge pull request #133 from adiwg/dev
Browse files Browse the repository at this point in the history
Merge 2.0.0 from dev
  • Loading branch information
jlblcc authored Mar 8, 2017
2 parents 5b76545 + ff62e94 commit 163b4f0
Show file tree
Hide file tree
Showing 259 changed files with 7,550 additions and 13,838 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: ruby
before_install:
- gem update bundler
rvm:
- 2.1.0
- 2.0.0
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/adiwg/mdJson-schemas.svg?branch=master)](https://travis-ci.org/adiwg/mdJson-schemas)
[![Gem Version](https://badge.fury.io/rb/adiwg-mdjson_schemas.svg)](http://badge.fury.io/rb/adiwg-mdjson_schemas)
[![Bower version](https://badge.fury.io/bo/mdjson-schemas.svg)](https://badge.fury.io/bo/mdjson-schemas)

# mdJson-schemas

Expand All @@ -8,7 +9,7 @@ JSON schemas for the ADIwg project and data metadata standard

## Ruby Gem

TODO: Write a gem description
Use with [ruby-json-schema/json-schema](https://github.com/ruby-json-schema/json-schema) to validate mdJSON records in Ruby.

### Installation

Expand All @@ -24,14 +25,24 @@ Or install it yourself as:

$ gem install adiwg-json_schemas

## Bower

Install:

$ bower install mdjson-schemas

### Usage

TODO: Write usage instructions here
The main schema file is `schema/schema.json`. Load that file in your validator.

**NOTE**: The schemas use relative addresses for `$ref` paths. This causes a problem
with the [ruby-json-schema/json-schema](https://github.com/ruby-json-schema/json-schema) gem.
As a workaround, you can pre-load all of the schemas by calling `ADIWG::MdjsonSchemas::Utils::load_schemas` before validation.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
5. Create new Pull Request
11 changes: 10 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ Rake::TestTask.new do |t|
end

desc "Run tests"
task :default => :test
task :default => :test

Rake::TestTask.new do |t|
t.libs << 'test'
t.test_files = FileList['test/tu*.rb']
t.verbose = true
end

desc "Run utility tests"
task :default => :test
4 changes: 2 additions & 2 deletions adiwg-json_schemas.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features|)/})
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "bundler", "~> 1.13"
spec.add_development_dependency "rake", ">= 0"
spec.add_development_dependency "json-schema", "~> 2.4.0"
spec.add_development_dependency "json-schema", "~> 2.7.0"
spec.add_development_dependency "minitest", "~>5"
end
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "mdjson-schemas",
"version": "1.1.3",
"homepage": "https://github.com/adiwg/mdJson-schemas",
"authors": [
"Josh Bradley <jbradley@arcticlcc.org>"
Expand Down
72 changes: 12 additions & 60 deletions examples/additionalDocumentation.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,13 @@
[
{
"resourceType": "resourceType",
"citation": {
"title": "title",
"date": [
{
"date": "1111-11-11",
"dateType": "dateType"
}
],
"edition": "edition",
"responsibleParty": [
{
"contactId": "contactId",
"role": "role"
}
],
"presentationForm": ["presentationForm"],
"identifier": [
{
"identifier": "identifier",
"type": "type",
"authority": {
"title": "title",
"date": [
{
"date": "1111-11-11",
"dateType": "dateType"
}
],
"responsibleParty": [
{
"contactId": "contactId",
"role": "role"
}
],
"onlineResource": [
{
"uri": "http://thisisanexample.com",
"protocol": "protocol",
"name": "name",
"description": "description",
"function": "function"
}
]
}
}
],
"onlineResource": [
{
"uri": "http://thisisanexample.com",
"protocol": "protocol",
"name": "name",
"description": "description",
"function": "function"
}
]
[{
"resourceType": [{
"type": "MD_ScopeCode",
"name": ""
}],
"citation": [{
"title": "title"
},
{
"title": "title"
}
}
]
]
}]
22 changes: 12 additions & 10 deletions examples/address.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[
{
"deliveryPoint": ["deliveryPoint1", "deliveryPoint2"],
"city": "city",
"administrativeArea": "administrativeArea",
"postalCode": "postalCode",
"country": "country",
"electronicMailAddress": ["example1@example.com", "example2@example.com"]
}
]
[{
"addressType": ["mailing", "physical"],
"description": "description",
"deliveryPoint": [
"deliveryPoint0",
"deliveryPoint1"
],
"city": "city",
"administrativeArea": "administrativeArea",
"postalCode": "postalCode",
"country": "country"
}]
8 changes: 8 additions & 0 deletions examples/allocation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"amount": 9.9,
"currency": "currency",
"source": "source",
"recipient": "recipient",
"matching": true,
"comment": "comment"
}]
131 changes: 13 additions & 118 deletions examples/associatedResource.json
Original file line number Diff line number Diff line change
@@ -1,119 +1,14 @@
[
{
"associationType": "associationType",
"initiativeType": "initiativeType",
"resourceType": "resourceType",
"resourceCitation": {
"title": "title",
"date": [
{
"date": "1111-11-11",
"dateType": "dateType"
}
],
"edition": "edition",
"responsibleParty": [
{
"contactId": "contactId",
"role": "role"
}
],
"presentationForm": ["presentationForm"],
"identifier": [
{
"identifier": "identifier",
"type": "type",
"authority": {
"title": "title",
"date": [
{
"date": "1111-11-11",
"dateType": "dateType"
}
],
"responsibleParty": [
{
"contactId": "contactId",
"role": "role"
}
],
"onlineResource": [
{
"uri": "http://thisisanexample.com",
"protocol": "protocol",
"name": "name",
"description": "description",
"function": "function"
}
]
}
}
],
"onlineResource": [
{
"uri": "http://thisisanexample.com",
"protocol": "protocol",
"name": "name",
"description": "description",
"function": "function"
}
]
},
"metadataCitation": {
"title": "title",
"date": [
{
"date": "1111-11-11",
"dateType": "dateType"
}
],
"edition": "edition",
"responsibleParty": [
{
"contactId": "contactId",
"role": "role"
}
],
"presentationForm": ["presentationForm"],
"identifier": [
{
"identifier": "identifier",
"type": "type",
"authority": {
"title": "title",
"date": [
{
"date": "1111-11-11",
"dateType": "dateType"
}
],
"responsibleParty": [
{
"contactId": "contactId",
"role": "role"
}
],
"onlineResource": [
{
"uri": "http://thisisanexample.com",
"protocol": "protocol",
"name": "name",
"description": "description",
"function": "function"
}
]
}
}
],
"onlineResource": [
{
"uri": "http://thisisanexample.com",
"protocol": "protocol",
"name": "name",
"description": "description",
"function": "function"
}
]
}
[{
"resourceType": [{
"type": "MD_ScopeCode",
"name": ""
}],
"associationType": "associationType",
"initiativeType": "initiativeType",
"resourceCitation": {
"title": "title"
},
"metadataCitation": {
"title": "title"
}
]
}]
27 changes: 27 additions & 0 deletions examples/attribute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[{
"sequenceIdentifier": "sequenceIdentifier",
"sequenceIdentifierType": "sequenceIdentifierType",
"attributeDescription": "attributeDescription",
"attributeIdentifier": [{
"identifier": "identifier"
}],
"minValue": 9.9,
"maxValue": 9.9,
"units": "units",
"scaleFactor": 999,
"offset": 999,
"meanValue": 9.9,
"numberOfValues": 999,
"standardDeviation": 9.9,
"bitsPerValue": 999,
"boundMin": 9.9,
"boundMax": 9.9,
"boundUnits": "boundUnits",
"peakResponse": 9.9,
"toneGradations": 999,
"bandBoundaryDefinition": "bandBoundaryDefinition",
"nominalSpatialResolution": 9.9,
"transferFunctionType": "transferFunctionType",
"transmittedPolarization": "transmittedPolarization",
"detectedPolarization": "detectedPolarization"
}]
17 changes: 17 additions & 0 deletions examples/attributeGroup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[{
"attributeContentType": [
"attributeContentType0",
"attributeContentType1"
],
"attribute": [{
"sequenceIdentifier": "sequenceIdentifier0",
"attributeDescription": "attributeDescription0",
"sequenceIdentifierType": "sequenceIdentifierType0"
},
{
"sequenceIdentifier": "sequenceIdentifier1",
"attributeDescription": "attributeDescription1",
"sequenceIdentifierType": "sequenceIdentifierType1"
}
]
}]
6 changes: 6 additions & 0 deletions examples/boundingBox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[{
"westLongitude": -140.0,
"eastLongitude": -120.0,
"southLatitude": 49.0,
"northLatitude": 70.0
}]
Loading

0 comments on commit 163b4f0

Please sign in to comment.