[Developers] Developers Digest, Vol 19, Issue 2

Faye Harris faye at metaweb.com
Wed Sep 3 18:12:36 UTC 2008


Hi Qi,

The argument "strict" is used with "type" to restrict results to those
of a certain type, with varying restrictions depending on the value of
"strict".

When "strict" is "false", it doesn't require results to NOT be in the
type specified, rather, it tells the search engine that the results
don't have to be of that type. You didn't see a difference in your query
because with a limit of 1 and the search string of "madonna", unless you
require type to not be of /people/person, the search engine will return
the most relevant match, which happens to be the singer Madonna. Had you
increased the limit or chosen a different type, you would've seen a
difference in your query results.

For instance, compare the following two queries. The first requires
results to have the type /people/person, and the second requires results
to have the type /music/album. Does it make more sense now?

http://www.freebase.com/api/service/search?query=madonna&limit=10&type=/people/person&strict=true
http://www.freebase.com/api/service/search?query=madonna&limit=10&type=/music/album&strict=true

Also, compare them to a query that does not have type restrictions.
Naturally, the results have varying types:
http://www.freebase.com/api/service/search?query=madonna&limit=10

-- Faye



qi li wrote:
> Hi All,
>
> Thanks for all of responds and great helps.
>
> I went through the search API. It is exactly what I want. But I still
> confused with some arguments, "type"
>
> What does this argument of "type" mean? And how to use it? What does
> "statistically incompatible type" and "statistically compatible type"
> mean? I didn't find examples in this page. I try some queries, but
> there is no difference.
>
> http://www.freebase.com/api/service/search?query=Madonna&limit=1&type=/people/person&strict=true
> <http://www.freebase.com/api/service/search?query=Madonna&limit=1&type=/people/person&strict=true>
> http://www.freebase.com/api/service/search?query=Madonna&limit=1&type=/people/person&strict=false
> <http://www.freebase.com/api/service/search?query=Madonna&limit=1&type=/people/person&strict=false>
>
> Best,
> Qi
>
>
>
> On Tue, Sep 2, 2008 at 6:35 PM, <developers-request at freebase.com
> <mailto:developers-request at freebase.com>> wrote:
>
>     Send Developers mailing list submissions to
>     developers at freebase.com <mailto:developers at freebase.com>
>
>     To subscribe or unsubscribe via the World Wide Web, visit
>     http://lists.freebase.com/mailman/listinfo/developers
>     or, via email, send a message with subject or body 'help' to
>     developers-request at freebase.com
>     <mailto:developers-request at freebase.com>
>
>     You can reach the person managing the list at
>     developers-owner at freebase.com <mailto:developers-owner at freebase.com>
>
>     When replying, please edit your Subject line so it is more specific
>     than "Re: Contents of Developers digest..."
>
>
>     Today's Topics:
>
>     1. Re: different search results from freebase & api (Eynard, Davide)
>     2. Re: different search results from freebase & api (Faye Harris)
>     3. Re: different search results from freebase & api (Tim Kientzle)
>     4. Re: different search results from freebase & api (Warren Harris)
>
>
>     ----------------------------------------------------------------------
>
>     Message: 1
>     Date: Wed, 3 Sep 2008 00:29:46 +0000
>     From: "Eynard, Davide" <davide.eynard at hp.com
>     <mailto:davide.eynard at hp.com>>
>     Subject: Re: [Developers] different search results from freebase & api
>     To: "For discussions about MQL, Freebase API and apps built on
>     Freebase" <developers at freebase.com <mailto:developers at freebase.com>>
>     Message-ID:
>     <72AE9D04FE9DD4498133C97A3366DAA744683EC669 at GVW0547EXC.americas.hpqcorp.net
>     <mailto:72AE9D04FE9DD4498133C97A3366DAA744683EC669 at GVW0547EXC.americas.hpqcorp.net>>
>
>     Content-Type: text/plain; charset="us-ascii"
>
>     Hi!
>
>     Yes, actually searching for "Louise Ciccone Ritchie" via the Web
>     interface
>     does a much fuzzier search which, as far as I know, also takes
>     into account
>     "also known as" properties and substrings instead of exact matches.
>
>     In this particular case the name is a substring of an alias of a
>     common topic,
>     so you can find the original topic id and name with a query like
>     the following
>     one:
>
>     {
>     "alias~=" : "Louise Ciccone Ritchie",
>     "id" : null,
>     "name" : null,
>     "type" : "/common/topic"
>     }
>
>     Hope the solution is not too trivial, let me know if you need
>     something more
>     general.
>
>     Cheers,
>
>     da
>
>     From: developers-bounces at freebase.com
>     <mailto:developers-bounces at freebase.com>
>     [mailto:developers-bounces at freebase.com
>     <mailto:developers-bounces at freebase.com>] On Behalf Of qi li
>     Sent: Tuesday, September 02, 2008 5:07 PM
>     To: crism at metaweb.com <mailto:crism at metaweb.com>;
>     developers at freebase.com <mailto:developers at freebase.com>
>     Subject: [Developers] different search results from freebase & api
>
>     Dear All,
>
>     When I played with freebase data and API, I found I could find
>     search results when I used search query of "Louise Ciccone
>     Ritchie" on web page
>     (http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie
>     <http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie>).
>     But I failed at any results when I used MQL query
>     (http://www.freebase.com/api/service/mqlread?queries={%22item%22:{%22query%22:{%22name%22:%22Louise%20Ciccone%20Ritchie%22,%22type%22:[]}}}
>     <http://www.freebase.com/api/service/mqlread?queries=%7B%22item%22:%7B%22query%22:%7B%22name%22:%22Louise%20Ciccone%20Ritchie%22,%22type%22:%5B%5D%7D%7D%7D><http://www.freebase.com/api/service/mqlread?queries=%7b%22item%22:%7b%22query%22:%7b%
>     22name%22:%22Louise%20Ciccone%20Ritchie%22,%22type%22:%5b%5d%7d%7d%7d
>     <http://www.freebase.com/api/service/mqlread?queries=%7b%22item%22:%7b%22query%22:%7b%22name%22:%22Louise%20Ciccone%20Ritchie%22,%22type%22:%5b%5d%7d%7d%7d>>)
>
>     Could anybody tell me the "secret"? I didn't correctly write MQL
>     query or Mediapedia does more work in "Fuzzy" search part, that
>     is, it provides some methods to directly map Louise Ciccone
>     Ritchie to Madonna?
>
>     Thank you very much!
>
>     Best,
>     --
>     Qi Li
>     School of Information Science
>     University of Pittsburgh
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     http://lists.freebase.com/pipermail/developers/attachments/20080903/8b631465/attachment-0001.htm
>
>     ------------------------------
>
>     Message: 2
>     Date: Tue, 02 Sep 2008 17:26:01 -0700
>     From: Faye Harris <faye at metaweb.com <mailto:faye at metaweb.com>>
>     Subject: Re: [Developers] different search results from freebase & api
>     To: "For discussions about MQL, Freebase API and apps built on
>     Freebase" <developers at freebase.com <mailto:developers at freebase.com>>
>     Message-ID: <48BDD999.9080801 at metaweb.com
>     <mailto:48BDD999.9080801 at metaweb.com>>
>     Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>     Hi Qi,
>
>     Search does more than querying topic names. Among other things, it
>     looks
>     for matches to your query in topic aliases, descriptions, and
>     Wikipedia
>     links. In this case, it found a topic ("Madonna") that has an alias of
>     "Madonna Louise Ciccone Ritchie".
>
>     Your MQL query, on the other hand, asks for things with "Louise
>     Ciccone
>     Ritchie" as its name and name only. As you've found out, there is no
>     such thing in Freebase.
>
>     You can learn more about the search API at:
>     http://www.freebase.com/view/guid/9202a8c04000641f8000000006ad84c9
>
>     A very good resource for learning about MQL can be found at:
>     http://www.freebase.com/view/guid/9202a8c04000641f800000000544e13e
>
>     -- Faye
>
>
>     qi li wrote:
>     > Dear All,
>     >
>     > When I played with freebase data and API, I found I could find
>     search
>     > results when I used search query of "Louise Ciccone Ritchie" on web
>     > page
>     >
>     (http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie
>     <http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie>
>     >
>     <http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie
>     <http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie>>).
>     > But I failed at any results when I used MQL query
>     >
>     (http://www.freebase.com/api/service/mqlread?queries={%22item%22:{%22query%22:{%22name%22:%22Louise%20Ciccone%20Ritchie%22,%22type%22:[]}}}
>     <http://www.freebase.com/api/service/mqlread?queries=%7B%22item%22:%7B%22query%22:%7B%22name%22:%22Louise%20Ciccone%20Ritchie%22,%22type%22:%5B%5D%7D%7D%7D>
>     >
>     <http://www.freebase.com/api/service/mqlread?queries=%7B%22item%22:%7B%22query%22:%7B%22name%22:%22Louise%20Ciccone%20Ritchie%22,%22type%22:%5B%5D%7D%7D%7D>)
>     >
>     > Could anybody tell me the "secret"? I didn't correctly write MQL
>     query
>     > or Mediapedia does more work in "Fuzzy" search part, that is, it
>     > provides some methods to directly map Louise Ciccone Ritchie to
>     Madonna?
>     >
>     > Thank you very much!
>     >
>     > Best,
>     > --
>     > Qi Li
>     > School of Information Science
>     > University of Pittsburgh
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > Developers mailing list
>     > Developers at freebase.com <mailto:Developers at freebase.com>
>     > http://lists.freebase.com/mailman/listinfo/developers
>     >
>
>
>
>     ------------------------------
>
>     Message: 3
>     Date: Tue, 2 Sep 2008 17:52:48 -0700
>     From: Tim Kientzle <tim at metaweb.com <mailto:tim at metaweb.com>>
>     Subject: Re: [Developers] different search results from freebase & api
>     To: "For discussions about MQL, Freebase API and apps built on
>     Freebase" <developers at freebase.com <mailto:developers at freebase.com>>
>     Message-ID: <D52DD6BC-D0DB-4FFE-83EA-24447BDBB929 at metaweb.com
>     <mailto:D52DD6BC-D0DB-4FFE-83EA-24447BDBB929 at metaweb.com>>
>     Content-Type: text/plain; charset=WINDOWS-1252; format=flowed;
>     delsp=yes
>
>     You might also try using the "search API", which uses a ranking engine
>     to generate "likely" matches for a piece of text. It's documented
>     here:
>
>     http://www.freebase.com/view/guid/9202a8c04000641f8000000006ad84c9
>
>     This is very different from mqlread: mqlread is best when your
>     constraints have structure (e.g., you're looking for actors who were
>     born in a certain place) and when you want to get all possible
>     matches. In contrast, search is best when you're dealing with
>     informal text entry (Freebase.com uses the search API for autocomplete
>     and basic search functionality) and you only want the "best" matches.
>
>     Tim Kientzle
>
>
>     On Sep 2, 2008, at 5:29 PM, Eynard, Davide wrote:
>
>     > Hi!
>     >
>     > Yes, actually searching for "Louise Ciccone Ritchie" via the Web
>     > interface
>     > does a much fuzzier search which, as far as I know, also takes into
>     > account
>     > ?also known as? properties and substrings instead of exact matches.
>     >
>     > In this particular case the name is a substring of an alias of a
>     > common topic,
>     > so you can find the original topic id and name with a query like the
>     > following
>     > one:
>     >
>     > {
>     > "alias~=" : "Louise Ciccone Ritchie",
>     > "id" : null,
>     > "name" : null,
>     > "type" : "/common/topic"
>     > }
>     >
>     > Hope the solution is not too trivial, let me know if you need
>     > something more
>     > general.
>     >
>     > Cheers,
>     >
>     > da
>     >
>     > From: developers-bounces at freebase.com
>     <mailto:developers-bounces at freebase.com>
>     [mailto:developers-bounces at freebase.com
>     <mailto:developers-bounces at freebase.com>
>     > ] On Behalf Of qi li
>     > Sent: Tuesday, September 02, 2008 5:07 PM
>     > To: crism at metaweb.com <mailto:crism at metaweb.com>;
>     developers at freebase.com <mailto:developers at freebase.com>
>     > Subject: [Developers] different search results from freebase & api
>     >
>     > Dear All,
>     >
>     > When I played with freebase data and API, I found I could find
>     > search results when I used search query of "Louise Ciccone Ritchie"
>     > on web page
>     (http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie
>     <http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie>
>     > ). But I failed at any results when I used MQL query
>     (http://www.freebase.com/api/service/mqlread?queries=
>     > {%22item%22:{%22query%22:{%22name%22:%22Louise%20Ciccone%20Ritchie
>     > %22,%22type%22:[]}}})
>     >
>     > Could anybody tell me the "secret"? I didn't correctly write MQL
>     > query or Mediapedia does more work in "Fuzzy" search part, that is,
>     > it provides some methods to directly map Louise Ciccone Ritchie to
>     > Madonna?
>     >
>     > Thank you very much!
>     >
>     > Best,
>     > --
>     > Qi Li
>     > School of Information Science
>     > University of Pittsburgh
>     > _______________________________________________
>     > Developers mailing list
>     > Developers at freebase.com <mailto:Developers at freebase.com>
>     > http://lists.freebase.com/mailman/listinfo/developers
>
>
>
>     ------------------------------
>
>     Message: 4
>     Date: Tue, 2 Sep 2008 17:28:51 -0700
>     From: Warren Harris <warren at metaweb.com <mailto:warren at metaweb.com>>
>     Subject: Re: [Developers] different search results from freebase & api
>     To: "For discussions about MQL, Freebase API and apps built on
>     Freebase" <developers at freebase.com <mailto:developers at freebase.com>>
>     Message-ID: <1AE275B4-8A57-45CF-84FC-EC90DCFF027C at metaweb.com
>     <mailto:1AE275B4-8A57-45CF-84FC-EC90DCFF027C at metaweb.com>>
>     Content-Type: text/plain; charset="us-ascii"
>
>
>     On Sep 2, 2008, at 5:07 PM, qi li wrote:
>
>     > Dear All,
>     >
>     > When I played with freebase data and API, I found I could find
>     > search results when I used search query of "Louise Ciccone Ritchie"
>     > on web page
>     (http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie
>     <http://www.freebase.com/search?limit=30&start=0&query=Louise+Ciccone+Ritchie>
>     > ). But I failed at any results when I used MQL query
>     (http://www.freebase.com/api/service/mqlread?queries=
>     > {%22item%22:{%22query%22:{%22name%22:%22Louise%20Ciccone%20Ritchie
>     > %22,%22type%22:[]}}})
>     >
>     > Could anybody tell me the "secret"? I didn't correctly write MQL
>     > query or Mediapedia does more work in "Fuzzy" search part, that is,
>     > it provides some methods to directly map Louise Ciccone Ritchie to
>     > Madonna?
>
>     Since names like "Ciccone" appear in the /common/topic/alias property,
>     you could do a query like this:
>
>     http://www.freebase.com/api/service/mqlread?queries={%22item%22
>     <http://www.freebase.com/api/service/mqlread?queries=%7B%22item%22>:
>     {%22query%22:{%22name%22:null,%22/common/topic/alias~=%22:%22Ciccone
>     %22,%22type%22:[]}}}
>
>     However, it sounds like you're interested in general search with mql
>     results, you can use this api instead:
>
>     http://www.freebase.com/api/service/search?query=Ciccone&limit=1
>     <http://www.freebase.com/api/service/search?query=Ciccone&limit=1>
>
>     See http://www.freebase.com/view/guid/9202a8c04000641f8000000006ad84c9
>     for more info.
>
>     Warren
>
>     >
>     >
>     > Thank you very much!
>     >
>     > Best,
>     > --
>     > Qi Li
>     > School of Information Science
>     > University of Pittsburgh
>     >
>     > _______________________________________________
>     > Developers mailing list
>     > Developers at freebase.com <mailto:Developers at freebase.com>
>     > http://lists.freebase.com/mailman/listinfo/developers
>
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     http://lists.freebase.com/pipermail/developers/attachments/20080902/542f91c4/attachment.htm
>     -------------- next part --------------
>     A non-text attachment was scrubbed...
>     Name: smime.p7s
>     Type: application/pkcs7-signature
>     Size: 3739 bytes
>     Desc: not available
>     Url :
>     http://lists.freebase.com/pipermail/developers/attachments/20080902/542f91c4/attachment.bin
>
>     ------------------------------
>
>     _______________________________________________
>     Developers mailing list
>     Developers at freebase.com <mailto:Developers at freebase.com>
>     http://lists.freebase.com/mailman/listinfo/developers
>
>
>     End of Developers Digest, Vol 19, Issue 2
>     *****************************************
>
>
>
>
> -- 
> Qi Li
> School of Information Science
> University of Pittsburgh
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>   



More information about the Developers mailing list