From christopher.dummy at gmail.com Thu May 1 22:58:14 2008 From: christopher.dummy at gmail.com (Christopher Dummy) Date: Thu, 1 May 2008 17:58:14 -0500 Subject: [Developers] html entity encoding Message-ID: I've noticed that the results I get back from mqlread's are HTML encoded. But when I send the writes via mqlwrite they should not be encoded, as the items get auto encoded when I retrieve them back. I would have expected it to be the same going both ways. Is there a way to turn of the HTML entity encoding? or at least to find out what entities are being encoded? I've tried searching for the information but cannot find anything. I know it at least does ampersand & -> & less than < -> < greater than > -> > e.g.: "result": { "/user/cotton/default_domain/broadcast/summary": "Soft, classic, hard, and heavy rock & metal, with modern and traditional blues", "id": "/guid/9202a8c04000641f8000000006e55e81" } -- Christopher Cotton Zing/Dell Engineer http://zing.net/ From AVH at zing.net Thu May 1 23:03:23 2008 From: AVH at zing.net (Arthur van Hoff) Date: Thu, 1 May 2008 16:03:23 -0700 Subject: [Developers] html entity encoding In-Reply-To: References: Message-ID: Hi Christopher, You need to set 'escape':false in the query envelope (i.e. not in the query itself). The default is 'escape':'html'. Have fun, Arthur van Hoff > -----Original Message----- > From: developers-bounces at freebase.com [mailto:developers- > bounces at freebase.com] On Behalf Of Christopher Dummy > Sent: Thursday, May 01, 2008 3:58 PM > To: Freebase Developers > Subject: [Developers] html entity encoding > > I've noticed that the results I get back from mqlread's are HTML > encoded. But when I send the writes via mqlwrite they should not be > encoded, as the items get auto encoded when I retrieve them back. I > would have expected it to be the same going both ways. > > Is there a way to turn of the HTML entity encoding? or at least to > find out what entities are being encoded? I've tried searching for > the > information but cannot find anything. > > I know it at least does ampersand & -> & less than < -> < > greater than > -> > > > e.g.: > > "result": { > "/user/cotton/default_domain/broadcast/summary": "Soft, classic, > hard, and heavy rock & metal, with modern and traditional blues", > "id": "/guid/9202a8c04000641f8000000006e55e81" > } > > -- > Christopher Cotton > Zing/Dell Engineer > http://zing.net/ > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From christopher.dummy at gmail.com Thu May 1 23:03:25 2008 From: christopher.dummy at gmail.com (Christopher Dummy) Date: Thu, 1 May 2008 18:03:25 -0500 Subject: [Developers] html entity encoding In-Reply-To: References: Message-ID: Ok, I found out I can put as part of the query string: "escape":false. Can we document this in the mqlread api somewhere? or if it is there, can you tell me where it is? On Thu, May 1, 2008 at 5:58 PM, Christopher Dummy wrote: > I've noticed that the results I get back from mqlread's are HTML > encoded. But when I send the writes via mqlwrite they should not be > encoded, as the items get auto encoded when I retrieve them back. I > would have expected it to be the same going both ways. > > Is there a way to turn of the HTML entity encoding? or at least to > find out what entities are being encoded? I've tried searching for the > information but cannot find anything. > > I know it at least does ampersand & -> & less than < -> < > greater than > -> > > > e.g.: > > "result": { > "/user/cotton/default_domain/broadcast/summary": "Soft, classic, > hard, and heavy rock & metal, with modern and traditional blues", > "id": "/guid/9202a8c04000641f8000000006e55e81" > } > > -- > Christopher Cotton > Zing/Dell Engineer > http://zing.net/ > -- Christopher Cotton Zing/Dell Engineer http://zing.net/ From jg at metaweb.com Fri May 2 01:21:50 2008 From: jg at metaweb.com (John Giannandrea) Date: Thu, 1 May 2008 18:21:50 -0700 Subject: [Developers] html entity encoding In-Reply-To: References: Message-ID: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> Christopher Dummy wrote: > Can we document this in the mqlread api somewhere? or if it is there, > can you tell me where it is? its not currently documented, we will fix this. needless to say, if you turn it off you dont want to be using html as a display medium without further sanitization. -jg From christopher.dummy at gmail.com Fri May 2 14:53:42 2008 From: christopher.dummy at gmail.com (Christopher Dummy) Date: Fri, 2 May 2008 09:53:42 -0500 Subject: [Developers] html entity encoding In-Reply-To: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> References: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> Message-ID: > needless to say, if you turn it off you dont want to be using html as > a display medium without further sanitization. Does it do other things than just escaping the <>& characters? -- Christopher Cotton Zing/Dell Engineer http://zing.net/ From brendan at metaweb.com Fri May 2 17:05:53 2008 From: brendan at metaweb.com (brendan) Date: Fri, 2 May 2008 10:05:53 -0700 Subject: [Developers] html entity encoding In-Reply-To: References: Message-ID: <95A442FE-EF57-4310-B90C-2CB14211F499@metaweb.com> Yes the freebase mqlread service defaults to html escaping. But, metaweb.py on google code actually reverses that; if you call it's mqlread method, it has it's own escape param and if you don't specify an arg, it will assume you want "escape":null. It's a little confusing. Brendan On May 1, 2008, at 4:03 PM, Arthur van Hoff wrote: > Hi Christopher, > > You need to set 'escape':false in the query envelope (i.e. not in the > query itself). > The default is 'escape':'html'. > > Have fun, > > Arthur van Hoff > >> -----Original Message----- >> From: developers-bounces at freebase.com [mailto:developers- >> bounces at freebase.com] On Behalf Of Christopher Dummy >> Sent: Thursday, May 01, 2008 3:58 PM >> To: Freebase Developers >> Subject: [Developers] html entity encoding >> >> I've noticed that the results I get back from mqlread's are HTML >> encoded. But when I send the writes via mqlwrite they should not be >> encoded, as the items get auto encoded when I retrieve them back. I >> would have expected it to be the same going both ways. >> >> Is there a way to turn of the HTML entity encoding? or at least to >> find out what entities are being encoded? I've tried searching for >> the >> information but cannot find anything. >> >> I know it at least does ampersand & -> & less than < -> < >> greater than > -> > >> >> e.g.: >> >> "result": { >> "/user/cotton/default_domain/broadcast/summary": "Soft, classic, >> hard, and heavy rock & metal, with modern and traditional blues", >> "id": "/guid/9202a8c04000641f8000000006e55e81" >> } >> >> -- >> Christopher Cotton >> Zing/Dell Engineer >> http://zing.net/ >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From david at davidflanagan.com Fri May 2 17:29:42 2008 From: david at davidflanagan.com (David Flanagan) Date: Fri, 02 May 2008 10:29:42 -0700 Subject: [Developers] html entity encoding In-Reply-To: References: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> Message-ID: <481B4F86.40804@davidflanagan.com> Christopher Dummy wrote: >> needless to say, if you turn it off you dont want to be using html as >> a display medium without further sanitization. > > Does it do other things than just escaping the <>& characters? > Christopher, I've just written a program to create a topic named: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ????????????????????????????????????????????????????????????????????????????????????????????????????????????? (That name is all the ASCII and ISO-8859-1 characters plus unicode characters for U+2010 to U+201F. I'm not sure whether all those characters will come through in email.) When I read it with mqlread and escape:false, I get the same string back. When I read it back without escape:false, the only characters that get escaped are the angle brackets and the ampersand. No numeric entities came back for the Latin-1 or Unicode characters. I'll cover escape:false in the next update of my MQL documentation. Note, however, that API documentation, like that for mqlread will in the future be more formally and definitively covered here: http://www.freebase.com/view/freebase/metaweb_api_service David Flanagan From david at davidflanagan.com Fri May 2 17:32:17 2008 From: david at davidflanagan.com (David Flanagan) Date: Fri, 02 May 2008 10:32:17 -0700 Subject: [Developers] html entity encoding In-Reply-To: <95A442FE-EF57-4310-B90C-2CB14211F499@metaweb.com> References: <95A442FE-EF57-4310-B90C-2CB14211F499@metaweb.com> Message-ID: <481B5021.7020601@davidflanagan.com> brendan wrote: > Yes the freebase mqlread service defaults to html escaping. But, > metaweb.py on google code actually reverses that; if you call it's > mqlread method, it has it's own escape param and if you don't specify > an arg, it will assume you want "escape":null. It's a little confusing. > > Brendan Are there any legal values for 'escape' other than 'html' and false? Also, are there any other query parameters I don't know about? Here are the ones I know of: query: the query itself escape: we've just discussed this cursor: for breaking a results into chunks as_of_time: for historical queries Anything else I need to document? David From nix at metaweb.com Fri May 2 22:03:49 2008 From: nix at metaweb.com (Nick Thompson) Date: Fri, 02 May 2008 15:03:49 -0700 Subject: [Developers] html entity encoding In-Reply-To: References: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> Message-ID: <481B8FC5.3090902@metaweb.com> it also escapes " to &dquo; so that the returned values are safe in html attribute values as well as in html text. nick Christopher Dummy wrote: >> needless to say, if you turn it off you dont want to be using html as >> a display medium without further sanitization. > > Does it do other things than just escaping the <>& characters? > From david at davidflanagan.com Fri May 2 22:19:45 2008 From: david at davidflanagan.com (David Flanagan) Date: Fri, 02 May 2008 15:19:45 -0700 Subject: [Developers] html entity encoding In-Reply-To: <481B8FC5.3090902@metaweb.com> References: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> <481B8FC5.3090902@metaweb.com> Message-ID: <481B9381.1050105@davidflanagan.com> Nick Thompson wrote: > it also escapes " to &dquo; so that the returned values > are safe in html attribute values as well as in html text. > > nick Not according to my tests, it doesn't. Run this query on sandbox: {"guid":"#9202a8c04000641f80000000082ef550", "name":null} You'll see that &,<, and > are escaped in the name, but " is only given a JSON backslash in the response, not &dquo; Nick, you're probably the one to ask (changing the subject here) whether mqlread has some way of specifying a default language (other than /lang/en) for names. Is there an envelope parameter or HTTP header for this yet? David From nix at metaweb.com Fri May 2 23:44:16 2008 From: nix at metaweb.com (Nick Thompson) Date: Fri, 02 May 2008 16:44:16 -0700 Subject: [Developers] html entity encoding In-Reply-To: <481B9381.1050105@davidflanagan.com> References: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> <481B8FC5.3090902@metaweb.com> <481B9381.1050105@davidflanagan.com> Message-ID: <481BA750.1060007@metaweb.com> hmm, i think &dquo; should probably be used as well, thanks for the reality check. i don't think the default language support in mql is complete yet. it's not so much choosing something other than /lang/en that's the problem - but for practical purposes what you want is "some preferred language, with fallback to /lang/en". it's that fallback part that's tricky. i think it's safe to say that it will be set with the "lang" parameter in the envelope once it's ready though. nick David Flanagan wrote: > Nick Thompson wrote: >> it also escapes " to &dquo; so that the returned values >> are safe in html attribute values as well as in html text. >> >> nick > > Not according to my tests, it doesn't. Run this query on sandbox: > > {"guid":"#9202a8c04000641f80000000082ef550", > "name":null} > > You'll see that &,<, and > are escaped in the name, but " is only given > a JSON backslash in the response, not &dquo; > > Nick, you're probably the one to ask (changing the subject here) whether > mqlread has some way of specifying a default language (other than > /lang/en) for names. Is there an envelope parameter or HTTP header for > this yet? > > David > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From crism at metaweb.com Sat May 3 01:20:07 2008 From: crism at metaweb.com (Christopher R. Maden) Date: Fri, 02 May 2008 18:20:07 -0700 Subject: [Developers] html entity encoding In-Reply-To: <481BA750.1060007@metaweb.com> References: <4FE6C1B9-2329-4B6B-A414-4CD57F16DE2D@metaweb.com> <481B8FC5.3090902@metaweb.com> <481B9381.1050105@davidflanagan.com> <481BA750.1060007@metaweb.com> Message-ID: <481BBDC7.6020002@metaweb.com> Nick Thompson wrote: > i don't think the default language support in mql is > complete yet. it's not so much choosing something other > than /lang/en that's the problem - but for practical purposes > what you want is "some preferred language, with fallback to /lang/en". > it's that fallback part that's tricky. > i think it's safe to say that it will be set with the "lang" parameter > in the envelope once it's ready though. It works. { "lang" : "/lang/fr", "query" : { "id" : "/en/united_states", "name" : null } } Nitpicking (nixpicking?): > hmm, i think &dquo; should probably be used as well, thanks for > the reality check. Uh... " please! If anything. But really not necessary; JSON can escape " with \", and " is only needed inside HTML attributes *as markup*, and so will already have been escaped as &quot;. HTML string: foo Unescaped MQL: "str":"foo" Escaped MQL: "str":<em>foo</em>" HTML string: foo Unescaped MQL: "str":"foo" Escaped MQL: "str":"<em title=\"bar\">foo</em>" HTML string: foo Unescaped MQL: "str":"foo" Escaped MQL: "str":"<em title=\"bar &quot;baz&quot;\">foo</em>" There is no need for MQL escaping to provide ". ~Chris -- Christopher R. Maden Data Architect Metaweb Technologies, Inc. From narphorium at gmail.com Sat May 3 05:25:01 2008 From: narphorium at gmail.com (Shawn Simister) Date: Sat, 03 May 2008 01:25:01 -0400 Subject: [Developers] Great site for company information In-Reply-To: <91A104DC-6F1F-413F-8AA8-6710EA848340@metaweb.com> References: <91A104DC-6F1F-413F-8AA8-6710EA848340@metaweb.com> Message-ID: <481BF72D.1050401@gmail.com> This is a great find. If you look in the section called "Company Histories Part 2" you'll find that there are actually around 9,000 companies covered. There are also 600 biographies of prominent business people. It would be really great to have the appropriate topics in Freebase link back to these articles. Alec Flett wrote: > Hey I was poking around and found this rather useful site: > > http://www.referenceforbusiness.com/ > > More specifically, a whole bunch of "Company history" essays which > describe the history (founding, aquisitions, brands, etc) of many > companies, organized by category of company (Food, Hotels, Insurance, > etc) > http://www.referenceforbusiness.com/history/ > > I found lots of stuff here that I didn't find in Wikipedia or on > company pages (like that Weetabix acquired Barbara's Bakery in 1986: http://www.referenceforbusiness.com/history2/28/Weetabix-Limited.html) > > It only has some 600 companies, but if you're wanting to unearth the > history of your favorite conglomerate, it's pretty good: http://www.referenceforbusiness.com/history2/68/ConAgra-Foods-Inc.html > > Alec > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > From narphorium at gmail.com Sat May 3 06:03:18 2008 From: narphorium at gmail.com (Shawn Simister) Date: Sat, 03 May 2008 02:03:18 -0400 Subject: [Developers] Birthday Query In-Reply-To: <481BF72D.1050401@gmail.com> References: <91A104DC-6F1F-413F-8AA8-6710EA848340@metaweb.com> <481BF72D.1050401@gmail.com> Message-ID: <481C0026.6090702@gmail.com> How do I search for a list of people who's birthday it is today? At first, I though it would be a simple query but now I'm not even sure it's possible. From gordon at metaweb.com Sat May 3 08:05:06 2008 From: gordon at metaweb.com (Gordon Mackenzie) Date: Sat, 3 May 2008 04:05:06 -0400 (EDT) Subject: [Developers] Birthday Query In-Reply-To: <481C0026.6090702@gmail.com> Message-ID: <14625905.229601209801906805.JavaMail.root@h00215> I am not sure exactly what the MQL is, but user Jack created this app to do pretty close to what you desire: http://www.freebase.com/view/guid/9202a8c04000641f8000000004f3f11f ----- Original Message ----- From: "Shawn Simister" To: "For discussions about MQL, Freebase API and apps built on Freebase" Sent: Friday, May 2, 2008 11:03:18 PM (GMT-0800) America/Los_Angeles Subject: [Developers] Birthday Query How do I search for a list of people who's birthday it is today? At first, I though it would be a simple query but now I'm not even sure it's possible. _______________________________________________ Developers mailing list Developers at freebase.com http://lists.freebase.com/mailman/listinfo/developers From narphorium at gmail.com Sat May 3 13:24:41 2008 From: narphorium at gmail.com (Shawn Simister) Date: Sat, 03 May 2008 09:24:41 -0400 Subject: [Developers] Birthday Query In-Reply-To: <14625905.229601209801906805.JavaMail.root@h00215> References: <14625905.229601209801906805.JavaMail.root@h00215> Message-ID: <481C6799.4040406@gmail.com> Oh right. Looks like you just query each year separately. I guess I should have thought of that. Gordon Mackenzie wrote: > I am not sure exactly what the MQL is, but user Jack created this app to do pretty close to what you desire: > > http://www.freebase.com/view/guid/9202a8c04000641f8000000004f3f11f > > > ----- Original Message ----- > From: "Shawn Simister" > To: "For discussions about MQL, Freebase API and apps built on Freebase" > Sent: Friday, May 2, 2008 11:03:18 PM (GMT-0800) America/Los_Angeles > Subject: [Developers] Birthday Query > > How do I search for a list of people who's birthday it is today? > At first, I though it would be a simple query but now I'm not even sure > it's possible. > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > From bryan.cheung at metaweb.com Tue May 6 17:57:35 2008 From: bryan.cheung at metaweb.com (Bryan Cheung) Date: Tue, 6 May 2008 10:57:35 -0700 Subject: [Developers] Proposed change to locations Message-ID: <75F94C95-279A-4E86-B7C1-C1EF2C03617C@metaweb.com> Cross post from the DM list: http://lists.freebase.com/pipermail/data-modeling/2008-May/000744.html Bryan Join the data-modeling list here -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080506/eb1f058a/attachment.htm From christopher.dummy at gmail.com Tue May 6 20:45:18 2008 From: christopher.dummy at gmail.com (Christopher Dummy) Date: Tue, 6 May 2008 15:45:18 -0500 Subject: [Developers] trying to remove weblink, not working Message-ID: I'm going to: http://www.freebase.com/view/en/northwest_public_radio And, I am attempting to remove the Weblink titled, "Feed". I edit the links, click the "x" and then click save. After the save, the link is still in the list. Any ideas why it won't go away? -- Christopher Cotton Zing/Dell Engineer http://zing.net/ From gordon at metaweb.com Tue May 6 21:00:09 2008 From: gordon at metaweb.com (Gordon Mackenzie) Date: Tue, 6 May 2008 14:00:09 -0700 Subject: [Developers] trying to remove weblink, not working In-Reply-To: References: Message-ID: I believe there is an open bug for not being able to delete an existing web link. ~ Gordon <<< gordon at metaweb.com >>> On May 6, 2008, at 1:45 PM, Christopher Dummy wrote: > I'm going to: > > http://www.freebase.com/view/en/northwest_public_radio > > And, I am attempting to remove the Weblink titled, "Feed". I edit the > links, click the "x" and then click save. After the save, the link is > still in the list. > > Any ideas why it won't go away? > > -- > Christopher Cotton > Zing/Dell Engineer > http://zing.net/ > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From gordon at metaweb.com Tue May 6 22:20:45 2008 From: gordon at metaweb.com (Gordon Mackenzie) Date: Tue, 6 May 2008 15:20:45 -0700 Subject: [Developers] trying to remove weblink, not working In-Reply-To: References: Message-ID: <20901128-463D-447E-B61E-D29A9441A98B@metaweb.com> We hope to have this issue fixed in the upcoming release. ~ Gordon <<< gordon at metaweb.com >>> On May 6, 2008, at 2:00 PM, Gordon Mackenzie wrote: > I believe there is an open bug for not being able to delete an > existing web link. > > ~ Gordon > > <<< gordon at metaweb.com >>> > > > > On May 6, 2008, at 1:45 PM, Christopher Dummy wrote: > >> I'm going to: >> >> http://www.freebase.com/view/en/northwest_public_radio >> >> And, I am attempting to remove the Weblink titled, "Feed". I edit the >> links, click the "x" and then click save. After the save, the link is >> still in the list. >> >> Any ideas why it won't go away? >> >> -- >> Christopher Cotton >> Zing/Dell Engineer >> http://zing.net/ >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers > From shah.sumit at gmail.com Wed May 7 19:05:48 2008 From: shah.sumit at gmail.com (Sumit) Date: Wed, 7 May 2008 15:05:48 -0400 Subject: [Developers] More information on '/type/reflect' Message-ID: Hi, Where can I find more reference on the '/type/reflect' properties i.e. /type/reflect/any_master, /type/reflect/any_reverse and /type/reflect/any_value. I see it being used in discussions and mailing lists but was not able to find any info on these topics in the MQL tutorial or the architecture/data model notes. Here is a case/problem that I am trying to solve - Given a person's name and related information like country of birth, profession, etc. find its freebase id. - The query should not rely on specific types like /location/country as the place associated with a persons name could be a state or city or county too. Same with profession, employers, etc. After poking around into lists and discussions I tried the following query which works, at least I think it is working. However I need to read up more on the '/type/reflect' to be confident. { "query" : [ { "/type/reflect/any_master" : [ { "name" : "new zealand" } ], "id" : [], "name" : "peter jackson", "type" : "/people/person" } ] } Thanks. Sumit -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080507/f87e22b8/attachment-0001.htm From david at davidflanagan.com Wed May 7 22:12:01 2008 From: david at davidflanagan.com (David Flanagan) Date: Wed, 07 May 2008 15:12:01 -0700 Subject: [Developers] More information on '/type/reflect' In-Reply-To: References: Message-ID: <48222931.9060105@davidflanagan.com> Sumit wrote: > Hi, > Where can I find more reference on the '/type/reflect' properties i.e. > /type/reflect/any_master, /type/reflect/any_reverse and > /type/reflect/any_value. I see it being used in discussions and mailing > lists but was not able to find any info on these topics in the MQL > tutorial or the architecture/data model notes. As far as I know, no such documentation exists yet. I'm working on updating the MQL tutorial to add it, however. > Here is a case/problem that I am trying to solve > - Given a person's name and related information like country of birth, > profession, etc. find its freebase id. > - The query should not rely on specific types like /location/country as > the place associated with a persons name could be a state or city or > county too. Same with profession, employers, etc. > > After poking around into lists and discussions I tried the following > query which works, at least I think it is working. However I need to > read up more on the '/type/reflect' to be confident. > > { > "query" : [ > { > "/type/reflect/any_master" : [ > { > "name" : "new zealand" > } > ], > "id" : [], > "name" : "peter jackson", > "type" : "/people/person" > } > ] > } Here are my comments on this query: 1) Queries of the id property always return a single value, even when an object has more than one possible id. So you can safely use "id":null 2) When you use a /type/reflect property, you find any property with the value you've specified. If you're interested in the name of the property that has been matched, add "link":null to the clause. 3) For the kind of generic search you're attempting here, it may not be sufficient to just use /type/reflect/any_master. That will only find outgoing links to other objects. It won't find incoming links, and it won't find properties that refer to a value rather than to an object. (So if "new zealand" was a value of /type/text rather than a /location/country object, it wouldn't be found. And suppose that /location/country had a "famous_person_born_here" property and that this was a master property, with its reverse being /people/person/countries_claiming_this_person. Your query using any_master wouldn't find a link like that between Peter Jackson and New Zealand because it is not a master property of /people/person. So here's how you might alter your query [{ "/type/reflect/any_master" : [{ "link":null, "name":"new zealand" }], "/type/reflect/any_reverse" : [{ "link":null, "name":"new zealand", "optional":true }], "/type/reflect/any_value" : [{ "link":null, "value":"new zealand" }], "id" : null, "name" : "peter jackson", "type" : "/people/person" }] Actually, however, the any_value portion of this query doesn't work: it won't let me specify a value for the "value" property, only query it with null. I don't know if this is a bug or a legitimate restriction, so you either have to query all values of /type/text and see if any of them are country names or drop that clause from your query. If you really do care about searching reverse properties as well as outgoing properties, then the problem with the query above is that you've got to put optional:true in both clauses, and you'll get lots of results that don't match either clause. A better way (also not yet documented) perhaps to do this is to query the links between objects: [{ "type":"/type/link", "source": { "type":"/people/person", "name":"peter jackson", "id":null }, "target": {"name":"new zealand"}, "master_property":null, "reverse":null }] This says: "Return the id of a person named peter jackson who has an outgoing or incoming link to or from something named "new zealand". Also return the master property name for the link and tell me whether the link was reversed in this case." Here's a version that looks for links to New Zealand or Screenwriter: [{ "type":"/type/link", "source": { "type":"/people/person", "name":"peter jackson", "id":null }, "target":{ "name":null, "name|=":["new zealand","screenwriter"] }, "master_property":null, "reverse":null }] Like the /type/reflect/any_master query you started with, this /type/link query does not find links that are to /type/text values rather than to objects. To find those, you'd work with the target_value property of the link instead of target. While we're on the topic of undocumented syntax, here's a query that says "Return the id and nationality of people named Peter Jackson but exclude any who are nationals of any country other than New Zealand." This gets you the person you're looking for, plus about four others who don't have the nationality property filled in: [{ "nationality":null, "but:nationality":{ "optional":"forbidden", "name!=":"New Zealand" }, "id" : null, "name" : "peter jackson", "type" : "/people/person" }] I've written some documentation for optional:forbidden and != but it is not published yet. Stay tuned. Hope this helps! David Flanagan > > Thanks. > Sumit > > > ------------------------------------------------------------------------ > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From dcollado at umh.es Thu May 8 12:54:36 2008 From: dcollado at umh.es (Collado Boyer, David) Date: Thu, 8 May 2008 14:54:36 +0200 Subject: [Developers] Mjt 06 and IE Message-ID: <46E06B3F28AD344DBE53103DE027DC9D067486@exmailer2.umhnet.es> Hello, I'm trying to use Mjt library with Internet Explorer but it seems to be not compatible. Do you support IE? With Firefox there is no problem. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080508/b5a3a775/attachment.htm From kendra.kuhl at juggle.com Thu May 8 18:01:41 2008 From: kendra.kuhl at juggle.com (Kendra Kuhl) Date: Thu, 8 May 2008 13:01:41 -0500 Subject: [Developers] Random pick... In-Reply-To: <51F77ECF-6CE0-4ABA-BC7B-52553954DBF2@metaweb.com> References: <51F77ECF-6CE0-4ABA-BC7B-52553954DBF2@metaweb.com> Message-ID: <48234072.0f1d640a.4516.ffff849c@mx.google.com> Does somebody have a query like this handy? Thanks, Kendra From: developers-bounces at freebase.com [mailto:developers-bounces at freebase.com] On Behalf Of John Giannandrea Sent: Tuesday, April 29, 2008 2:11 PM To: For discussions about MQL, Freebase API and apps built on Freebase Subject: Re: [Developers] Random pick... Arthur van Hoff wrote: I need to randomly pick a few topics of a specific type out of Freebase. Any suggestions on how to do this without first requesting the entire list? We dont currently have a good way to do this. One option would be read the first and last timestamped instances of a type and then run rand over the range and pick limit:1 at some random timestamp ranges. -jg -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080508/89feab04/attachment.htm From bryan.cheung at metaweb.com Thu May 8 18:36:19 2008 From: bryan.cheung at metaweb.com (Bryan Cheung) Date: Thu, 8 May 2008 11:36:19 -0700 Subject: [Developers] Proposed change to Organization type Message-ID: Cross post from DM list... http://lists.freebase.com/pipermail/data-modeling/2008-May/000762.html Join the DM list here: http://lists.freebase.com/mailman/listinfo/data-modeling Bryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080508/c9372696/attachment.htm From AVH at zing.net Thu May 8 19:03:16 2008 From: AVH at zing.net (Arthur van Hoff) Date: Thu, 8 May 2008 12:03:16 -0700 Subject: [Developers] Random pick... In-Reply-To: <48234072.0f1d640a.4516.ffff849c@mx.google.com> References: <51F77ECF-6CE0-4ABA-BC7B-52553954DBF2@metaweb.com> <48234072.0f1d640a.4516.ffff849c@mx.google.com> Message-ID: I tried using the timestamp method that JG suggested, but unfortunately the topics are not distributed evenly over the time span. I ended up reading the entire list and one picking at random. In a separate discussion I have suggested to JG that there should be a way to do this with cursors. I would like to be able to find out from a cursor the current position and total number of results that the result set may produce. Also, I want a way to seek the cursor to a given position in a result set. This would be handy in general, for example for paging through a result set, but it would also allow me to pick a random position and seek to it. From: developers-bounces at freebase.com [mailto:developers-bounces at freebase.com] On Behalf Of Kendra Kuhl Sent: Thursday, May 08, 2008 11:02 AM To: 'For discussions about MQL,Freebase API and apps built on Freebase' Subject: Re: [Developers] Random pick... Does somebody have a query like this handy? Thanks, Kendra From: developers-bounces at freebase.com [mailto:developers-bounces at freebase.com] On Behalf Of John Giannandrea Sent: Tuesday, April 29, 2008 2:11 PM To: For discussions about MQL, Freebase API and apps built on Freebase Subject: Re: [Developers] Random pick... Arthur van Hoff wrote: I need to randomly pick a few topics of a specific type out of Freebase. Any suggestions on how to do this without first requesting the entire list? We dont currently have a good way to do this. One option would be read the first and last timestamped instances of a type and then run rand over the range and pick limit:1 at some random timestamp ranges. -jg -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080508/47842e63/attachment-0001.htm From kirrily at metaweb.com Thu May 8 19:09:44 2008 From: kirrily at metaweb.com (Kirrily Robert) Date: Thu, 8 May 2008 12:09:44 -0700 Subject: [Developers] Random pick... In-Reply-To: References: <51F77ECF-6CE0-4ABA-BC7B-52553954DBF2@metaweb.com> <48234072.0f1d640a.4516.ffff849c@mx.google.com> Message-ID: <3A70FBE2-67AA-4DCF-BD00-AF5DD5A46B75@metaweb.com> I think it would be good if we could say "return" : "random" to get a random item, like how you can do "return" : "count" for a count. K. On May 8, 2008, at 12:03 PM, Arthur van Hoff wrote: > I tried using the timestamp method that JG suggested, but > unfortunately the topics are not distributed evenly over the time > span. I ended up reading the entire list and one picking at random. > > In a separate discussion I have suggested to JG that there should be > a way to do this with cursors. I would like to be able to find out > from a cursor the current position and total number of results that > the result set may produce. Also, I want a way to seek the cursor to > a given position in a result set. This would be handy in general, > for example for paging through a result set, but it would also allow > me to pick a random position and seek to it. > > From: developers-bounces at freebase.com [mailto:developers-bounces at freebase.com > ] On Behalf Of Kendra Kuhl > Sent: Thursday, May 08, 2008 11:02 AM > To: 'For discussions about MQL,Freebase API and apps built on > Freebase' > Subject: Re: [Developers] Random pick... > > Does somebody have a query like this handy? > > Thanks, > > Kendra > > From: developers-bounces at freebase.com [mailto:developers-bounces at freebase.com > ] On Behalf Of John Giannandrea > Sent: Tuesday, April 29, 2008 2:11 PM > To: For discussions about MQL, Freebase API and apps built on Freebase > Subject: Re: [Developers] Random pick... > > > Arthur van Hoff wrote: > I need to randomly pick a few topics of a specific type out of > Freebase. > Any suggestions on how to do this without first requesting the > entire list? > > We dont currently have a good way to do this. > One option would be read the first and last timestamped instances of > a type and then run rand over the range and pick limit:1 at some > random timestamp ranges. > -jg > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers -- Kirrily Robert Freebase Community Director kirrily at metaweb.com http://freebase.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080508/8cfd2a0d/attachment.htm From nix at metaweb.com Thu May 8 19:13:06 2008 From: nix at metaweb.com (Nick Thompson) Date: Thu, 08 May 2008 12:13:06 -0700 Subject: [Developers] Mjt 06 and IE In-Reply-To: <46E06B3F28AD344DBE53103DE027DC9D067486@exmailer2.umhnet.es> References: <46E06B3F28AD344DBE53103DE027DC9D067486@exmailer2.umhnet.es> Message-ID: <482350C2.6000809@metaweb.com> that's a bug - IE6 doesn't get as much testing as firefox and safari, but it should work. i'll take a look... nick Collado Boyer, David wrote: > Hello, I?m trying to use Mjt library with Internet Explorer but it seems > to be not compatible. Do you support IE? > > With Firefox there is no problem. > > > > Thanks. > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From alecf at metaweb.com Thu May 8 23:21:47 2008 From: alecf at metaweb.com (Alec Flett) Date: Thu, 8 May 2008 16:21:47 -0700 Subject: [Developers] wicked cool tool for data importer Message-ID: So I've been using list importer a lot lately to suck in lists of things from webpages. My biggest problem lately has been that the text I want to extract on a page is fairly complex - i.e. it's usually the first inside each
  • , but there is a bunch of expository text after the , etc. For example, here's a list of shopping malls owned by "Madison Marquette": http://www.madisonmarquette.com/portfolio/property_listings Note that each entry is separated by a state, and is generally not useful for generalized copy/paste into list importer. This is the tool that has made this much easier, called "XPather" https://addons.mozilla.org/en-US/firefox/addon/1192 Here's how I use it (assume below you've installed XPather) 1) on freebase.com, go to a topic (say http://www.freebase.com/view/guid/9202a8c04000641f80000000082dc986) and on one of the properties you want to import (say, "Shopping centers owned") click the little menu button and click "Import List" 2) Go to the web page with the site you want (say http://www.madisonmarquette.com/portfolio/property_listings) Right click on one of the list item's, in the area that has the text you want to import 3) Click "Show in XPather" 4) Edit the xpath there. In the above example, the path is /html/body/div[@id='mainJoint']/div[@id='subPageMainWhiteBox']/ div[@id='mainMeat']/div[@id='firstColumn']/div[@id='contentBlk']/table/ tbody/tr/td[2]/blockquote[1]/a[3] 5) Remove the last few indexes (the numbers inside the [ ]) - in my case I removed the [2], the [1] and the [3] because I wanted all 's inside this table: /html/body/div[@id='mainJoint']/div[@id='subPageMainWhiteBox']/ div[@id='mainMeat']/div[@id='firstColumn']/div[@id='contentBlk']/table/ tbody/tr/td/blockquote/a 6) click "Eval" - you should get a list item showing just the text in each 7) Click the top item and then shift-click the bottom item (sadly, 'select all' didn't work for me) 8) click the "Inner HTML" tab - you'll get each entry on a separate line, followed by "" - Unfortunately you have to hand-remove each "" line :( 9) Copy this text, then paste this into the list importer back at freebase.com Click "Continue" and continue with your list importing... I'd love to know if anyone has any clipboard-cleanup tools that could get rid of the " lines automatically. Alec From AVH at zing.net Thu May 8 23:25:39 2008 From: AVH at zing.net (Arthur van Hoff) Date: Thu, 8 May 2008 16:25:39 -0700 Subject: [Developers] flag for merge? Message-ID: Hi, I would like to flag two topics for merging using a script. What is the MQL query that I should use? Thanks. ___________________________________________ Arthur van Hoff, Dell-ZING, CTO Software and Services. W: 650-267-2413, F: 650-267-2498, M: 650-283-0842 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080508/cefb40b3/attachment-0001.htm From jg at metaweb.com Fri May 9 00:41:35 2008 From: jg at metaweb.com (John Giannandrea) Date: Thu, 8 May 2008 17:41:35 -0700 Subject: [Developers] flag for merge? In-Reply-To: References: Message-ID: <1C45CF93-5CC7-4587-903F-36A7D30962A2@metaweb.com> Arthur van Hoff wrote: > I would like to flag two topics for merging using a script. > What is the MQL query that I should use? You need to create an instance of '/freebase/duplicate_collection' and populate it. example: http://www.freebase.com/tools/explore/guid/9202a8c04000641f80000000082ddc24 -jg From kurt at metaweb.com Fri May 9 01:00:39 2008 From: kurt at metaweb.com (Kurt Bollacker) Date: Fri, 9 May 2008 01:00:39 +0000 Subject: [Developers] flag for merge? In-Reply-To: References: Message-ID: <20080509010039.GU9609@metaweb.com> On Thu, May 08, 2008 at 04:25:39PM -0700, Arthur van Hoff wrote: > Hi, > > > > I would like to flag two topics for merging using a script. > > What is the MQL query that I should use? Try something like: { "query" : [ { "authority" : "/user/myuserid", "create" : "unconditional", "duplicates" : [ { "id" : "/guid/IDOFFIRSTTOPIC" }, { "id" : "/guid/IDOFSECONDTOPIC" } ], "id" : null, "type" : "/freebase/duplicate_collection" } ] } > > > Thanks. > > > > ___________________________________________ > > Arthur van Hoff, Dell-ZING, CTO Software and Services. > > W: 650-267-2413, F: 650-267-2498, M: 650-283-0842 > > > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From michele.r.berg at gmail.com Fri May 9 04:29:17 2008 From: michele.r.berg at gmail.com (Michele Berg) Date: Thu, 8 May 2008 23:29:17 -0500 Subject: [Developers] wicked cool tool for data importer In-Reply-To: References: Message-ID: <48fc66760805082129g5285b0bcy64ecdd09ab3d3fca@mail.gmail.com> (Assuming you're using a Windows platform) I've used Win32::Clipboard in the past to futz with clipboard contents. Worked fairly well, when I was on a windows machine. Michele On Thu, May 8, 2008 at 6:21 PM, Alec Flett wrote: > So I've been using list importer a lot lately to suck in lists of > things from webpages. > > My biggest problem lately has been that the text I want to extract on > a page is fairly complex - i.e. it's usually the first inside each >
  • , but there is a bunch of expository text after the , etc. > > For example, here's a list of shopping malls owned by "Madison > Marquette": > http://www.madisonmarquette.com/portfolio/property_listings > > Note that each entry is separated by a state, and is generally not > useful for generalized copy/paste into list importer. > > This is the tool that has made this much easier, called "XPather" > https://addons.mozilla.org/en-US/firefox/addon/1192 > > Here's how I use it (assume below you've installed XPather) > > 1) on freebase.com, go to a topic (say > http://www.freebase.com/view/guid/9202a8c04000641f80000000082dc986) > and on one of the properties you want to import (say, "Shopping > centers owned") click the little menu button and click "Import List" > > 2) Go to the web page with the site you want (say > http://www.madisonmarquette.com/portfolio/property_listings) > Right click on one of the list item's, in the area that has the text > you want to import > > 3) Click "Show in XPather" > > 4) Edit the xpath there. In the above example, the path is > /html/body/div[@id='mainJoint']/div[@id='subPageMainWhiteBox']/ > div[@id='mainMeat']/div[@id='firstColumn']/div[@id='contentBlk']/table/ > tbody/tr/td[2]/blockquote[1]/a[3] > > 5) Remove the last few indexes (the numbers inside the [ ]) - in my > case I removed the [2], the [1] and the [3] because I wanted all 's > inside this table: > /html/body/div[@id='mainJoint']/div[@id='subPageMainWhiteBox']/ > div[@id='mainMeat']/div[@id='firstColumn']/div[@id='contentBlk']/table/ > tbody/tr/td/blockquote/a > > 6) click "Eval" - you should get a list item showing just the text in > each > > 7) Click the top item and then shift-click the bottom item (sadly, > 'select all' didn't work for me) > > 8) click the "Inner HTML" tab - you'll get each entry on a separate > line, followed by "" - Unfortunately you have to > hand-remove each "" line :( > > 9) Copy this text, then paste this into the list importer back at > freebase.com Click "Continue" and continue with your list importing... > > I'd love to know if anyone has any clipboard-cleanup tools that could > get rid of the " lines automatically. > > Alec > > _______________________________________________ > Developers mailing list > 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/20080508/e9c296d4/attachment.htm From david at davidflanagan.com Fri May 9 17:28:11 2008 From: david at davidflanagan.com (David Flanagan) Date: Fri, 09 May 2008 10:28:11 -0700 Subject: [Developers] flag for merge? In-Reply-To: <20080509010039.GU9609@metaweb.com> References: <20080509010039.GU9609@metaweb.com> Message-ID: <482489AB.2080405@davidflanagan.com> Kurt Bollacker wrote: > On Thu, May 08, 2008 at 04:25:39PM -0700, Arthur van Hoff wrote: >> Hi, >> >> >> >> I would like to flag two topics for merging using a script. >> >> What is the MQL query that I should use? > > Try something like: > > { > "query" : [ > { > "authority" : "/user/myuserid", > "create" : "unconditional", Kurt, Could you explain the authority property of this type? Why isn't /type/object/creator sufficient? Is there any kind of access control or authentication involved here, or can it be set to any user? David > "duplicates" : [ > { > "id" : "/guid/IDOFFIRSTTOPIC" > }, > { > "id" : "/guid/IDOFSECONDTOPIC" > } > ], > "id" : null, > "type" : "/freebase/duplicate_collection" > } > ] > } > > > >> >> Thanks. >> >> >> >> ___________________________________________ >> >> Arthur van Hoff, Dell-ZING, CTO Software and Services. >> >> W: 650-267-2413, F: 650-267-2498, M: 650-283-0842 >> >> >> > >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > From kirrily at metaweb.com Fri May 9 20:27:14 2008 From: kirrily at metaweb.com (Kirrily Robert) Date: Fri, 9 May 2008 13:27:14 -0700 Subject: [Developers] Discussions about contributing to Freebase Message-ID: Hi all, There are a number of discussions about Freebase that aren't really developer-related or data modeling-related, but are more to do with Freebase in general. For example: * what belongs in Freebase? * which topics/types/domains should be featured on the homepage and data page? * suggestions for data mobs * suggestions for updates to FAQs/documentation * privacy issues and Freebase * talking about how to build the Freebase community * suggestions for Freebase events, activities, etc If anyone's interested in these sort of "meta" discussions, I'd like to invite you to join the Freebase Interest Group called "Meta- contributors", at http://www.freebase.com/view/guid/9202a8c04000641f80000000080d95d4 If you do join, please be sure "watch" the discussions or follow the RSS feed. Thanks! K. -- Kirrily Robert Freebase Community Director kirrily at metaweb.com http://freebase.com/ From zodiac.seven at gmail.com Tue May 13 18:09:31 2008 From: zodiac.seven at gmail.com (Zodiac Seven) Date: Tue, 13 May 2008 23:39:31 +0530 Subject: [Developers] freebase-suggest modification Message-ID: This is more of a javascript question then a freebase one but hoping someone here can help. I am trying to make a call to a webservice in freebase suggest ( http://code.google.com/p/freebase-suggest/) This means I call a web service for every suggestion and depending on that i display the suggestion. freebase.suggest.js Line 528. p.list_receive = function(input, txt, o) {//fb.log("list_receive", input, query, o); // handle errors if (o.status !== '200 OK') { fb.error("list_receive", o.code, o.messages, o); return; } ... var url = 'http://somesite/webservice?callback=mycheckfunction&term=' + suggestKeyWord; // Create a script tag, set its src attribute and add it to the document // This triggers the HTTP request and submits the query var script = document.createElement("script"); script.src = url; document.body.appendChild(script); ... // further logic to add/remove the item My problem is that i'm using document.createElement("script" and since that is async i have no idea of knowing the response of my web service. I could move the further logic into the callback but is there a 'synchronous' way to wait until i get a response from my web service. I can't use xmlHttpRequest because of the cross domain restriction. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080513/8c5cff81/attachment.htm From daepark at metaweb.com Tue May 13 19:27:37 2008 From: daepark at metaweb.com (Dae Park) Date: Tue, 13 May 2008 12:27:37 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: References: Message-ID: You should be able to $.ajax with "jsonp" as the dataType to accomplish what you want. -dae On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > This is more of a javascript question then a freebase one but > hoping someone here can help. > > I am trying to make a call to a webservice in freebase suggest > (http://code.google.com/p/freebase-suggest/) > This means I call a web service for every suggestion and depending > on that i display the suggestion. > > freebase.suggest.js Line 528. > > p.list_receive = function(input, txt, o) {//fb.log("list_receive", > input, query, o); > // handle errors > if (o.status !== '200 OK') { > fb.error("list_receive", o.code, o.messages, o); > return; > } > ... > var url = 'http://somesite/webservice? > callback=mycheckfunction&term=' + suggestKeyWord; > > // Create a script tag, set its src attribute and add it to the > document > // This triggers the HTTP request and submits the query > var script = document.createElement("script"); > script.src = url; > document.body.appendChild(script); > ... > // further logic to add/remove the item > > My problem is that i'm using document.createElement("script" and > since that is async i have no idea of knowing the response of my > web service. > I could move the further logic into the callback but is there a > 'synchronous' way to wait until i get a response from my web service. > I can't use xmlHttpRequest because of the cross domain restriction. > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From daepark at metaweb.com Tue May 13 19:46:58 2008 From: daepark at metaweb.com (Dae Park) Date: Tue, 13 May 2008 12:46:58 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: References: Message-ID: <9DD6F070-3678-4620-99F7-659C41717CA3@metaweb.com> Freebase-suggest is smart enough get around the cross-domain issue so you shouldn't have to meddle with the logic unless your web-service is outputting something that freebase-suggest can't parse. As long as yous webservice looks like what the freebase search api returns (http://code.google.com/p/freebase-suggest/wiki/FreebaseAPISearch), you should be able to just modify the "service_url", "ac_path", "ac_params", and "ac_qstr" options. Your webservice response envelope (JSON) should look something like this: { "status": "200 OK", "code": "/api/status/ok", "result": [{...},...,{...}] } Each individual "result" item can be in any form, however, you will need to modify the default transform method that takes your item and returns some html that will be appended each list item. You should be able to specify a "transform" method in the options as well. The transform method should takes two arguments, data and text, where data is each item in the "result" array and text is the query string. In summary, you should be able to do this: $("myinput").freebaseSuggest({ "service_url": "http://somesite", "ac_path": "/some/webservice" "ac_params" {"some_param": "foo", "some_other_param": "bar"}, "ac_qstr": "term", "transform": function(data, term) { return "some html"; } }) Depending on what html you return from your transform method, you need to provide your own css styles. Hope that helps. -dae On May 13, 2008, at 12:27 PM, Dae Park wrote: > You should be able to $.ajax with "jsonp" as the dataType to > accomplish what you want. > > -dae > > > On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > >> This is more of a javascript question then a freebase one but >> hoping someone here can help. >> >> I am trying to make a call to a webservice in freebase suggest >> (http://code.google.com/p/freebase-suggest/) >> This means I call a web service for every suggestion and depending >> on that i display the suggestion. >> >> freebase.suggest.js Line 528. >> >> p.list_receive = function(input, txt, o) {//fb.log("list_receive", >> input, query, o); >> // handle errors >> if (o.status !== '200 OK') { >> fb.error("list_receive", o.code, o.messages, o); >> return; >> } >> ... >> var url = 'http://somesite/webservice? >> callback=mycheckfunction&term=' + suggestKeyWord; >> >> // Create a script tag, set its src attribute and add it to the >> document >> // This triggers the HTTP request and submits the query >> var script = document.createElement("script"); >> script.src = url; >> document.body.appendChild(script); >> ... >> // further logic to add/remove the item >> >> My problem is that i'm using document.createElement("script" and >> since that is async i have no idea of knowing the response of my >> web service. >> I could move the further logic into the callback but is there a >> 'synchronous' way to wait until i get a response from my web service. >> I can't use xmlHttpRequest because of the cross domain restriction. >> >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From zodiac.seven at gmail.com Wed May 14 15:25:34 2008 From: zodiac.seven at gmail.com (Zodiac Seven) Date: Wed, 14 May 2008 20:55:34 +0530 Subject: [Developers] freebase-suggest modification In-Reply-To: References: Message-ID: Dae, $.ajax is using a async callback too. Isn't there an approach which will work synchronously like XmlHttpRequest? On 5/14/08, Dae Park wrote: > > You should be able to $.ajax with "jsonp" as the dataType to > accomplish what you want. > > -dae > > > > On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > > > This is more of a javascript question then a freebase one but > > hoping someone here can help. > > > > I am trying to make a call to a webservice in freebase suggest > > (http://code.google.com/p/freebase-suggest/) > > This means I call a web service for every suggestion and depending > > on that i display the suggestion. > > > > freebase.suggest.js Line 528. > > > > p.list_receive = function(input, txt, o) {//fb.log("list_receive", > > input, query, o); > > // handle errors > > if (o.status !== '200 OK') { > > fb.error("list_receive", o.code, o.messages, o); > > return; > > } > > ... > > var url = 'http://somesite/webservice? > > callback=mycheckfunction&term=' + suggestKeyWord; > > > > // Create a script tag, set its src attribute and add it to the > > document > > // This triggers the HTTP request and submits the query > > var script = document.createElement("script"); > > script.src = url; > > document.body.appendChild(script); > > ... > > // further logic to add/remove the item > > > > My problem is that i'm using document.createElement("script" and > > since that is async i have no idea of knowing the response of my > > web service. > > I could move the further logic into the callback but is there a > > 'synchronous' way to wait until i get a response from my web service. > > I can't use xmlHttpRequest because of the cross domain restriction. > > > > > _______________________________________________ > > Developers mailing list > > Developers at freebase.com > > http://lists.freebase.com/mailman/listinfo/developers > > _______________________________________________ > Developers mailing list > 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/20080514/8c5890db/attachment.htm From kirrily at metaweb.com Wed May 14 17:22:24 2008 From: kirrily at metaweb.com (Kirrily Robert) Date: Wed, 14 May 2008 10:22:24 -0700 Subject: [Developers] Reconciliation blog post Message-ID: <5F029747-CBCC-4BED-94BF-0F633059F33A@metaweb.com> I think Peter mentioned his reconciliation service here a little while ago. Just wanted to let you know we've just posted about it on the Freebase blog, at http://blog.freebase.com/2008/05/13/new-api-service-reconciliation/ if you want to read some more about it. (There's an RSS feed at http://blog.freebase.com/feed if you want to subscribe to it and save me from having to crosspost like this ;)) K. -- Kirrily Robert Freebase Community Director kirrily at metaweb.com http://freebase.com/ From daepark at metaweb.com Wed May 14 18:53:23 2008 From: daepark at metaweb.com (Dae Park) Date: Wed, 14 May 2008 11:53:23 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: References: Message-ID: I am unaware of any methods invoking something cross domain synchronously. Even if it's possible, I doubt you want the browser to be "blocked" while you are waiting for your response. -dae On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: > Dae, > > $.ajax is using a async callback too. Isn't there an approach which > will > work synchronously like XmlHttpRequest? > > On 5/14/08, Dae Park wrote: >> >> You should be able to $.ajax with "jsonp" as the dataType to >> accomplish what you want. >> >> -dae >> >> >> >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: >> >>> This is more of a javascript question then a freebase one but >>> hoping someone here can help. >>> >>> I am trying to make a call to a webservice in freebase suggest >>> (http://code.google.com/p/freebase-suggest/) >>> This means I call a web service for every suggestion and depending >>> on that i display the suggestion. >>> >>> freebase.suggest.js Line 528. >>> >>> p.list_receive = function(input, txt, o) {//fb.log("list_receive", >>> input, query, o); >>> // handle errors >>> if (o.status !== '200 OK') { >>> fb.error("list_receive", o.code, o.messages, o); >>> return; >>> } >>> ... >>> var url = 'http://somesite/webservice? >>> callback=mycheckfunction&term=' + suggestKeyWord; >>> >>> // Create a script tag, set its src attribute and add it to the >>> document >>> // This triggers the HTTP request and submits the query >>> var script = document.createElement("script"); >>> script.src = url; >>> document.body.appendChild(script); >>> ... >>> // further logic to add/remove the item >>> >>> My problem is that i'm using document.createElement("script" and >>> since that is async i have no idea of knowing the response of my >>> web service. >>> I could move the further logic into the callback but is there a >>> 'synchronous' way to wait until i get a response from my web >>> service. >>> I can't use xmlHttpRequest because of the cross domain restriction. >>> >> >>> _______________________________________________ >>> Developers mailing list >>> Developers at freebase.com >>> http://lists.freebase.com/mailman/listinfo/developers >> >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers >> > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From zodiac.seven at gmail.com Thu May 15 11:11:32 2008 From: zodiac.seven at gmail.com (Zodiac Seven) Date: Thu, 15 May 2008 16:41:32 +0530 Subject: [Developers] freebase-suggest modification In-Reply-To: References: Message-ID: Okay, i guess i will make the results var global and access it from the callback. Is there a freebase api to get the name of the article in wikipedia? so if I have the id as "/en/taj_mahal" and the guid as "#9202a8c04000641f800000000009216a", name as "Taj Mahal" I guess there must be a way to find out the wikipedia article name which is http://en.wikipedia.org/wiki/Taj_mahal On 5/15/08, Dae Park wrote: > > I am unaware of any methods invoking something cross domain > synchronously. Even if it's possible, I doubt you want the browser to > be "blocked" while you are waiting for your response. > > > -dae > > > > On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: > > > Dae, > > > > $.ajax is using a async callback too. Isn't there an approach which > > will > > work synchronously like XmlHttpRequest? > > > > On 5/14/08, Dae Park wrote: > >> > >> You should be able to $.ajax with "jsonp" as the dataType to > >> accomplish what you want. > >> > >> -dae > >> > >> > >> > >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > >> > >>> This is more of a javascript question then a freebase one but > >>> hoping someone here can help. > >>> > >>> I am trying to make a call to a webservice in freebase suggest > >>> (http://code.google.com/p/freebase-suggest/) > >>> This means I call a web service for every suggestion and depending > >>> on that i display the suggestion. > >>> > >>> freebase.suggest.js Line 528. > >>> > >>> p.list_receive = function(input, txt, o) {//fb.log("list_receive", > >>> input, query, o); > >>> // handle errors > >>> if (o.status !== '200 OK') { > >>> fb.error("list_receive", o.code, o.messages, o); > >>> return; > >>> } > >>> ... > >>> var url = 'http://somesite/webservice? > >>> callback=mycheckfunction&term=' + suggestKeyWord; > >>> > >>> // Create a script tag, set its src attribute and add it to the > >>> document > >>> // This triggers the HTTP request and submits the query > >>> var script = document.createElement("script"); > >>> script.src = url; > >>> document.body.appendChild(script); > >>> ... > >>> // further logic to add/remove the item > >>> > >>> My problem is that i'm using document.createElement("script" and > >>> since that is async i have no idea of knowing the response of my > >>> web service. > >>> I could move the further logic into the callback but is there a > >>> 'synchronous' way to wait until i get a response from my web > >>> service. > >>> I can't use xmlHttpRequest because of the cross domain restriction. > >>> > >> > >>> _______________________________________________ > >>> Developers mailing list > >>> Developers at freebase.com > >>> http://lists.freebase.com/mailman/listinfo/developers > >> > >> _______________________________________________ > >> Developers mailing list > >> Developers at freebase.com > >> http://lists.freebase.com/mailman/listinfo/developers > >> > > _______________________________________________ > > Developers mailing list > > Developers at freebase.com > > http://lists.freebase.com/mailman/listinfo/developers > > _______________________________________________ > Developers mailing list > 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/20080515/399f78b6/attachment-0001.htm From zenkat at metaweb.com Thu May 15 13:06:18 2008 From: zenkat at metaweb.com (Brian Karlak) Date: Thu, 15 May 2008 06:06:18 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: References: Message-ID: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> The wikipedia title and ID are stored as the /wikipedia/en and / wikipedia/en_id keys on the topic, and can be retrieved by the following MQL: { "a:key" : [ { "namespace" : "/wikipedia/en", "value" : null } ], "b:key" : { "namespace" : "/wikipedia/en_id", "value" : null }, "guid" : "#9202a8c04000641f800000000009216a" } Currently, all valid titles and redirects for an article are stored in /wikipedia/en. The /wikipedia/en_id key, however, should point to the most recent wikipedia ID for the topic. You can access the wikipedia page with this ID using the following URL: http://en.wikipedia.org/wiki/index.html?curid=82976 Brian On May 15, 2008, at 4:11 AM, Zodiac Seven wrote: > Okay, i guess i will make the results var global and access it from > the callback. > > Is there a freebase api to get the name of the article in wikipedia? > so if I have the id as "/en/taj_mahal" and the guid as > "#9202a8c04000641f800000000009216a", name as "Taj Mahal" > I guess there must be a way to find out the wikipedia article name > which is http://en.wikipedia.org/wiki/Taj_mahal > > On 5/15/08, Dae Park wrote: > I am unaware of any methods invoking something cross domain > synchronously. Even if it's possible, I doubt you want the browser to > be "blocked" while you are waiting for your response. > > > -dae > > > > On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: > > > Dae, > > > > $.ajax is using a async callback too. Isn't there an approach which > > will > > work synchronously like XmlHttpRequest? > > > > On 5/14/08, Dae Park wrote: > >> > >> You should be able to $.ajax with "jsonp" as the dataType to > >> accomplish what you want. > >> > >> -dae > >> > >> > >> > >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > >> > >>> This is more of a javascript question then a freebase one but > >>> hoping someone here can help. > >>> > >>> I am trying to make a call to a webservice in freebase suggest > >>> (http://code.google.com/p/freebase-suggest/) > >>> This means I call a web service for every suggestion and depending > >>> on that i display the suggestion. > >>> > >>> freebase.suggest.js Line 528. > >>> > >>> p.list_receive = function(input, txt, o) {//fb.log("list_receive", > >>> input, query, o); > >>> // handle errors > >>> if (o.status !== '200 OK') { > >>> fb.error("list_receive", o.code, o.messages, o); > >>> return; > >>> } > >>> ... > >>> var url = 'http://somesite/webservice? > >>> callback=mycheckfunction&term=' + suggestKeyWord; > >>> > >>> // Create a script tag, set its src attribute and add it to the > >>> document > >>> // This triggers the HTTP request and submits the query > >>> var script = document.createElement("script"); > >>> script.src = url; > >>> document.body.appendChild(script); > >>> ... > >>> // further logic to add/remove the item > >>> > >>> My problem is that i'm using document.createElement("script" and > >>> since that is async i have no idea of knowing the response of my > >>> web service. > >>> I could move the further logic into the callback but is there a > >>> 'synchronous' way to wait until i get a response from my web > >>> service. > >>> I can't use xmlHttpRequest because of the cross domain > restriction. > >>> > >> > >>> _______________________________________________ > >>> Developers mailing list > >>> Developers at freebase.com > >>> http://lists.freebase.com/mailman/listinfo/developers > >> > >> _______________________________________________ > >> Developers mailing list > >> Developers at freebase.com > >> http://lists.freebase.com/mailman/listinfo/developers > >> > > _______________________________________________ > > Developers mailing list > > Developers at freebase.com > > http://lists.freebase.com/mailman/listinfo/developers > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > _______________________________________________ > Developers mailing list > 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/20080515/7179952c/attachment.htm From zodiac.seven at gmail.com Thu May 15 13:57:16 2008 From: zodiac.seven at gmail.com (Zodiac Seven) Date: Thu, 15 May 2008 19:27:16 +0530 Subject: [Developers] Freebase data sources Message-ID: Does freebase always get it's data from wikipedia? I notice that I see relevant links to other sources like - for actors there is an imdb entry. Is there a list of all possible data sources which I could use for my mashup? Also about the images shown on the side, I notice that the uri always points to http://upload.wikimedia.org... Are there images from any other sources besides wikipedia? Regards, Deepak. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freebase.com/pipermail/developers/attachments/20080515/094bbf61/attachment.htm From tristan at metaweb.com Thu May 15 14:34:10 2008 From: tristan at metaweb.com (Tristan Buckner) Date: Thu, 15 May 2008 07:34:10 -0700 Subject: [Developers] Freebase data sources In-Reply-To: References: Message-ID: Hi Deepak, To answer your second question: All bulk image loads have, so far, been from wikipedia. The freebase.com client has an image upload mechanism, and quite a few have come from that, but the supermajority (of the 679,346 images in freebase) have been from wikipedia. Basically any images created by someone other than mwcl_images (our bot account for image loads) were probably uploaded via the the client, one at a time. Tristan On May 15, 2008, at 6:57 AM, Zodiac Seven wrote: > Does freebase always get it's data from wikipedia? > > I notice that I see relevant links to other sources like - for > actors there is an imdb entry. Is there a list of all possible data > sources which I could use for my mashup? > Also about the images shown on the side, I notice that the uri > always points to http://upload.wikimedia.org... Are there images > from any other sources besides wikipedia? > > Regards, > > Deepak. > _______________________________________________ > Developers mailing list > 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/20080515/4353f87b/attachment.htm From kurt at metaweb.com Thu May 15 15:23:44 2008 From: kurt at metaweb.com (Kurt Bollacker) Date: Thu, 15 May 2008 15:23:44 +0000 Subject: [Developers] Freebase data sources In-Reply-To: References: Message-ID: <20080515152344.GX28995@metaweb.com> On Thu, May 15, 2008 at 07:27:16PM +0530, Zodiac Seven wrote: > Does freebase always get it's data from wikipedia? > > I notice that I see relevant links to other sources like - for actors there > is an imdb entry. Is there a list of all possible data sources which I could > use for my mashup? To answer your first question: A list of (at least some of) the information sources used in, or at least considered for Freebase can be found as instances of our "Information Source" type: http://www.freebase.com/view/dataworld/information_source This is a type for real world entities rather than strictly a list of websites with "mashupable" APIs. Also, we don't include data in Freebase from sources for which there is an incompatible license. I'm not sure if this answers your question. However, it'd be great if you wanted to create a "Web mashup info source" type and fill it in with instances that you find. Kurt :-) From zodiac.seven at gmail.com Thu May 15 15:44:22 2008 From: zodiac.seven at gmail.com (Zodiac Seven) Date: Thu, 15 May 2008 21:14:22 +0530 Subject: [Developers] Freebase data sources In-Reply-To: <20080515152344.GX28995@metaweb.com> References: <20080515152344.GX28995@metaweb.com> Message-ID: Thanks Kurt, Can you tell me how it relates the data sources to entity types, Is there some sort of mapping table? actors-> imdb, anything else: wikipedia. I mean how does it decide when to use wikipedia and when to use imdb. Is this documented somewhere? On 5/15/08, Kurt Bollacker wrote: > > > On Thu, May 15, 2008 at 07:27:16PM +0530, Zodiac Seven wrote: > > Does freebase always get it's data from wikipedia? > > > > I notice that I see relevant links to other sources like - for actors > there > > is an imdb entry. Is there a list of all possible data sources which I > could > > use for my mashup? > > > To answer your first question: > > A list of (at least some of) the information sources used in, or at > least considered for Freebase can be found as instances of our > "Information Source" type: > > http://www.freebase.com/view/dataworld/information_source > > This is a type for real world entities rather than strictly a list of > websites with "mashupable" APIs. Also, we don't include data in > Freebase from sources for which there is an incompatible license. > > I'm not sure if this answers your question. However, it'd be great if > you wanted to create a "Web mashup info source" type and fill it in > with instances that you find. > > > > Kurt :-) > > > _______________________________________________ > Developers mailing list > 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/20080515/c74b4a74/attachment-0001.htm From david at sprout.us Thu May 15 15:44:29 2008 From: david at sprout.us (david at sprout.us) Date: Thu, 15 May 2008 10:44:29 -0500 Subject: [Developers] Developers Digest, Vol 15, Issue 8 Message-ID: <951014798@mail.netwurk.com> Thank you for your email. I will be out of the office until Friday, May 23rd. During this period I will continue checking email periodically. Sincerely, David Repas From zodiac.seven at gmail.com Thu May 15 15:48:27 2008 From: zodiac.seven at gmail.com (Zodiac Seven) Date: Thu, 15 May 2008 21:18:27 +0530 Subject: [Developers] freebase-suggest modification In-Reply-To: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> References: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> Message-ID: Thanks, Would there be a way to tweak freebase suggest to only show topics which exist in wikipedia - I guess I have to not get results which have article:null? I can't find the MQL query which it uses anywhere... On 5/15/08, Brian Karlak wrote: > > > The wikipedia title and ID are stored as the /wikipedia/en and > /wikipedia/en_id keys on the topic, and can be retrieved by the following > MQL: > > { > "a:key" : [ > { > "namespace" : "/wikipedia/en", > "value" : null > } > ], > "b:key" : { > "namespace" : "/wikipedia/en_id", > "value" : null > }, > "guid" : "#9202a8c04000641f800000000009216a" > } > > Currently, all valid titles and redirects for an article are stored in > /wikipedia/en. The /wikipedia/en_id key, however, should point to the most > recent wikipedia ID for the topic. You can access the wikipedia page with > this ID using the following URL: > > http://en.wikipedia.org/wiki/index.html?curid=82976 > > Brian > On May 15, 2008, at 4:11 AM, Zodiac Seven wrote: > > Okay, i guess i will make the results var global and access it from the > callback. > > Is there a freebase api to get the name of the article in wikipedia? > so if I have the id as "/en/taj_mahal" and the guid as > "#9202a8c04000641f800000000009216a", name as "Taj Mahal" > I guess there must be a way to find out the wikipedia article name which is > http://en.wikipedia.org/wiki/Taj_mahal > > On 5/15/08, Dae Park wrote: >> >> I am unaware of any methods invoking something cross domain >> synchronously. Even if it's possible, I doubt you want the browser to >> be "blocked" while you are waiting for your response. >> >> >> -dae >> >> >> >> On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: >> >> > Dae, >> > >> > $.ajax is using a async callback too. Isn't there an approach which >> > will >> > work synchronously like XmlHttpRequest? >> > >> > On 5/14/08, Dae Park wrote: >> >> >> >> You should be able to $.ajax with "jsonp" as the dataType to >> >> accomplish what you want. >> >> >> >> -dae >> >> >> >> >> >> >> >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: >> >> >> >>> This is more of a javascript question then a freebase one but >> >>> hoping someone here can help. >> >>> >> >>> I am trying to make a call to a webservice in freebase suggest >> >>> (http://code.google.com/p/freebase-suggest/) >> >>> This means I call a web service for every suggestion and depending >> >>> on that i display the suggestion. >> >>> >> >>> freebase.suggest.js Line 528. >> >>> >> >>> p.list_receive = function(input, txt, o) {//fb.log("list_receive", >> >>> input, query, o); >> >>> // handle errors >> >>> if (o.status !== '200 OK') { >> >>> fb.error("list_receive", o.code, o.messages, o); >> >>> return; >> >>> } >> >>> ... >> >>> var url = 'http://somesite/webservice? >> >>> callback=mycheckfunction&term=' + suggestKeyWord; >> >>> >> >>> // Create a script tag, set its src attribute and add it to the >> >>> document >> >>> // This triggers the HTTP request and submits the query >> >>> var script = document.createElement("script"); >> >>> script.src = url; >> >>> document.body.appendChild(script); >> >>> ... >> >>> // further logic to add/remove the item >> >>> >> >>> My problem is that i'm using document.createElement("script" and >> >>> since that is async i have no idea of knowing the response of my >> >>> web service. >> >>> I could move the further logic into the callback but is there a >> >>> 'synchronous' way to wait until i get a response from my web >> >>> service. >> >>> I can't use xmlHttpRequest because of the cross domain restriction. >> >>> >> >> >> >>> _______________________________________________ >> >>> Developers mailing list >> >>> Developers at freebase.com >> >>> http://lists.freebase.com/mailman/listinfo/developers >> >> >> >> _______________________________________________ >> >> Developers mailing list >> >> Developers at freebase.com >> >> http://lists.freebase.com/mailman/listinfo/developers >> >> >> > _______________________________________________ >> > Developers mailing list >> > Developers at freebase.com >> > http://lists.freebase.com/mailman/listinfo/developers >> >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers >> > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > > > _______________________________________________ > Developers mailing list > 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/20080515/1ebdbff8/attachment.htm From will.fitzgerald at gmail.com Thu May 15 15:56:44 2008 From: will.fitzgerald at gmail.com (Will Fitzgerald) Date: Thu, 15 May 2008 08:56:44 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> References: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> Message-ID: <937f5e9b0805150856w2846baeap7ec2f6e422e20930@mail.gmail.com> This is more of a data question, but can you tell me whether the titles/redirects (ie /en/wikipedia namespace keys) are ever refreshed, and on what kind of schedule? Will Fitzgerald On 5/15/08, Brian Karlak wrote: > > > The wikipedia title and ID are stored as the /wikipedia/en and > /wikipedia/en_id keys on the topic, and can be retrieved by the following > MQL: > > > { > "a:key" : [ > { > "namespace" : "/wikipedia/en", > "value" : null > } > ], > "b:key" : { > "namespace" : "/wikipedia/en_id", > "value" : null > }, > "guid" : "#9202a8c04000641f800000000009216a" > } > > Currently, all valid titles and redirects for an article are stored in > /wikipedia/en. The /wikipedia/en_id key, however, should point to the most > recent wikipedia ID for the topic. You can access the wikipedia page with > this ID using the following URL: > > http://en.wikipedia.org/wiki/index.html?curid=82976 > > Brian > > > On May 15, 2008, at 4:11 AM, Zodiac Seven wrote: > Okay, i guess i will make the results var global and access it from the > callback. > > Is there a freebase api to get the name of the article in wikipedia? > so if I have the id as "/en/taj_mahal" and the guid as > "#9202a8c04000641f800000000009216a", name as "Taj Mahal" > I guess there must be a way to find out the wikipedia article name which is > http://en.wikipedia.org/wiki/Taj_mahal > > On 5/15/08, Dae Park wrote: > > I am unaware of any methods invoking something cross domain > > synchronously. Even if it's possible, I doubt you want the browser to > > be "blocked" while you are waiting for your response. > > > > > > -dae > > > > > > > > On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: > > > > > Dae, > > > > > > $.ajax is using a async callback too. Isn't there an approach which > > > will > > > work synchronously like XmlHttpRequest? > > > > > > On 5/14/08, Dae Park wrote: > > >> > > >> You should be able to $.ajax with "jsonp" as the dataType to > > >> accomplish what you want. > > >> > > >> -dae > > >> > > >> > > >> > > >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > > >> > > >>> This is more of a javascript question then a freebase one but > > >>> hoping someone here can help. > > >>> > > >>> I am trying to make a call to a webservice in freebase suggest > > >>> (http://code.google.com/p/freebase-suggest/) > > >>> This means I call a web service for every suggestion and depending > > >>> on that i display the suggestion. > > >>> > > >>> freebase.suggest.js Line 528. > > >>> > > >>> p.list_receive = function(input, txt, o) {//fb.log("list_receive", > > >>> input, query, o); > > >>> // handle errors > > >>> if (o.status !== '200 OK') { > > >>> fb.error("list_receive", o.code, o.messages, o); > > >>> return; > > >>> } > > >>> ... > > >>> var url = 'http://somesite/webservice? > > >>> callback=mycheckfunction&term=' + suggestKeyWord; > > >>> > > >>> // Create a script tag, set its src attribute and add it to the > > >>> document > > >>> // This triggers the HTTP request and submits the query > > >>> var script = document.createElement("script"); > > >>> script.src = url; > > >>> document.body.appendChild(script); > > >>> ... > > >>> // further logic to add/remove the item > > >>> > > >>> My problem is that i'm using document.createElement("script" and > > >>> since that is async i have no idea of knowing the response of my > > >>> web service. > > >>> I could move the further logic into the callback but is there a > > >>> 'synchronous' way to wait until i get a response from my web > > >>> service. > > >>> I can't use xmlHttpRequest because of the cross domain restriction. > > >>> > > >> > > >>> _______________________________________________ > > >>> Developers mailing list > > >>> Developers at freebase.com > > >>> http://lists.freebase.com/mailman/listinfo/developers > > >> > > >> _______________________________________________ > > >> Developers mailing list > > >> Developers at freebase.com > > >> http://lists.freebase.com/mailman/listinfo/developers > > >> > > > _______________________________________________ > > > Developers mailing list > > > Developers at freebase.com > > > http://lists.freebase.com/mailman/listinfo/developers > > > > _______________________________________________ > > Developers mailing list > > Developers at freebase.com > > http://lists.freebase.com/mailman/listinfo/developers > > > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > -- Will Fitzgerald weblog: Stop US torture: From zenkat at metaweb.com Thu May 15 16:07:05 2008 From: zenkat at metaweb.com (Brian Karlak) Date: Thu, 15 May 2008 09:07:05 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: <937f5e9b0805150856w2846baeap7ec2f6e422e20930@mail.gmail.com> References: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> <937f5e9b0805150856w2846baeap7ec2f6e422e20930@mail.gmail.com> Message-ID: <16EAB065-12BE-4BFE-BEEB-98A89734804B@metaweb.com> Hi WIll -- We refresh our wikipedia keys on a biweekly schedule, usually (but not always) on alternate Fridays. This cycle updates the /wikipedia/en_id and /wikipedia/en keys for existing topics, adds new topics from new articles, updates blurbs, and handles various other merge / split conditions. There was a talk on this at the latest Freebase User Group meeting. We hope to have a blog post with some more details soon as well. Brian On May 15, 2008, at 8:56 AM, Will Fitzgerald wrote: > This is more of a data question, but can you tell me whether the > titles/redirects (ie /en/wikipedia namespace keys) are ever refreshed, > and on what kind of schedule? From kurt at metaweb.com Thu May 15 18:08:17 2008 From: kurt at metaweb.com (Kurt Bollacker) Date: Thu, 15 May 2008 18:08:17 +0000 Subject: [Developers] Freebase data sources In-Reply-To: References: <20080515152344.GX28995@metaweb.com> Message-ID: <20080515180817.GY28995@metaweb.com> On Thu, May 15, 2008 at 09:14:22PM +0530, Zodiac Seven wrote: > Thanks Kurt, > > Can you tell me how it relates the data sources to entity types, Is there > some sort of mapping table? actors-> imdb, anything else: wikipedia. I mean > how does it decide when to use wikipedia and when to use imdb. Is this > documented somewhere? We usually get instances of more than one type from a single source. For example, we've gotten hundreds from Wikipedia, and at least half a dozen from MusicBrainz. There is no simple mapping table. Provenance information sometimes can be gleaned from the creator of a topic/property, and perusing the list of Mass Data Operations at: http://www.freebase.com/view/dataworld/mass_data_operation We have recently redesigned our representation of provenance information and you should see more evidence of it in the coming months. Also, for the record, we have not included any information directly from IMDB, as their license is not compatible with CC-A. However, we have extracted IMDB keys from Wikipedia (and possibly other license compatible) sources, and our users may have entered URLs by hand. Kurt :-) > On 5/15/08, Kurt Bollacker wrote: > > > > > > On Thu, May 15, 2008 at 07:27:16PM +0530, Zodiac Seven wrote: > > > Does freebase always get it's data from wikipedia? > > > > > > I notice that I see relevant links to other sources like - for actors > > there > > > is an imdb entry. Is there a list of all possible data sources which I > > could > > > use for my mashup? > > > > > > To answer your first question: > > > > A list of (at least some of) the information sources used in, or at > > least considered for Freebase can be found as instances of our > > "Information Source" type: > > > > http://www.freebase.com/view/dataworld/information_source > > > > This is a type for real world entities rather than strictly a list of > > websites with "mashupable" APIs. Also, we don't include data in > > Freebase from sources for which there is an incompatible license. > > > > I'm not sure if this answers your question. However, it'd be great if > > you wanted to create a "Web mashup info source" type and fill it in > > with instances that you find. > > > > > > > > Kurt :-) > > > > > > _______________________________________________ > > Developers mailing list > > Developers at freebase.com > > http://lists.freebase.com/mailman/listinfo/developers > > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From david at sprout.us Thu May 15 18:08:25 2008 From: david at sprout.us (david at sprout.us) Date: Thu, 15 May 2008 13:08:25 -0500 Subject: [Developers] Developers Digest, Vol 15, Issue 9 Message-ID: <951019788@mail.netwurk.com> Thank you for your email. I will be out of the office until Friday, May 23rd. During this period I will continue checking email periodically. Sincerely, David Repas From faye at metaweb.com Thu May 15 18:48:57 2008 From: faye at metaweb.com (Faye Li) Date: Thu, 15 May 2008 11:48:57 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: References: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> Message-ID: <482C8599.70401@metaweb.com> Since many articles are entered/edited by the Freebase community and not imported from Wikipedia, Wikipedia keys are a better indicator for identifying those that are. Sounds like the query you want is asking for only things that have wiki keys. -- Faye Zodiac Seven wrote: > Thanks, > > Would there be a way to tweak freebase suggest to only show topics > which exist in wikipedia - I guess I have to not get results which > have article:null? I can't find the MQL query which it uses anywhere... > > On 5/15/08, *Brian Karlak* > wrote: > > > The wikipedia title and ID are stored as the /wikipedia/en and > /wikipedia/en_id keys on the topic, and can be retrieved by the > following MQL: > > { > "a:key" : [ > { > "namespace" : "/wikipedia/en", > "value" : null > } > ], > "b:key" : { > "namespace" : "/wikipedia/en_id", > "value" : null > }, > "guid" : "#9202a8c04000641f800000000009216a" > } > > Currently, all valid titles and redirects for an article are > stored in /wikipedia/en. The /wikipedia/en_id key, however, > should point to the most recent wikipedia ID for the topic. You > can access the wikipedia page with this ID using the following URL: > > http://en.wikipedia.org/wiki/index.html?curid=82976 > > Brian > > On May 15, 2008, at 4:11 AM, Zodiac Seven wrote: > >> Okay, i guess i will make the results var global and access it >> from the callback. >> >> Is there a freebase api to get the name of the article in wikipedia? >> so if I have the id as "/en/taj_mahal" and the guid as >> "#9202a8c04000641f800000000009216a", name as "Taj Mahal" >> I guess there must be a way to find out the wikipedia article >> name which is http://en.wikipedia.org/wiki/Taj_mahal >> >> On 5/15/08, *Dae Park* > > wrote: >> >> I am unaware of any methods invoking something cross domain >> synchronously. Even if it's possible, I doubt you want the >> browser to >> be "blocked" while you are waiting for your response. >> >> >> -dae >> >> >> >> On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: >> >> > Dae, >> > >> > $.ajax is using a async callback too. Isn't there an >> approach which >> > will >> > work synchronously like XmlHttpRequest? >> > >> > On 5/14/08, Dae Park > > wrote: >> >> >> >> You should be able to $.ajax with "jsonp" as the dataType to >> >> accomplish what you want. >> >> >> >> -dae >> >> >> >> >> >> >> >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: >> >> >> >>> This is more of a javascript question then a freebase one but >> >>> hoping someone here can help. >> >>> >> >>> I am trying to make a call to a webservice in freebase suggest >> >>> (http://code.google.com/p/freebase-suggest/) >> >>> This means I call a web service for every suggestion and >> depending >> >>> on that i display the suggestion. >> >>> >> >>> freebase.suggest.js Line 528. >> >>> >> >>> p.list_receive = function(input, txt, o) >> {//fb.log("list_receive", >> >>> input, query, o); >> >>> // handle errors >> >>> if (o.status !== '200 OK') { >> >>> fb.error("list_receive", o.code, o.messages, o); >> >>> return; >> >>> } >> >>> ... >> >>> var url = 'http://somesite/webservice? >> >>> callback=mycheckfunction&term=' + suggestKeyWord; >> >>> >> >>> // Create a script tag, set its src attribute and add it >> to the >> >>> document >> >>> // This triggers the HTTP request and submits the query >> >>> var script = document.createElement("script"); >> >>> script.src = url; >> >>> document.body.appendChild(script); >> >>> ... >> >>> // further logic to add/remove the item >> >>> >> >>> My problem is that i'm using >> document.createElement("script" and >> >>> since that is async i have no idea of knowing the response >> of my >> >>> web service. >> >>> I could move the further logic into the callback but is >> there a >> >>> 'synchronous' way to wait until i get a response from my web >> >>> service. >> >>> I can't use xmlHttpRequest because of the cross domain >> restriction. >> >>> >> >> >> >>> _______________________________________________ >> >>> Developers mailing list >> >>> Developers at freebase.com >> >>> http://lists.freebase.com/mailman/listinfo/developers >> >> >> >> _______________________________________________ >> >> Developers mailing list >> >> Developers at freebase.com >> >> http://lists.freebase.com/mailman/listinfo/developers >> >> >> > _______________________________________________ >> > Developers mailing list >> > Developers at freebase.com >> > http://lists.freebase.com/mailman/listinfo/developers >> >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers >> >> >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers > > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > > > ------------------------------------------------------------------------ > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers > From zenkat at metaweb.com Thu May 15 18:50:45 2008 From: zenkat at metaweb.com (Brian Karlak) Date: Thu, 15 May 2008 11:50:45 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: <482C8599.70401@metaweb.com> References: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> <482C8599.70401@metaweb.com> Message-ID: <79316FB3-5455-488D-9971-48527E49BF80@metaweb.com> Hi Faye -- I was going to answer this, but I didn't know a key part of his question ... how do you "tweak freebase suggest" to do this? Just curious ... Thanks, Brian On May 15, 2008, at 11:48 AM, Faye Li wrote: > Since many articles are entered/edited by the Freebase community and > not > imported from Wikipedia, Wikipedia keys are a better indicator for > identifying those that are. Sounds like the query you want is asking > for > only things that have wiki keys. > > -- Faye > > Zodiac Seven wrote: >> Thanks, >> >> Would there be a way to tweak freebase suggest to only show topics >> which exist in wikipedia - I guess I have to not get results which >> have article:null? I can't find the MQL query which it uses >> anywhere... >> >> On 5/15/08, *Brian Karlak* > > wrote: >> >> >> The wikipedia title and ID are stored as the /wikipedia/en and >> /wikipedia/en_id keys on the topic, and can be retrieved by the >> following MQL: >> >> { >> "a:key" : [ >> { >> "namespace" : "/wikipedia/en", >> "value" : null >> } >> ], >> "b:key" : { >> "namespace" : "/wikipedia/en_id", >> "value" : null >> }, >> "guid" : "#9202a8c04000641f800000000009216a" >> } >> >> Currently, all valid titles and redirects for an article are >> stored in /wikipedia/en. The /wikipedia/en_id key, however, >> should point to the most recent wikipedia ID for the topic. You >> can access the wikipedia page with this ID using the following >> URL: >> >> http://en.wikipedia.org/wiki/index.html?curid=82976 >> >> Brian >> >> On May 15, 2008, at 4:11 AM, Zodiac Seven wrote: >> >>> Okay, i guess i will make the results var global and access it >>> from the callback. >>> >>> Is there a freebase api to get the name of the article in >>> wikipedia? >>> so if I have the id as "/en/taj_mahal" and the guid as >>> "#9202a8c04000641f800000000009216a", name as "Taj Mahal" >>> I guess there must be a way to find out the wikipedia article >>> name which is http://en.wikipedia.org/wiki/Taj_mahal >>> >>> On 5/15/08, *Dae Park* >> > wrote: >>> >>> I am unaware of any methods invoking something cross domain >>> synchronously. Even if it's possible, I doubt you want the >>> browser to >>> be "blocked" while you are waiting for your response. >>> >>> >>> -dae >>> >>> >>> >>> On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: >>> >>>> Dae, >>>> >>>> $.ajax is using a async callback too. Isn't there an >>> approach which >>>> will >>>> work synchronously like XmlHttpRequest? >>>> >>>> On 5/14/08, Dae Park >> > wrote: >>>>> >>>>> You should be able to $.ajax with "jsonp" as the dataType to >>>>> accomplish what you want. >>>>> >>>>> -dae >>>>> >>>>> >>>>> >>>>> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: >>>>> >>>>>> This is more of a javascript question then a freebase one but >>>>>> hoping someone here can help. >>>>>> >>>>>> I am trying to make a call to a webservice in freebase suggest >>>>>> (http://code.google.com/p/freebase-suggest/) >>>>>> This means I call a web service for every suggestion and >>> depending >>>>>> on that i display the suggestion. >>>>>> >>>>>> freebase.suggest.js Line 528. >>>>>> >>>>>> p.list_receive = function(input, txt, o) >>> {//fb.log("list_receive", >>>>>> input, query, o); >>>>>> // handle errors >>>>>> if (o.status !== '200 OK') { >>>>>> fb.error("list_receive", o.code, o.messages, o); >>>>>> return; >>>>>> } >>>>>> ... >>>>>> var url = 'http://somesite/webservice? >>>>>> callback=mycheckfunction&term=' + suggestKeyWord; >>>>>> >>>>>> // Create a script tag, set its src attribute and add it >>> to the >>>>>> document >>>>>> // This triggers the HTTP request and submits the query >>>>>> var script = document.createElement("script"); >>>>>> script.src = url; >>>>>> document.body.appendChild(script); >>>>>> ... >>>>>> // further logic to add/remove the item >>>>>> >>>>>> My problem is that i'm using >>> document.createElement("script" and >>>>>> since that is async i have no idea of knowing the response >>> of my >>>>>> web service. >>>>>> I could move the further logic into the callback but is >>> there a >>>>>> 'synchronous' way to wait until i get a response from my web >>>>>> service. >>>>>> I can't use xmlHttpRequest because of the cross domain >>> restriction. >>>>>> >>>>> >>>>>> _______________________________________________ >>>>>> Developers mailing list >>>>>> Developers at freebase.com >>>>>> http://lists.freebase.com/mailman/listinfo/developers >>>>> >>>>> _______________________________________________ >>>>> Developers mailing list >>>>> Developers at freebase.com >>>>> http://lists.freebase.com/mailman/listinfo/developers >>>>> >>>> _______________________________________________ >>>> Developers mailing list >>>> Developers at freebase.com >>>> http://lists.freebase.com/mailman/listinfo/developers >>> >>> _______________________________________________ >>> Developers mailing list >>> Developers at freebase.com >>> http://lists.freebase.com/mailman/listinfo/developers >>> >>> >>> _______________________________________________ >>> Developers mailing list >>> Developers at freebase.com >>> http://lists.freebase.com/mailman/listinfo/developers >> >> >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Developers mailing list >> Developers at freebase.com >> http://lists.freebase.com/mailman/listinfo/developers >> > > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From zodiac.seven at gmail.com Thu May 15 18:52:10 2008 From: zodiac.seven at gmail.com (Zodiac Seven) Date: Fri, 16 May 2008 00:22:10 +0530 Subject: [Developers] freebase-suggest modification In-Reply-To: <482C8599.70401@metaweb.com> References: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> <482C8599.70401@metaweb.com> Message-ID: Yes, that sounds like what I need, where should i start modifying freebase suggest to do this? On 5/16/08, Faye Li wrote: > > Since many articles are entered/edited by the Freebase community and not > imported from Wikipedia, Wikipedia keys are a better indicator for > identifying those that are. Sounds like the query you want is asking for > only things that have wiki keys. > > -- Faye > > > Zodiac Seven wrote: > > Thanks, > > > > Would there be a way to tweak freebase suggest to only show topics > > which exist in wikipedia - I guess I have to not get results which > > have article:null? I can't find the MQL query which it uses anywhere... > > > > On 5/15/08, *Brian Karlak* > > > wrote: > > > > > > The wikipedia title and ID are stored as the /wikipedia/en and > > /wikipedia/en_id keys on the topic, and can be retrieved by the > > following MQL: > > > > { > > "a:key" : [ > > { > > "namespace" : "/wikipedia/en", > > "value" : null > > } > > ], > > "b:key" : { > > "namespace" : "/wikipedia/en_id", > > "value" : null > > }, > > "guid" : "#9202a8c04000641f800000000009216a" > > } > > > > Currently, all valid titles and redirects for an article are > > stored in /wikipedia/en. The /wikipedia/en_id key, however, > > should point to the most recent wikipedia ID for the topic. You > > can access the wikipedia page with this ID using the following URL: > > > > http://en.wikipedia.org/wiki/index.html?curid=82976 > > > > Brian > > > > On May 15, 2008, at 4:11 AM, Zodiac Seven wrote: > > > >> Okay, i guess i will make the results var global and access it > >> from the callback. > >> > >> Is there a freebase api to get the name of the article in wikipedia? > >> so if I have the id as "/en/taj_mahal" and the guid as > >> "#9202a8c04000641f800000000009216a", name as "Taj Mahal" > >> I guess there must be a way to find out the wikipedia article > >> name which is http://en.wikipedia.org/wiki/Taj_mahal > >> > >> On 5/15/08, *Dae Park* > >> > wrote: > >> > >> I am unaware of any methods invoking something cross domain > >> synchronously. Even if it's possible, I doubt you want the > >> browser to > >> be "blocked" while you are waiting for your response. > >> > >> > >> -dae > >> > >> > >> > >> On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: > >> > >> > Dae, > >> > > >> > $.ajax is using a async callback too. Isn't there an > >> approach which > >> > will > >> > work synchronously like XmlHttpRequest? > >> > > >> > On 5/14/08, Dae Park > >> > wrote: > >> >> > >> >> You should be able to $.ajax with "jsonp" as the dataType to > >> >> accomplish what you want. > >> >> > >> >> -dae > >> >> > >> >> > >> >> > >> >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > >> >> > >> >>> This is more of a javascript question then a freebase one > but > >> >>> hoping someone here can help. > >> >>> > >> >>> I am trying to make a call to a webservice in freebase > suggest > >> >>> (http://code.google.com/p/freebase-suggest/) > >> >>> This means I call a web service for every suggestion and > >> depending > >> >>> on that i display the suggestion. > >> >>> > >> >>> freebase.suggest.js Line 528. > >> >>> > >> >>> p.list_receive = function(input, txt, o) > >> {//fb.log("list_receive", > >> >>> input, query, o); > >> >>> // handle errors > >> >>> if (o.status !== '200 OK') { > >> >>> fb.error("list_receive", o.code, o.messages, o); > >> >>> return; > >> >>> } > >> >>> ... > >> >>> var url = 'http://somesite/webservice? > >> >>> callback=mycheckfunction&term=' + suggestKeyWord; > >> >>> > >> >>> // Create a script tag, set its src attribute and add it > >> to the > >> >>> document > >> >>> // This triggers the HTTP request and submits the query > >> >>> var script = document.createElement("script"); > >> >>> script.src = url; > >> >>> document.body.appendChild(script); > >> >>> ... > >> >>> // further logic to add/remove the item > >> >>> > >> >>> My problem is that i'm using > >> document.createElement("script" and > >> >>> since that is async i have no idea of knowing the response > >> of my > >> >>> web service. > >> >>> I could move the further logic into the callback but is > >> there a > >> >>> 'synchronous' way to wait until i get a response from my web > >> >>> service. > >> >>> I can't use xmlHttpRequest because of the cross domain > >> restriction. > >> >>> > >> >> > >> >>> _______________________________________________ > >> >>> Developers mailing list > > >> >>> Developers at freebase.com > > >> >>> http://lists.freebase.com/mailman/listinfo/developers > >> >> > >> >> _______________________________________________ > >> >> Developers mailing list > > >> >> Developers at freebase.com > > >> >> http://lists.freebase.com/mailman/listinfo/developers > >> >> > >> > _______________________________________________ > >> > Developers mailing list > > >> > Developers at freebase.com > > >> > http://lists.freebase.com/mailman/listinfo/developers > >> > >> _______________________________________________ > >> Developers mailing list > > >> Developers at freebase.com > > >> http://lists.freebase.com/mailman/listinfo/developers > >> > >> > >> _______________________________________________ > >> Developers mailing list > > >> Developers at freebase.com > > >> http://lists.freebase.com/mailman/listinfo/developers > > > > > > _______________________________________________ > > Developers mailing list > > > Developers at freebase.com > > > http://lists.freebase.com/mailman/listinfo/developers > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Developers mailing list > > Developers at freebase.com > > http://lists.freebase.com/mailman/listinfo/developers > > > > _______________________________________________ > Developers mailing list > 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/20080516/57e64963/attachment-0001.htm From david at sprout.us Thu May 15 18:52:18 2008 From: david at sprout.us (david at sprout.us) Date: Thu, 15 May 2008 13:52:18 -0500 Subject: [Developers] Developers Digest, Vol 15, Issue 10 Message-ID: <951021193@mail.netwurk.com> Thank you for your email. I will be out of the office until Friday, May 23rd. During this period I will continue checking email periodically. Sincerely, David Repas From faye at metaweb.com Thu May 15 19:41:21 2008 From: faye at metaweb.com (Faye Li) Date: Thu, 15 May 2008 12:41:21 -0700 Subject: [Developers] freebase-suggest modification In-Reply-To: References: <4FE3FBD2-31AC-4624-A295-DF99F297ADAE@metaweb.com> <482C8599.70401@metaweb.com> Message-ID: <482C91E1.8000105@metaweb.com> Freebase suggest has a filter option (see fbs.filter) for filtering items out of the result list. That sounds like the most promising place to start digging. I'm hoping someone who has worked directly with that area can chime in. -- Faye Zodiac Seven wrote: > Yes, that sounds like what I need, where should i start modifying > freebase suggest to do this? > > On 5/16/08, *Faye Li* > wrote: > > Since many articles are entered/edited by the Freebase community > and not > imported from Wikipedia, Wikipedia keys are a better indicator for > identifying those that are. Sounds like the query you want is > asking for > only things that have wiki keys. > > -- Faye > > > Zodiac Seven wrote: > > Thanks, > > > > Would there be a way to tweak freebase suggest to only show topics > > which exist in wikipedia - I guess I have to not get results which > > have article:null? I can't find the MQL query which it uses > anywhere... > > > > On 5/15/08, *Brian Karlak* > > > >> wrote: > > > > > > The wikipedia title and ID are stored as the /wikipedia/en and > > /wikipedia/en_id keys on the topic, and can be retrieved by the > > following MQL: > > > > { > > "a:key" : [ > > { > > "namespace" : "/wikipedia/en", > > "value" : null > > } > > ], > > "b:key" : { > > "namespace" : "/wikipedia/en_id", > > "value" : null > > }, > > "guid" : "#9202a8c04000641f800000000009216a" > > } > > > > Currently, all valid titles and redirects for an article are > > stored in /wikipedia/en. The /wikipedia/en_id key, however, > > should point to the most recent wikipedia ID for the topic. You > > can access the wikipedia page with this ID using the > following URL: > > > > http://en.wikipedia.org/wiki/index.html?curid=82976 > > > > Brian > > > > On May 15, 2008, at 4:11 AM, Zodiac Seven wrote: > > > >> Okay, i guess i will make the results var global and access it > >> from the callback. > >> > >> Is there a freebase api to get the name of the article in > wikipedia? > >> so if I have the id as "/en/taj_mahal" and the guid as > >> "#9202a8c04000641f800000000009216a", name as "Taj Mahal" > >> I guess there must be a way to find out the wikipedia article > >> name which is http://en.wikipedia.org/wiki/Taj_mahal > >> > >> On 5/15/08, *Dae Park* > > >> >> > wrote: > >> > >> I am unaware of any methods invoking something cross domain > >> synchronously. Even if it's possible, I doubt you want the > >> browser to > >> be "blocked" while you are waiting for your response. > >> > >> > >> -dae > >> > >> > >> > >> On May 14, 2008, at 8:25 AM, Zodiac Seven wrote: > >> > >> > Dae, > >> > > >> > $.ajax is using a async callback too. Isn't there an > >> approach which > >> > will > >> > work synchronously like XmlHttpRequest? > >> > > >> > On 5/14/08, Dae Park > > >> >> wrote: > >> >> > >> >> You should be able to $.ajax with "jsonp" as the > dataType to > >> >> accomplish what you want. > >> >> > >> >> -dae > >> >> > >> >> > >> >> > >> >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote: > >> >> > >> >>> This is more of a javascript question then a > freebase one but > >> >>> hoping someone here can help. > >> >>> > >> >>> I am trying to make a call to a webservice in > freebase suggest > >> >>> (http://code.google.com/p/freebase-suggest/) > >> >>> This means I call a web service for every > suggestion and > >> depending > >> >>> on that i display the suggestion. > >> >>> > >> >>> freebase.suggest.js Line 528. > >> >>> > >> >>> p.list_receive = function(input, txt, o) > >> {//fb.log("list_receive", > >> >>> input, query, o); > >> >>> // handle errors > >> >>> if (o.status !== '200 OK') { > >> >>> fb.error("list_receive", o.code, o.messages, o); > >> >>> return; > >> >>> } > >> >>> ... > >> >>> var url = 'http://somesite/webservice? > >> >>> callback=mycheckfunction&term=' + suggestKeyWord; > >> >>> > >> >>> // Create a script tag, set its src attribute and > add it > >> to the > >> >>> document > >> >>> // This triggers the HTTP request and submits the query > >> >>> var script = document.createElement("script"); > >> >>> script.src = url; > >> >>> document.body.appendChild(script); > >> >>> ... > >> >>> // further logic to add/remove the item > >> >>> > >> >>> My problem is that i'm using > >> document.createElement("script" and > >> >>> since that is async i have no idea of knowing the > response > >> of my > >> >>> web service. > >> >>> I could move the further logic into the callback but is > >> there a > >> >>> 'synchronous' way to wait until i get a response > from my web > >> >>> service. > >> >>> I can't use xmlHttpRequest because of the cross domain > >> restriction. > >> >>> > >> >> > >> >>> _______________________________________________ > >> >>> Developers mailing list > > >> >>> Developers at freebase.com > > > > >> >>> http://lists.freebase.com/mailman/listinfo/developers > >> >> > >> >> _______________________________________________ > >> >> Developers mailing list > > >> >> Developers at freebase.com > > > > >> >> http://lists.freebase.com/mailman/listinfo/developers > >> >> > >> > _______________________________________________ > >> > Developers mailing list > > >> > Developers at freebase.com > > > > >> > http://lists.freebase.com/mailman/listinfo/developers > >> > >> _______________________________________________ > >> Developers mailing list > > >> Developers at freebase.com >