Comments (2)
example:
Aerial has county
and region
both schema_map to contentLocation
.
Which results in repeating contentLocation
key, like:
{
"@context": "http://schema.org",
"@type": "CreativeWork",
"dateCreated": "1934",
"description": "Black and white 1934 vertical air photo taken from aircraft, by the Washington National Guard.",
"contentLocation": "Clearwater County (Idaho)",
"contentLocation": "Sheep Mountain",
"encodingFormat": "image/jpeg",
"isPartOf": "Idaho Historical Aerial Photographs",
"image": "https://digital.lib.uidaho.edu/digital/iiif/uiiap/256/full/max/0/default.jpg",
"thumbnailUrl": "https://digital.lib.uidaho.edu/utils/getthumbnail/collection/uiiap/id/256",
"url": "https://www.lib.uidaho.edu/digital/aerial/items/aerial256.html"
}
Should look like:
{
"@context": "http://schema.org",
"@type": "CreativeWork",
"dateCreated": "1934",
"description": "Black and white 1934 vertical air photo taken from aircraft, by the Washington National Guard.",
"contentLocation": ["Clearwater County (Idaho)","Sheep Mountain"],
"encodingFormat": "image/jpeg",
"isPartOf": "Idaho Historical Aerial Photographs",
"image": "https://digital.lib.uidaho.edu/digital/iiif/uiiap/256/full/max/0/default.jpg",
"thumbnailUrl": "https://digital.lib.uidaho.edu/utils/getthumbnail/collection/uiiap/id/256",
"url": "https://www.lib.uidaho.edu/digital/aerial/items/aerial256.html"
}
Not impossible, but involves adding a ton of Liquid to catch repeating schema_map content.
from collectionbuilder-cdm-template.
example insane Liquid:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "CreativeWork",
{%- assign schema = site.data.config-metadata | where_exp: 'item', 'item.schema_map != nil' | group_by: "schema_map" -%}
{%- assign schema-fields = schema | map: 'name' | uniq -%}
{%- for f in schema-fields -%}
{%- assign fields = schema | where: 'name',f | map: 'items' | map: 'field' -%}
{% if fields.size > 1 %}
{% capture values %}{% for t in fields %}{% if page[t] %}{{ page[t] }}||{% endif %}{% endfor %}{%- endcapture -%}
{%- assign values = values | split: "||" | compact -%}
{% if values != empty %}"{{ f }}": {{ values | jsonify }},{% endif %}
{%- else -%}
{% if page[fields.first] %}"{{ f }}": {{ page[fields.first] | jsonify }},{%- endif -%}
{%- endif -%}
{% endfor %}
"isPartOf": {{ site.title | jsonify }},
{% if page.format contains 'image' %}"image": "{% include image/original.html %}",{% endif %}
"thumbnailUrl": "{% include image/thumb.html %}",
"url": {{ page.url | absolute_url | jsonify }}
}
</script>
from collectionbuilder-cdm-template.
Related Issues (20)
- collection update HOT 1
- collection update
- Collection update
- collection update HOT 1
- collection update
- collection update
- Collection update HOT 3
- Collection update HOT 1
- collection update
- add object link to metadata.json and metadata.csv template
- consider modifying page_gen to be a CB specific version
- plpc photos collection update to rights
- spec_hm / historicalmaps update HOT 1
- standalone objects clean up
- migrate standalone spec exhibits
- cities-new HOT 2
- font updates HOT 8
- main branch protection rule
- MIGRATE all collections!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collectionbuilder-cdm-template.