Skip to content

Commit

Permalink
load URIs from Geoblacklight::Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Darren Hardy committed Nov 21, 2014
1 parent 2e64ef2 commit 6a38a8e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 49 deletions.
1 change: 1 addition & 0 deletions lib/geoblacklight/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Constants
iiif: 'http://iiif.io/api/image',
iso19139: 'http://www.isotc211.org/schemas/2005/gmd/',
mods: 'http://www.loc.gov/mods/v3',
shapefile: 'http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf',
url: 'http://schema.org/url',
wcs: 'http://www.opengis.net/def/serviceType/ogc/wcs',
wfs: 'http://www.opengis.net/def/serviceType/ogc/wfs',
Expand Down
15 changes: 2 additions & 13 deletions spec/features/dct_references_generate.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
require 'json'
require 'geoblacklight'

def do_write n, doc
unless File.size?("spec/fixtures/test-dct-references#{n}.json")
Expand All @@ -8,19 +9,7 @@ def do_write n, doc
end
end

URIs = {
:download => 'http://schema.org/downloadUrl',
:shapefile => 'http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf',
:wms => 'http://www.opengis.net/def/serviceType/ogc/wms',
:wfs => 'http://www.opengis.net/def/serviceType/ogc/wfs',
:wcs => 'http://www.opengis.net/def/serviceType/ogc/wcs',
:fgdc => 'http://www.opengis.net/cat/csw/csdgm',
:mods => 'http://www.loc.gov/mods/v3',
:iso19139 => 'http://www.isotc211.org/schemas/2005/gmd/',
:iiif => 'http://library.stanford.edu/iiif/image-api/1.1/context.json',
:html => 'http://www.w3.org/1999/xhtml',
:url => 'http://schema.org/url'
}
URIs = Geoblacklight::Constants::URI
selected = JSON.parse(File.open('schema/examples/selected.json').read)

# scenario 'Case 1: Minimal case of HTML metadata only' do
Expand Down
14 changes: 1 addition & 13 deletions spec/features/dct_references_spec.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
require 'json'
require 'spec_helper'

URIs = {
:download => 'http://schema.org/downloadUrl',
:shapefile => 'http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf',
:wms => 'http://www.opengis.net/def/serviceType/ogc/wms',
:wfs => 'http://www.opengis.net/def/serviceType/ogc/wfs',
:wcs => 'http://www.opengis.net/def/serviceType/ogc/wcs',
:fgdc => 'http://www.opengis.net/cat/csw/csdgm',
:mods => 'http://www.loc.gov/mods/v3',
:iso19139 => 'http://www.isotc211.org/schemas/2005/gmd/',
:iiif => 'http://library.stanford.edu/iiif/image-api/1.1/context.json',
:html => 'http://www.w3.org/1999/xhtml',
:url => 'http://schema.org/url'
}
URIs = Geoblacklight::Constants::URI

def parse_dct n
doc = JSON.parse(File.open("spec/fixtures/test-dct-references#{n}.json").read)
Expand Down
65 changes: 42 additions & 23 deletions spec/fixtures/test-dct-references4.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,59 @@
{
"uuid": "urn:hul.harvard.edu:HARVARD.SDE.TG95VATAZPY",
"dc_description_s": "This datalayer displays the Traffic Analysis Zones (TAZ) for the state. A traffic analysis zone (TAZ) is a statistical entity delineated by state or local transportation officials for tabulating traffic-related census data-especially journey-to-work and place-of-work statistics. A TAZ usually consists of one or more census blocks, block groups, or census tracts. For the 1990 census, TAZs were defined as part of the Census Transportation Planning Package (CTPP). The U.S. Census Bureau first provided data for TAZs in conjunction with the 1980 census, when it identified them as ''traffic zones.'' Each TAZ is identified by a six-character alphanumeric code that is unique within county or statistically equivalent entity. For the 1990 census, TAZ codes were unique within CTPP area, which generally conformed to a metropolitan area.",
"uuid": "urn:hul.harvard.edu:HARVARD.SDE2.ESRI04LAKES",
"dc_description_s": "World Lakes represents the major lakes and inland seas within the world.",
"dc_format_s": "Shapefile",
"dc_identifier_s": "urn:hul.harvard.edu:HARVARD.SDE.TG95VATAZPY",
"dc_identifier_s": "urn:hul.harvard.edu:HARVARD.SDE2.ESRI04LAKES",
"dc_language_s": "English",
"dc_publisher_s": "U.S. Department of Commerce, Bureau of the Census",
"dc_rights_s": "Public",
"dc_publisher_s": "ESRI",
"dc_rights_s": "Restricted",
"dc_subject_sm": [
"transportation",
"Census",
"Transportation",
"Traffic",
"surveys"
"Lakes",
"Seas",
"Bodies",
"of",
"water",
"Hydrography",
"inlandWaters",
"polygon",
"lakes",
"seas",
"hydrography"
],
"dc_title_s": "Census Traffic Analysis Zones, 1995 - Virginia",
"dc_title_s": "ESRI Data Maps 2004 : World Lakes",
"dc_type_s": "Dataset",
"dct_references_s": "{\"http://www.opengis.net/cat/csw/csdgm\":\"http://example.com/urn:hul.harvard.edu:HARVARD.SDE.TG95VATAZPY/fgdc.xml\",\"http://library.stanford.edu/iiif/image-api/1.1/context.json\":\"http://example.com/iiif\"}",
"dct_references_s": "{\"http://www.opengis.net/cat/csw/csdgm\":\"http://example.com/urn:hul.harvard.edu:HARVARD.SDE2.ESRI04LAKES/fgdc.xml\",\"http://iiif.io/api/image\":\"http://example.com/iiif\"}",
"dct_spatial_sm": [
"Virginia"
"Earth",
"Northern",
"Hemisphere",
"Southern",
"Eastern",
"Western",
"Africa",
"Asia",
"Europe",
"North",
"America",
"South",
"Polar",
"regions"
],
"dct_temporal_sm": [
"1995"
"1992"
],
"dct_issued_s": "2000",
"dct_provenance_s": "Harvard",
"georss_box_s": "36.540738 -80.262078 39.466012 -75.867044",
"georss_polygon_s": "39.466012 -80.262078 39.466012 -75.867044 36.540738 -75.867044 36.540738 -80.262078 39.466012 -80.262078",
"layer_slug_s": "harvard-tg95vatazpy",
"layer_id_s": "sde:SDE.TG95VATAZPY",
"georss_box_s": "-16.606264 -125.123318 67.046936 109.965",
"georss_polygon_s": "67.046936 -125.123318 67.046936 109.965 -16.606264 109.965 -16.606264 -125.123318 67.046936 -125.123318",
"layer_slug_s": "harvard-esri04lakes",
"layer_id_s": "sde:SDE2.ESRI04LAKES",
"layer_geom_type_s": "Polygon",
"layer_modified_dt": "2014-05-27T18:09:36Z",
"solr_bbox": "-80.262078 36.540738 -75.867044 39.466012",
"solr_ne_pt": "39.466012,-75.867044",
"solr_sw_pt": "36.540738,-80.262078",
"solr_geom": "ENVELOPE(-80.262078, -75.867044, 39.466012, 36.540738)",
"solr_year_i": 1995,
"solr_bbox": "-125.123318 -16.606264 109.965 67.046936",
"solr_ne_pt": "67.046936,109.965",
"solr_sw_pt": "-16.606264,-125.123318",
"solr_geom": "ENVELOPE(-125.123318, 109.965, 67.046936, -16.606264)",
"solr_year_i": 1992,
"solr_issued_dt": "2000-01-01T00:00:00Z",
"solr_wms_url": "http://hgl.harvard.edu:8080/geoserver/wms",
"solr_wfs_url": "http://hgl.harvard.edu:8080/geoserver/wfs"
Expand Down

0 comments on commit 6a38a8e

Please sign in to comment.