---
name: "MusicBrainz::Queries"
section: "3pm"
platform: "linux"
package: "libmusicbrainz-queries-perl"
version: "0.11-1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/MusicBrainz::Queries"
---

# MusicBrainz::Queries(3pm)

MusicBrainz::Queries - MusicBrainz RDF Query Constants

```
  use MusicBrainz::Queries qw(:all);
```

This module is used to provide access to the RDF Query Constants used by the MusicBrainz::Client module for querying the MusicBrainz server.\
 **EXPORT** None by default.\
 **Exportable constants** Return the Artist ID of the currently selected Album. This may return the artist  id for the Various Artists' artist, and then you should check the artist for each track of the album seperately with MBE\_AlbumGetArtistName,  MBE\_AlbumGetArtistSortName and MBE\_AlbumGetArtistId. Return the name of the artist for this album. Return the sortname of the artist for this album.  Return the ID of the currently selected Album. Return the name of the currently selected Album. Return the release status of the currently selected Album. Return the release type of the currently selected Album. Return the Amazon.com ASIN for the currently selected Album. Return the artist Id of the nth track in the album. Requires a  track index ordinal. 1 for the first track, etc... Return the artist name of the nth track in the album. Requires  a track index ordinal. 1 for the first track, etc... Return the artist sortname of the nth track in the album.  Requires a track index ordinal. 1 for the first track, etc... Return the nth cdindex of the album. Requires a index  ordinal. 1 for the first cdindex, etc...  Return the number of cdindexds returned in this query. Return the number of release dates for the currently selected Album Return the mumber of tracks in the currently selected Album Return the track duration of the nth track in the album.  Requires a track index ordinal. 1 for the first track, etc... Return the Id of the nth track in the album. Requires a  track index ordinal. 1 for the first track, etc... Return the track list of an album. This extractor should  only be used to specify a list for *get\_ordinal\_from\_list()*. Return the track name of the nth track in the album.  Requires a track index ordinal. 1 for the first track, etc... Return the track number of the nth track in the album.  Requires a track index ordinal. 1 for the first track, etc... Return the ID of the nth album. Requires an ordinal  argument to select an album from a list of albums in  the current artist. Return the name of the nth album. Requires an ordinal  argument to select an album from a list of albums in  the current artist. Return the ID of the currently selected Album. Return the name of the currently selected Album Return the sort name of the currently selected Album Return the Auth Challenge data from the Auth Query  This query will be used internally by the client library. Return the Session Id from the Auth Query. This query  will be used internally by the client library. Internal use only. Return the number of albums returned in this query. Return the number of artist returned in this query. Return the number of lookup results returned in this query. Return the number of tracks returned in this query. Return the number of trmids returned in this query. Get the general return status of this query.  Values for this include OK or fuzzy. Fuzzy is  returned when the server made a fuzzy match  somewhere while handling the query.  Return the artist id associated with the album of the lookup result. Return the album id of the lookup result. Return the artist id of the lookup result. Return the relevance of the lookup result. Return the artist id associated with the track of the lookup result. Return the track id of the lookup result. Return the type of the lookup result. Internal use only. Return the name of the album. Return the id of the artist. Return the name of the artist. Return the sort name of the artist. Return the track duration. Return the MB track id. Return the name of the track. Return the number of the track. Return the country in which the album was released Return the date the album was released Return the CDIndex ID from the table of contents from the CD. Return the first track number from the table of contents from the CD. Return the last track number (total number of tracks on the CD)  from the table of contents from the CD. Return the number of sectors for the nth track. One ordinal  argument must be given to specify the track. Track 1 is a  special lead-out track, and the actual track 1 on a CD can  be retrieved as track 2 and so forth. Return the sector offset from the nth track. One ordinal  argument must be given to specify the track. Track 1 is a  special lead-out track, and the actual track 1 on a CD can  be retrieved as track 2 and so forth. Return the Id of the artist for this track. Return the name of the artist for this track. Return the sortname of the artist for this track. Return the track duration in the currently selected track. Return the ID of the currently selected track. Return the name of the currently selected track. Return the track number in the currently selected track. Get the type of an advanced relationships ilnk. Pleaes note that these relatnship types can change over time! Get the direction of a link between two like entities. This data element will only be present for links between like types (eg artist-artist links) and IFF the link direction is reversed of what the RDF implies. Get the artist id that this link points to. Get the artist name that this link points to. Get the album id that this link points to. Get the album name that this link points to. Get the vocal/instrument attributes. Must pass an ordinal to indicate which attribute to get.  Get the track id that this link points to. Get the track name that this link points to. Get the URL that this link points to. The MusicBrainz artist id used to indicate that an  album is a various artist album. Internal use only.  This query is use to start an authenticated  session with the MB server. The username is sent  to the server, and the server responds with session  id and a challenge sequence that the client needs to  use to create a session key. The session key and session id need to be provided with the MBQ\_SubmitXXXX  functions in order to give moderators/users credit  for their submissions. This query will be carried out  by the client libary automatically -- you should  not need to use it. Lookup metadata for one file. This function can be  used by tagging applications to attempt to match a  given track with a track in the database. The server  will attempt to match an artist, album and track  during three phases. If at any one lookup phase the  server finds ONE item only, it will move on to to  the next phase. If no items are returned, an error message is returned. If more then one item is returned,  the end-user will have to choose one from the returned  list and then make another call to the server. To  express the choice made by a user, the client should  leave the artistName/albumName empty and provide the  artistId and/or albumId empty on the subsequent call.  Once an artistId or albumId is provided the server will  pick up from the given Ids and attempt to resolve the  next phase. Use this query to find albums by name. This function  returns an albumList for the given album name. Use this query to find artists by name. This function  returns an artistList for the given artist name. Use this function to find TRM Ids that match a given  artistName and trackName, This query returns a trmidList. Use this query to find tracks by name. This function  returns a trackList for the given track name. Retrieve an albumList from a given Album id. Retrieve an artistList from a given Artist id. Use this query to look up a CD from MusicBrainz.  This query will examine the CD-ROM in the CD-ROM  drive specified by *set\_device()* and then send  the CD-ROM data to the server. The server will  then find any matching CDs and return then as  an albumList. Use this query to return an albumList for  the given CD Index Id. Use this query to examine the table of contents  of a CD. This query will examine the CD-ROM in  the CD-ROM drive specified by *set\_device()*, and  then let the use extract data from the table of  contents using the MBQ\_TOCXXXXX functions. No  live net connection is required for this query.  Retrieve an trackList from a given Track id. Retrieve an trackList from a given TRM Id. Use this query to return the basic metadata  information (artistname, albumname,  trackname, tracknumber) for a given track mb id. Internal use only. Submit a single TrackId, TRM Id pair to  MusicBrainz. This query can handle only one  pair at a time, which is inefficient. The  user may wish to create the query RDF text by  hand and provide more than one pair in the  rdf:Bag, since the server can handle up  to 1000 pairs in one query. Use this query to return the metadata  information (artistname, albumname,  trackname, tracknumber) for a given trm id.  Optionally, you can also specifiy the basic  artist metadata, so that if the server  cannot match on the TRM id, it will attempt  to match based on the basic metadata.  In case of a TRM collision (where one TRM  may point to more than one track) this  function will return more than on track.  The user (or tagging app) must decide  which track information is correct. Retrieve an artistList with advanced relationships from a given artist id Retrieve an albumList with advanced relationships from a given album id Retrieve a trackList with advanced relationships from a give track id Use this query to change the current  context back one level. Use this query to reset the current  context back to the top level of the response. Use this Select Query to select an album from  an query that returns a list of albums. Giving  the argument 1 for the ordinal selects the  first album in the list, 2 the second and  so on. Use MBE\_AlbumXXXXXX queries to  extract data after the select. Use this Select Query to select an artist from  an query that returns a list of artists. Giving  the argument 1 for the ordinal selects the  first artist in the list, 2 the second and so  on. Use MBE\_ArtistXXXXXX queries to extract  data after the select. Use this Select Query to select a CD Index id  from the list. Use this Select Query to select a result from  a lookupResultList. This select will be used  in conjunction with MBQ\_FileLookup. Use this Select Query to select the album  from a lookup result. This select will be  used in conjunction with MBQ\_FileLookup. Use this Select Query to select the artist  from a lookup result. This select will be  used in conjunction with MBQ\_FileLookup. Use this Select Query to select the track  from a lookup result. This select will be  used in conjunction with MBQ\_FileLookup. Use this Select Query to select a Release  date/country from the list. Use this Select Query to select a track  from an query that returns a list of  tracks. Giving the argument 1 for the  ordinal selects the first track in the  list, 2 the second and so on. Use  MBE\_TrackXXXXXX queries to extract  data after the select. Use this Select Query to select an  the corresponding artist from a  track context. MBE\_ArtistXXXXXX  queries to extract data after the select. Use this Select Query to select an the  corresponding artist from a track  context. MBE\_ArtistXXXXXX queries to  extract data after the select. Use this Select Query to select a  trmid from the list. Use this Select Query to select a relationship from a list  advanced relationships.  Use this Select Query to select an the corresponding artist from an album   context. MBE\_ArtistXXXXXX queries to extract data after the select.  MusicBrainz::Client http://www.musicbrainz.org/docs/mb\_client/queries\_8h.html Sander van Zoest, \<svanzoest@cpan.org\> Copyright 2003-2006 by Alexander van Zoest This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
