Last active
October 7, 2016 10:31
-
-
Save rossjones/31456fbb249c51787c06a824b45d72ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="application/ld+json"> | |
{ | |
"@context": "http://schema.org", | |
"@type": "Dataset", | |
"@id": "{% url_for 'dataset_read', id=c.pkg_dict.name, qualified=True %}", | |
"name": "{{ c.pkg_dict.title }}", | |
"description": "{{ c.pkg_dict.notes }}", | |
"catalog": { | |
"@type": "DataCatalog", | |
"@id": "{% url_for 'search',qualified=True %}" | |
}, | |
"publisher": { | |
"@type": "Organization", | |
"@id": "{% url_for 'organization_read', id=c.pkg_dict.organization.name, qualified=True %}" | |
}, | |
"distribution": [ {% for resource in c.pkg_dict.resources %} | |
{ | |
"@type": "DataDownload", | |
"@id": "{% url_for controller='package',action='resource_read', id=c.pkg_dict.name,resource_id=resource.id, qualified=True %}", | |
"contentURL": "{{ resource.url }}", | |
{% if resource.mimetype %}"fileFormat": "{{ resource.mimetype }}",{% endif %} | |
"encodingFormat": "{{ resource.format }}" | |
}{% if not loop.last %},{% endif %}{% endfor %} | |
] | |
} | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment