Gracenote API: List of Genres - gracenote

Is there a way to retrieve all "genre" field list? I've seen it was the case for contribution/production types: I'm using Gracenote web api.
I've also noticed that "IPGCategorie" L1/L2 values looks a lot like "Genre" field values... Is there a relation between them?
EDIT: Sorry for not pointing this before, but i'm talking about the Movie/Video API

I think you should first refer to the 'eyeQ Web API reference' document found in the following page: https://developer.gracenote.com/eyeq.
Starting from 'FIELDVALUES' section in page 17, it has the exact information you are looking for.
There are L1 and L2 IPGCATEGORY values.
The following is a sample query taken from the document.
<QUERIES>
<AUTH>
<CLIENT>client_id_string</CLIENT>
<USER>user_id_string</USER>
</AUTH>
<LANG>eng</LANG>
<QUERY CMD="FIELDVALUES">
<FIELDNAME>IPGCATEGORY_L1</FIELDNAME>
<MEDIASPACE>VIDEO</MEDIASPACE>
</QUERY>
</QUERIES>

To get the list of genres (or moods, or eras) you need to make a call to the "fieldvalues" API, you can see how to do it here:
https://developer.gracenote.com/rhythm-api#attribute-station
This call will give you the list of supported genres:
https://cXXXXXXX.web.cddbp.net/webapi/json/1.0/radio/fieldvalues?fieldname=RADIOGENRE&client=CLIENT_ID&user=USER_ID
You can then use the returned ID's with pygn.createRadio()

Related

Trouble getting a SPARQL query using a URI

I'm having trouble acquiring instances from a subclass on Protege using SPARQL. The task is to create an ontology using information from a Website. To start this I have tried to get the contact information such as the Email addresses and Phone Numbers. I have provided screenshots of the Classes and Individual Tabs below:
Classes:
Individuals:
I want it to display a list of the two email addresses. I heard there was a way to get them using the URI.
How do I get the URI and how do I enter it after the rdf:type in the query's code?
As you can see in your screenshot, the URI of the 'Contact Email' class is http://www.semanticweb.org/cthom/ontologies/2021/untitled-ontology-34#Contact_Email. So, to get all instances of this class, you can use the following SPARQL query:
select ?contactEmail
where { ?contactEmail a <http://www.semanticweb.org/cthom/ontologies/2021/untitled-ontology-34#Contact_Email> }
Tip: try one of the online SPARQL tutorials to get a bit more familiar with the language.

How to display the output that Microsoft Graph API returns

In running the graph API that is given as sample: https://graph.microsoft.com/v1.0/me/, it returns an output in the screen
What info is it returning and how can I use it in a user interface....
The easiest way to see what info is returned and try out different calls is to use the Graph Explorer at https://graph.microsoft.io/en-us/graph-explorer.
Otherwise, check the documentation at https://graph.microsoft.io/en-us/docs.
That API endpoint (https://graph.microsoft.com/v1.0/me/) return the user profile.
Here is the detail: https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/user_get
You can use the information however you wish on your client (e.g., display list of current licenses, display user information for confirmation and updates, etc.). Other user-related methods are here: https://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/user

Meteor: Single-Document Subscription

Whenever I encounter code snippets on the web, I see something like
Meteor.subscribe('posts', 'bob-smith');
The client can then display all posts of "bob-smith".
The subscription returns several documents.
What I need, in contrast, is a single-document subscription in order to show an article's body field. I would like to filter by (article) id:
Meteor.subscribe('articles', articleId);
But I got suspicious when I searched the web for similar examples: I cannot find even one single-document subscription example.
What is the reason for that? Why does nobody use single-document subscriptions?
Oh but people do!
This is not against any best practice that I know of.
For example, here is a code sample from the github repository of Telescope where you can see a publication for retrieving a single user based on his or her id.
Here is another one for retrieving a single post, and here is the subscription for it.
It is actually sane to subscribe only to the data that you need at a given moment in your app. If you are writing a single post page, you should make a single post publication/subscription for it, such as:
Meteor.publish('singleArticle', function (articleId) {
return Articles.find({_id: articleId});
});
// Then, from an iron-router route for example:
Meteor.subscribe('singleArticle', this.params.articleId);
A common pattern that uses a single document subscription is a parameterized route, ex: /posts/:_id - you'll see these in many iron:router answers here.

Firebase REST API Query Parameters?

Is it possible to filter data returned by the Firebase REST API using query parameters? I don't see it mentioned one way or an other in the docs, but the client libraries support it, so I'm hoping it's possible. Thanks.
It might be a bit late to answer, but Firebase does allow querying data via REST.
You can use the orderby option together with limitToLast, startAt etc just like you would when using the SDK.
Checkout the Firebase guide for more details
I fought a little bit to have it working.
I actually needed 2 things:
combine limitToLast with orderBy as mentioned by idan
URL getUrl = new URL( url + "news.json?orderBy=\"timestamp\"&limitToLast=5" );
add a rule in the database to declare an index on this "column"
"news" : { ".indexOn": "timestamp" }
Firebase provides querying parameters. However, I don't think they are the querying parameters you are expecting them to be, which are ones that filter data. Firebase REST API provides querying options like auth, print, callback, format, and download. Check docs here
Without ordering by certain field, By combining params orderBy="$key" and limitToLast=5 you can get the last 5 of inserted data ordered by it's key
The documentation can be looked at here

Obtaining topic description in search api

I seem to be having problem pulling out the text content of the following query without making another call:
http://tinyurl.com/mgsewz2 via the mqlread api
{
"id": "/en/alcatraz_island",
"/common/topic/description": [{}],
"/common/topic/topic_equivalent_webpage": [],
"/common/topic/official_website": null
}
I can't retrieve the following
description
equivalent webpage (I'm looking for the en wiki page)
, but I can obtain the official_website url.
It looks like I can get it via the search api via output= but I can't walk through the entire set that I'm looking for without getting search request is too large error.
http://markmail.org/message/hd6pcveta7bhuz25#query:+page:1+mid:u7xegxlhtmhwiqbl+state:results
Thanks!
It you want to download large subsets of Freebase data, your best bet is to use the Freebase RDF Dumps. They contain all the properties that you listed above.

Resources