Restricting a freebase search query to results that have only the type "/common/topic" - api

I'm trying to find results from a search where all the topics in the result have only the type: "/common/type". For instance, if I search for "BBQ Chicken" I'd like to get back "/en/barbecue_chicken" as the first, and, perhaps, only result, since it has no other types associated with it besides "/common/topic"
I did see an answer to a similar question at:
Freebase search_api and excluding results by specified type but I understand that mql_filter is no longer supported in the new api.
Also, I found an mql query that returns all topics that have only type "/common/topic" in the MQL Cookbook, but haven't been able to find a way to use it in search.
http://wiki.freebase.com/wiki/MQL_Cookbook#Find_untyped_topics_.28or_which_only_have_a_given_type.29

Freebase is a free open database that anyone can contribute to. Assuming that "BBQ Chicken" will never have another type assigned to it is not a good assumption to make. In fact, you should probably assume that over time most Freebase topics will acquire some type in addition to /common/topic.
I've gone ahead and added the type /food/dish so that now you can reliably find BBQ Chicken using the Search API like this:
https://www.googleapis.com/freebase/v1/search?query=BBQ+Chicken&type=/food/dish

Related

How to know which of the query terms returned the search result?

I'm using the Bing API for searches and I have some terms in the query. I would like to know if there is any way for me to know which of the words used in the search was found in each result. Example: "Corruption" AND [IBAMA|"Car Wash"]
I may have some results for corruption but I need to know which ones are related to IBAMA and which ones are related to the Car Wash operation.
It's possible?

Get Knowledge Article Record Type using REST API

Is it possible to get the record type of articles using REST API? I can get a list of articles using this
/services/data/v38.0/support/knowledgeArticles?sort=ViewScore&channel=App&pageSize=3
but there's no record type available. Please help me. Thank You
Knowledge articles are spread across multiple objects. Try querying (or probably better to search with SOSL) the KnowledgeArticleVersion (Id, Title, Summary, ArticleType, KnowledgeArticleId) object and then depending on the article type you can search that specific knowledge article version object (__kav) for example Test__kav to get the specific article.
In summary try:
/services/data/v38.0/sobjects/KnowledgeArticleVersion
and then the article types specific to your org
Edit
This might be easier:
/services/data/v37.0/query/?q=SELECT+Id,+ArticleType,+KnowledgeArticleId+FROM+KnowledgeArticleVersion+WHERE+PublishStatus='online'
You might need to add language code if u have multiple languages enabled, but this would tell you the Article type for the articles in question

How to find the composedBy relation in dbpedia?

Look at this query:
construct {?symphony dct:composedBy <http://dbpedia.org/resource/Category:Symphonies_by_Ludwig_van_Beethoven>}
{
?symphony dct:subject <http://dbpedia.org/resource/Category:Symphonies_by_Ludwig_van_Beethoven>
}
You can run it over this endpoint:
http://dbpedia.org/sparql/
You will get results, so far so good:
I tried to get the music work for Beethoven by using the dct:subject, well ... that's no so correct, because it lists just the symphonies, there should be a relation to list all the works for Beethoven, including sonatas and strings ... do you know that property please?
Plus, I tried the subject property on some opera composers and the results were films that use the opera's opening for that composer as the theam for that movie. so we can see that the subject property is not good to get the musical works, i am looking for help to find something like composed by
here should be a relation to list all the works for Beethoven, including sonatas and strings
I don't see why that's necessarily the case; DBpedia only contains what people put into it, and that information, even if it's present in Wikipedia, isn't necessarily stored in a way that DBpedia can extract it.
It looks like you've got a reasonably good handle on how to explore DBpedia data, though, and that same kind of process can be helpful here. But if you're interested in what links to Beethoven, then you can have a look at the corresponding resources. This may have varied results.
For instance, if you look at the resource for Für Elise, you'll see there's no property directly linking it to the composer (and since those pages show properties in the reverse direction, too, there's no link from Beethoven to the piece, either). That's enough to show that DBpedia doesn't necessarily have the data you're looking for.
However, there is a property that might be useful, dct:subject dbc:Compositions_by_Ludwig_van_Beethoven. Based on that, you might be able to modify your query to use something like:
?symphony dct:subject dbc:Compositions_by_Ludwig_van_Beethoven
That's no guarantee, but this process of exploring the data looking for relevant bits is probably the best bet for finding this information.

AtTask API Documentation / Examples

I am struggling with the AtTask API. Specifically, I'm finding the documentation to be confusing and the examples to be very limited. For instance, the API supports "Named Queries" but there seems to be no listing or documentation of them. One point says that they are listed under "Actions" in the API Explorer, but I find very little there, and the named query that is used in the example "myWork" is not listed.
Can anyone point me to better documentation or examples? I can muddle through by trial and error, writing all my own queries, but it would be nice to know if there is already a Named Query that does what I need to do. For Instance, I need to get a list of assigned tasks. myWork returns a list of tasks that have already started, but I also need the work requests.
Any help will be greatly appreciated.
Thanks,
Mark
There is no question that the AtTask documentation is very weak and that undocumented features exist. Very frustrating. One thing that does help sometimes is to call the meta data for an object.
To view a tasks meta data go to cl02.attask-ondemand.com/attask/api/v4.0/task/metadata
Then just copy and paste the result on this page http://json.parser.online.fr/
It's not the best, but I found a few undocumented features that way.
Regarding getting a list of assigned tasks, I would consider just querying the tasks object with a user ID set as the search critera. Something like
cl02.attask-ondemand.com/attask/api/v4.0/task/search?method=get&assignedToID=5419c3e90001c026e1b72b7014e8e694

Use the Apple Search API to search by genre?

Is it possible to use the Apple Search API to search by genre ? I'm thinking specifically games in the app store. Using Obj-c.
As has been pointed out in the comments of this question...
Search Apple App store by genre with iOS/Obj-c
There seems to be a problem with trying to search by genre, so I'm looking for answers which of examples of that actually working, not just links to the docs.
It's not actually documented on the Search API documentation, but you can add a genreId parameter to the search URL and it restricts the search to a particular genre.
If you look at the JSON returned from a search for "Yelp", there are 4 interesting things:
"genreIds":["6005", "6001"]
"genres":["Social Networking", "Weather"]
"primaryGenreName":"Social Networking"
"primaryGenreId":6005
Adding &genreId=6001 to a URL will find apps in the US in the "Weather" category. I'm using the search term "Check" in the URL.
https://itunes.apple.com/search?term=Check&country=us&entity=software&genreId=6001
Because it's not documented, you can't rely on it working forever. You may also be able to use the primaryGenreName as a parameter, I didn't try that. You'll have to figure out what numbers correspond to what categories too.
The Search API is documented here: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
You can use this link to generate an RSS Feed of your liking. Without knowing too much about how you intend to use it, I would suggest looking at these two solutions and using the best one that suits your needs.