Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Add EXAMPLE_OF_WORK relations that link directly to Audio/MediaObject
Browse files Browse the repository at this point in the history
Because workExample links to CreativeWorkInterface, we can't use the
auto-generated filters to query a more specific type, e.g.:
  MusicComposition(filter:{workExample:{contentUrl_not:null}})
doesn't work because contentUrl is part of MediaObject not CreativeWork.

We add additional fields using the same relation name that point
directly to the concrete types that we use in TROMPA. This means that
the workExample relation still works, but if we need to filter on a
specific Audio/MediaObject field we can. This isn't very sustainable
because we'd have to add it every time we need to do this kind of query
to a specific type, but it's a quick fix for our current requirements
  • Loading branch information
alastair committed Feb 4, 2021
1 parent 980f539 commit 3d4f9a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/schema/type/MusicComposition.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ type MusicComposition implements MetadataInterface & SearchableInterface & Thing
video: [VideoObject] @relation(name: "VIDEO", direction: "OUT")
"https://schema.org/workExample"
workExample: [CreativeWorkInterface] @relation(name: "EXAMPLE_OF_WORK", direction: "IN")
"https://schema.org/workExample"
workExampleMediaObject: [MediaObject] @relation(name: "EXAMPLE_OF_WORK", direction: "IN")
"https://schema.org/workExample"
workExampleAudioObject: [AudioObject] @relation(name: "EXAMPLE_OF_WORK", direction: "IN")
"https://bib.schema.org/workTranslation"
workTranslation: [CreativeWorkInterface] @relation(name: "WORK_TRANSLATION", direction: "OUT")
#######################################
Expand Down

0 comments on commit 3d4f9a8

Please sign in to comment.