From ef53fb90dec0e7a7b686a593b887a092ff3476d7 Mon Sep 17 00:00:00 2001 From: Alastair Porter Date: Wed, 10 Mar 2021 14:14:31 +0100 Subject: [PATCH] feat(schema): Add Rating "templates" --- src/routes/helpers/jsonld/Rating.json | 12 ++++++++++++ src/schema/type/Rating.graphql | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/routes/helpers/jsonld/Rating.json b/src/routes/helpers/jsonld/Rating.json index cb4ebe3..415ac0e 100644 --- a/src/routes/helpers/jsonld/Rating.json +++ b/src/routes/helpers/jsonld/Rating.json @@ -93,6 +93,18 @@ "url": [ "https://schema.org/url" ], + "wasGeneratedBy": [ + "http://www.w3.org/ns/prov#wasGeneratedBy" + ], + "wasDerivedFrom": [ + "http://www.w3.org/ns/prov#wasDerivedFrom" + ], + "wasAttributedTo": [ + "http://www.w3.org/ns/prov#wasAttributedTo" + ], + "used": [ + "http://www.w3.org/ns/prov#used" + ], "author": [ "https://schema.org/author" ], diff --git a/src/schema/type/Rating.graphql b/src/schema/type/Rating.graphql index c8a8ff6..05e6112 100644 --- a/src/schema/type/Rating.graphql +++ b/src/schema/type/Rating.graphql @@ -1,5 +1,5 @@ "https://schema.org/Rating" -type Rating implements ThingInterface { +type Rating implements ThingInterface & ProvenanceEntityInterface { ### Metadata properties ### "http://purl.org/dc/terms/identifier,https://schema.org/identifier" identifier: ID @id @@ -61,6 +61,17 @@ type Rating implements ThingInterface { "https://schema.org/url" url: String + ############################################ + ### ProvenanceEntityInterface properties ### + "http://www.w3.org/ns/prov#wasGeneratedBy" + wasGeneratedBy: [ActionInterface] @relation(name: "WAS_GENERATED_BY", direction: OUT) + "http://www.w3.org/ns/prov#wasDerivedFrom" + wasDerivedFrom: [ThingInterface] @relation(name: "WAS_DERIVED_FROM", direction: OUT) + "http://www.w3.org/ns/prov#wasAttributedTo" + wasAttributedTo: [LegalPersonInterface] @relation(name: "WAS_ATTRIBUTED_TO", direction: OUT) + "http://www.w3.org/ns/prov#used" + used: [ThingInterface] @relation(name: "USED", direction: OUT) + ######################### ### Rating properties ### "https://schema.org/author" @@ -70,7 +81,7 @@ type Rating implements ThingInterface { "https://pending.schema.org/ratingExplanation" ratingExplanation: String "https://schema.org/ratingValue" - ratingValue: Int! + ratingValue: Int "https://schema.org/reviewAspect" reviewAspect: String "https://schema.org/worstRating"