Skip to content

Commit

Permalink
Merge pull request #1012 from sul-dlss/simpler-meta-format
Browse files Browse the repository at this point in the history
Simpler meta format
  • Loading branch information
jcoyne authored May 30, 2024
2 parents e9581bd + d81206d commit a720969
Show file tree
Hide file tree
Showing 42 changed files with 54 additions and 42 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ The RuboCop style enforcement can be run without running the tests

Deployment is handled automatically via Jenkins when a release is published to GitHub.

## Data
Purl data is stored in a pair-tree structure starting at `Settings.document_cache_root`. In each pair-tree is a file called `cocina.json` which is the public representation of the current version of the object. There is also a `meta.json` file that holds information about where this object is released to. The `meta.json` is not versionable data. Additionally there is an XML file called `public` which has a representation of the object that was derived from `cocina.json`.

## Search engine indexing

Only items with "PURL sitemap" release tag are included in the sitemap and all other items have a "noindex" meta tag.
Only items with "PURL sitemap" release tag (in `meta.json`) are included in the sitemap and all other items have a "noindex" meta tag.

Structured metadata in the form of schema.org markup is generated to enhance discoverability of datasets and videos. [More info about schema.org markup](https://docs.google.com/document/d/1BO10k_zSTqqT1YmlCg5oE4tOsGXiqmHzQyb6itZypwo).
Structured metadata in the form of schema.org markup is generated to enhance discoverability of datasets and videos. [More info about schema.org markup](https://docs.google.com/document/d/1BO10k_zSTqqT1YmlCg5oE4tOsGXiqmHzQyb6itZypwo).
9 changes: 9 additions & 0 deletions app/models/purl_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,23 @@ def containing_purl_collections

# Can be crawled / indexed by a crawler, e.g. Googlebot
def crawlable?
return meta_json['sitemap'] if meta_json.key?('sitemap')

# This is for handling the older format of meta.json
true_targets.include?('PURL sitemap')
end

def released_to_searchworks?
return meta_json['searchworks'] if meta_json.key?('searchworks')

# This is for handling the older format of meta.json
true_targets.include?('Searchworks')
end

def released_to_earthworks?
return meta_json['earthworks'] if meta_json.key?('earthworks')

# This is for handling the older format of meta.json
true_targets.include?('Earthworks')
end

Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/bb/000/br/0025/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/bb/051/dp/0564/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/bb/157/hs/6068/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/bb/631/ry/3167/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/bb/737/zp/0787/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/bd/786/fy/6312/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/bh/502/xm/3351/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/cd/027/gx/5097/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/cp/088/pb/1682/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": ["Searchworks"] }
{ "searchworks": true, "earthworks": false, "sitemap": true }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/cz/128/vq/0535/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/gx/074/xz/5520/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/nd/387/jf/5675/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/py/305/sy/7961/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/qf/794/pv/6287/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/rs/276/tc/2764/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/ss/099/gb/5528/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/tx/027/jv/4938/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/wm/135/gp/2721/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/wp/335/yr/5649/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
2 changes: 1 addition & 1 deletion spec/fixtures/document_cache/yk/677/wc/8843/meta.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": ["Searchworks"] }
{ "searchworks": true, "earthworks": false, "sitemap": true }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "true_targets": [] }
{ "searchworks": false, "earthworks": false, "sitemap": false }

0 comments on commit a720969

Please sign in to comment.