Queries

Queries are used to retrieve information from the CE

Person

trompace.queries.person.query_person(identifier: str = None, contributor: str = None, creator: str = None, source: str = None, language: str = None, format_: str = None, name: str = None, family_name: str = None, given_name: str = None, return_items_list: list = ['identifier', 'name'])

Returns a query for retrieving a person or people.

Parameters
  • identifier – The identifier of the person in the CE.

  • contributor – The main URL of the site where the information about the Person was taken from

  • creator – The person, organization or service who is creating this Person (e.g. URL of the software)

  • source – The URL of the web resource where information about this Person is taken from

  • language – The language the metadata is written in.

  • format_ – The mimetype of the resource indicated by source

  • name – The name of the person

  • family_name – The family name of the person

  • given_name – The given name of the person

  • return_items_list – A list of item fields that the query must return.

Returns

The string for a person query.

MusicComposition

trompace.queries.musiccomposition.query_musiccomposition(identifier: str = None, title: str = None, contributor: str = None, creator: str = None, source: str = None, inlanguage: str = None, name: str = None, position: int = None, filter_: dict = None, return_items: Union[list, str] = None)

Returns a query for querying the database for a music composition. :param identifier: The identifier of the music composition in the CE. :param title: The title of the resource indicated by source :param creator: The person, organization or service who created the thing the web resource is about. :param contributor: A person, an organization, or a service responsible for contributing the music composition to the web resource. This can be either a name or a base URL. :param source: The source URL that an item comes from :param inlanguage: The language of the music composition. Currently supported languages are en,es,ca,nl,de,fr :param name: The name of the music composition. :param position: In the case that this is a movement of a larger work (e.g. a Symphony), the position of this

MusicComposition in the larger one.

Parameters
  • filter_ – return nodes with this custom filter

  • return_items – return these items in the response

Returns

The string for the quereing the music composition.

Raises

UnsupportedLanguageException if the input language is not one of the supported languages.

MediaObject

trompace.queries.mediaobject.query_mediaobject(identifier: str = None, creator: str = None, contributor: str = None, encodingformat: str = None, source: str = None, contenturl: str = None, inlanguage: str = None, filter_: dict = None, return_items: Union[list, str] = None)

Returns a query for querying the database for a media object. :param identifier: The identifier of the media object in the CE. :param creator: The person, organization or service who created the thing the web resource is about. :param contributor: A person, an organization, or a service responsible for contributing the media object to the web resource. This can be either a name or a base URL. :param encodingformat: A MimeType of the format of object encoded by the media object. :param source: The URL of the web resource to be represented by the node. :param contenturl: The URL of the content encoded by the media object. :param inlanguage: The language of the media object. Currently supported languages are en,es,ca,nl,de,fr. :param filter_: return nodes with this custom filter :param return_items: return these items in the response

Returns

The string for the quereing the media object.

Raises

UnsupportedLanguageException if the input language is not one of the supported languages.