Skip to content

Commit 54550ad

Browse files
authored
Merge pull request #2050 from codalab/datasets_updates
`Datasets PR#2` Croissant metadata added
2 parents 349b32e + 38f1da8 commit 54550ad

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/apps/api/serializers/datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Meta:
2727
'was_created_by_competition',
2828
'competition',
2929
'file_name',
30+
'license'
3031

3132
)
3233
read_only_fields = (

src/templates/datasets/detail.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
{% extends "base.html" %}
2+
3+
{% block extra_head %}
4+
<!-- JSON LD Script for Dataset Search -->
5+
<script type="application/ld+json">
6+
{
7+
"@context": {
8+
"@language": "en",
9+
"@vocab": "https://schema.org/",
10+
"croissant": "https://mlcommons.org/croissant/1.0"
11+
},
12+
"conformsTo": "http://mlcommons.org/croissant/1.0",
13+
"@type": "Dataset",
14+
"name": "{{ object.name|escape }}",
15+
"description": "{{ object.description|escape }}",
16+
"url": "{{ request.build_absolute_uri }}",
17+
"creator": {
18+
"@type": "Person",
19+
"name": "{{ object.created_by|escape }}"
20+
},
21+
"datePublished": "{{ object.created_when }}",
22+
"license": {
23+
"@type": "CreativeWork",
24+
"name": "{{ object.license|escape }}"
25+
},
26+
"citation": "-",
27+
"version": 1.0
28+
}
29+
</script>
30+
{% endblock %}
31+
32+
233
{% block content %}
334
<dataset-detail
435
id='{{ object.id }}'

0 commit comments

Comments
 (0)