Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding conformsTo to JSON-LD serializer #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ifbcat_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class Meta:

rdf_mapping = dict(
_type='Person',
_conformsTo='https://bioschemas.org/profiles/Person/0.2-DRAFT-2019_07_19',
firstname='givenName',
lastname='familyName',
expertise='expertise',
Expand Down Expand Up @@ -401,11 +402,13 @@ def get_rdf_mapping(self, instance_id=None):
if self.Meta.model.objects.filter(id=instance_id, type='Training course').exists():
return dict(
_type='CourseInstance',
_conformsTo='https://bioschemas.org/profiles/CourseInstance/0.8-DRAFT-2020_10_06',
**self.AbstractEvent_rdf_mapping,
**self.Event_rdf_mapping,
)
return dict(
_type='Event',
_conformsTo='https://bioschemas.org/profiles/Event/0.2-DRAFT-2019_06_14',
**self.AbstractEvent_rdf_mapping,
**self.Event_rdf_mapping,
)
Expand Down Expand Up @@ -458,6 +461,7 @@ class TrainingSerializer(EventSerializer):

rdf_mapping = dict(
_type='Course',
_conformsTo='https://bioschemas.org/profiles/Course/0.9-DRAFT-2020_12_08',
event_set='hasCourseInstance',
**EventSerializer.AbstractEvent_rdf_mapping,
)
Expand Down Expand Up @@ -772,6 +776,7 @@ class Meta:

rdf_mapping = dict(
_type='LearningResource',
_conformsTo='https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE',
# Minimum
name='name',
fileName='alternateName',
Expand Down Expand Up @@ -900,6 +905,7 @@ class Meta:

rdf_mapping = dict(
_type='Organization',
_conformsTo='https://bioschemas.org/profiles/Organization/0.2-DRAFT-2019_07_19',
_slug_name='name',
name='name',
description='description',
Expand Down