Rating¶
-
trompace.mutations.rating.
create_rating
(*, creator: str, bestrating: int, ratingvalue: int = None, worstrating: int = None, ratingexplanation: str = None, additionaltype: str = None)¶ Return a mutation for making a Rating. A Rating (https://schema.org/Rating) is an evaluation on a numeric scale.
- Parameters
creator – a URI to the identity of the user who created this DefinedTerm
bestrating – The highest value allowed in this rating system
ratingvalue – The rating for the content.
worstrating (optional) – The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.
ratingexplanation (optional) – A freeform text box describing why this rating was given
additionaltype (optional) – A schema.org additionalType used to categorise this Rating
- Returns
A GraphQL Mutation to create a Rating in the Trompa CE
-
trompace.mutations.rating.
create_rating_definition
(*, creator: str, bestrating: int, worstrating: int, name: str = None)¶ Return a mutation for making a Rating definition. A Rating (https://schema.org/Rating) is an evaluation on a numeric scale. A Rating definition describes the structure that a rating can take. It is used so that an annotation tool can give a title and present an input according to the correct scale (e.g. 1-5 or 1-100).
This is a helper method that requires a bestrating and worstrating value and automatically sets additionaltype to RATING_DEFINITION_ADDITIONAL_TYPE
A name is recommended if multiple ratings are going to be shown on the same annotator, but isn’t necessary.
-
trompace.mutations.rating.
delete_rating
(identifier: str)¶ Return a mutation for deleting a Rating.
- Parameters
identifier – The identifier of the Rating to delete
- Returns
A GraphQL Mutation to delete a Rating from the Trompa CE
-
trompace.mutations.rating.
rating_add_was_derived_from_rating
(rating_id: str, original_rating_id: str)¶ Generate a mutation to link two ratings with the prov:wasDerivedFrom relation
- Parameters
rating_id – the id of the new rating
original_rating_id – the id of the original rating from which rating_id was derived
- Returns
A GraphQL Mutation for MergeRatingWasDerivedFrom
-
trompace.mutations.rating.
rating_remove_was_derived_from_rating
(rating_id: str, original_rating_id: str)¶ Generate a mutation to remove the prov:wasDerivedFrom relation between two ratings
- Parameters
rating_id – the id of the new rating
original_rating_id – the id of the original rating from which rating_id was derived
- Returns
A GraphQL Mutation for RemoveRatingWasDerivedFrom