From daepark at metaweb.com Mon Jul 2 19:43:14 2007 From: daepark at metaweb.com (Dae Park) Date: Mon, 2 Jul 2007 12:43:14 -0700 Subject: [Developers] mjt html generation Message-ID: Is the mjt template generation synchronous? For example if I call a mjt.def, will I be able to access the element created in the mjt.def in a mjt.script:

Hello world

${foo()}
     alert(document.getElementById("bar"));
   
From lindner at inuus.com Mon Jul 2 23:20:19 2007 From: lindner at inuus.com (Paul Lindner) Date: Mon, 2 Jul 2007 16:20:19 -0700 Subject: [Developers] Schools, Colleges, Data loading and more... Message-ID: <20070702232019.GP19982@inuus.com> Hi there, I was recently invited to the Freebase alpha. I like what I see! I work for Hi5 and we can see a ton of potential here. Couple of questions though. * What about internationalization? Are there facilities for storing different names based on language? Or would that be a specialization of an existing type? For example the city New York City is Nueva York in Spanish This looks like a big problem and I hope it gets solved in a comprehensive way. It would be nice to see the ability to mark certain text as the canonical form and allow other translations to be made. Then if the canonical form is changed the other languages can be flagged for re-verification. * Is there any planned integration with geonames.org? * Hi5 has a large database of schools we could contribute. Most of these are imported from official sources, we could just submit the data but I'm more interested in contributing tools that can be used to refresh data from offical sources. What's the best way to do that? * Would it be possible to integrate editing / submitting functionality on external sites? Something better than just a link to the freebase edit page might be interesting. * How about OpenID authentication for contributors? This would obviously be something for post-alpha. In any case, glad to see this effort and am excited about the possibilities that it offers. -- Paul Lindner ||||| | | | | | | | | | lindner at inuus.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.freebase.com/pipermail/developers/attachments/20070702/93380c57/attachment.pgp From daepark at metaweb.com Mon Jul 2 23:54:48 2007 From: daepark at metaweb.com (Dae Park) Date: Mon, 2 Jul 2007 16:54:48 -0700 Subject: [Developers] mjt.def Message-ID: <19E07FD9-D6CB-42E2-A70F-59FC6D5127C5@metaweb.com> Is there anyway to share "mjt.def" declarations across multiple templates? From crism at metaweb.com Tue Jul 3 00:02:00 2007 From: crism at metaweb.com (Christopher R. Maden) Date: Mon, 02 Jul 2007 17:02:00 -0700 Subject: [Developers] Schools, Colleges, Data loading and more... In-Reply-To: <20070702232019.GP19982@inuus.com> References: <20070702232019.GP19982@inuus.com> Message-ID: <468991F8.1060107@metaweb.com> Glad you like it, Paul! I can address one of these questions for you. Paul Lindner wrote: > * What about internationalization? Are there facilities for storing > different names based on language? Or would that be a > specialization of an existing type? > > For example the city New York City is Nueva York in Spanish The underlying data model is already there. If you go look with the query editor, you will see that there are already polylingual names for things: { "query": { "id": "/wikipedia/en/New_York_City", "name": [{}] } } { "result": { "id": "/wikipedia/en/New_York_City", "name": [ { "lang": "/lang/fr", "type": "/type/text", "value": "New York" }, { "lang": "/lang/de", "type": "/type/text", "value": "New York City" }, { "lang": "/lang/it", "type": "/type/text", "value": "New York" }, { "lang": "/lang/ja", "type": "/type/text", "value": "??????" }, { "lang": "/lang/es", "type": "/type/text", "value": "Nueva York" }, { "lang": "/lang/en", "type": "/type/text", "value": "New York" } ] } } This isn?t yet exposed in the UI, but the data is there and can be manipulated in queries. ~Chris -- Christopher R. Maden Data Architect Metaweb Technologies, Inc. From niallo at metaweb.com Tue Jul 3 00:07:37 2007 From: niallo at metaweb.com (Niall O'Higgins) Date: Mon, 2 Jul 2007 17:07:37 -0700 Subject: [Developers] Sandbox update Message-ID: <20070703000737.GO5935@digdug.inet> Hi, Data refresh and software update on http://sandbox.freebase.com/ happening over the next few minutes. -- Niall O'Higgins Software Engineer Metaweb Technologies, Inc. From robert at metaweb.com Tue Jul 3 00:23:23 2007 From: robert at metaweb.com (Robert Cook) Date: Mon, 2 Jul 2007 17:23:23 -0700 Subject: [Developers] Schools, Colleges, Data loading and more... In-Reply-To: <20070702232019.GP19982@inuus.com> References: <20070702232019.GP19982@inuus.com> Message-ID: Paul -- Your questions are very good. You'll notice that we're still getting the basics going, but everything you've mentioned we've seriously considered. Feedback like yours helps us prioritize which features we do first. On Jul 2, 2007, at 4:20 PM, Paul Lindner wrote: > Hi there, > > I was recently invited to the Freebase alpha. I like what I see! I > work for Hi5 and we can see a ton of potential here. > > Couple of questions though. > > * What about internationalization? Are there facilities for storing > different names based on language? Or would that be a > specialization of an existing type? > > For example the city New York City is Nueva York in Spanish > > This looks like a big problem and I hope it gets solved in a > comprehensive way. It would be nice to see the ability to mark > certain text as the canonical form and allow other translations to > be made. Internationalization is part of our core infrastructure, although we've done little so far to surface that in the UI. Hundreds of thousands of topics already have labels in multiple languages. We'll be adding more UI support for internationalization soon. > Then if the canonical form is changed the other languages > can be flagged for re-verification. This is a clever idea -- we view topic name changes as an important event (mostly for vandalism control), but this could help guide translators. > > * Is there any planned integration with geonames.org? We've considered it, and I believe our Minister of Information (Jamie Taylor) has spoken with them. Geo is also important to us, so we will be trying to work with existing systems. > * Hi5 has a large database of schools we could contribute. Most of > these are imported from official sources, we could just submit the > data but I'm more interested in contributing tools that can be > used to > refresh data from offical sources. What's the best way to do that? We have an internal tool that allows you to upload spreadsheets and (most importantly) reconcile the data with existing topics. We're working hard to make this available to contributors. In the meantime, we could work closely with you to get it loaded. We should chat more (off this email list, so not to bore people) about the structure of your data. > * Would it be possible to integrate editing / submitting functionality > on external sites? Something better than just a link to the > freebase edit page might be interesting. Surprisingly, Freebase is actually an "external site" in that it uses the same APIs that anybody else should use. Our current functionality is a bit complex to package up for others to use, so we will be putting together some functions (autocomplete in particular) to make it easier for developers to create write-enabled applications. > * How about OpenID authentication for contributors? This would > obviously be something for post-alpha. We've have a couple of questions about OpenID support. We are fans of open standards and we'll try to support them to the extent we can. > In any case, glad to see this effort and am excited about the > possibilities that it offers. Thank you. Please keep the questions coming. Robert > -- > Paul Lindner ||||| | | | | | | | | | > lindner at inuus.com > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers From tim at metaweb.com Tue Jul 3 00:36:24 2007 From: tim at metaweb.com (Tim Kientzle) Date: Mon, 2 Jul 2007 17:36:24 -0700 Subject: [Developers] Schools, Colleges, Data loading and more... In-Reply-To: <20070702232019.GP19982@inuus.com> References: <20070702232019.GP19982@inuus.com> Message-ID: <6D3FCB1F-6142-4947-9B02-B85D071EC11F@metaweb.com> On Jul 2, 2007, at 4:20 PM, Paul Lindner wrote: > I was recently invited to the Freebase alpha. I like what I see! I > work for Hi5 and we can see a ton of potential here. > > Couple of questions though. > > * What about internationalization? Are there facilities for storing > different names based on language? As Chris Madsen mentioned, our underlying data model already supports full internationalization (a "name" is the value of a link between an object and a language; any object can have names in any number of languages). We do plan to fully internationalize our own applications, but applications using our public APIs can be fully internationalized today. > * Is there any planned integration with geonames.org? I'll let someone from our data group answer this. > * Hi5 has a large database of schools we could contribute. ... > What's the best way to do that? I'll let someone from our data group address that question in detail, but I can say that other developers are building tools against our public API to push data into our system. We also have a number of internal tools and development libraries that we plan to eventually expose for broad use. The first such is the MJT templating system http://mjtemplate.org/ that makes it very easy to build browser-based applications that run against our system. > * Would it be possible to integrate editing / submitting functionality > on external sites? Something better than just a link to the > freebase edit page might be interesting. Our API includes write facilities that developers can use to integrate editing capabilities into externally-hosted applications. To limit abuse, we do have some default restrictions on bulk writes, but we're eager to work with outside developers. Please let us know what you need. > * How about OpenID authentication for contributors? This would > obviously be something for post-alpha. We're looking into it. Tim Kientzle From niallo at metaweb.com Tue Jul 3 00:55:55 2007 From: niallo at metaweb.com (Niall O'Higgins) Date: Mon, 2 Jul 2007 17:55:55 -0700 Subject: [Developers] Sandbox update In-Reply-To: <20070703000737.GO5935@digdug.inet> References: <20070703000737.GO5935@digdug.inet> Message-ID: <20070703005555.GR5935@digdug.inet> Update complete. On Mon, Jul 02, 2007 at 05:07:37PM -0700, Niall O'Higgins wrote: > Hi, > > Data refresh and software update on http://sandbox.freebase.com/ > happening over the next few minutes. > > -- > Niall O'Higgins > Software Engineer > Metaweb Technologies, Inc. > _______________________________________________ > Developers mailing list > Developers at freebase.com > http://lists.freebase.com/mailman/listinfo/developers -- Niall O'Higgins Software Engineer Metaweb Technologies, Inc. From nix at metaweb.com Tue Jul 3 02:28:17 2007 From: nix at metaweb.com (Nick Thompson) Date: Mon, 02 Jul 2007 19:28:17 -0700 Subject: [Developers] mjt.def In-Reply-To: <19E07FD9-D6CB-42E2-A70F-59FC6D5127C5@metaweb.com> References: <19E07FD9-D6CB-42E2-A70F-59FC6D5127C5@metaweb.com> Message-ID: <4689B441.4090602@metaweb.com> Dae Park wrote: > Is there anyway to share "mjt.def" declarations across multiple templates? in the most recent version of mjt, mjt.run() returns a javascript object that contains all the toplevel mjt.def= declarations from the template. so you can do:
$arg1
then later, in js: window.mytemplate = mjt.run('mydiv'); then you can use something like ${mytemplate.mydef(...)} in other templates. nick From daepark at metaweb.com Tue Jul 3 02:50:13 2007 From: daepark at metaweb.com (Dae Park) Date: Mon, 2 Jul 2007 19:50:13 -0700 Subject: [Developers] mjt.def In-Reply-To: <4689B441.4090602@metaweb.com> References: <19E07FD9-D6CB-42E2-A70F-59FC6D5127C5@metaweb.com> <4689B441.4090602@metaweb.com> Message-ID: I was thinking more along the lines of including a javasript library and maybe something similar could be applied to a library of mjt.def declarations. Would you use a hidden frame to load your mjt.def declarations and have your visible (template) frame wait for it to load, set the mytemplate window variable and then call mjt.run on itself? On Jul 2, 2007, at 7:28 PM, Nick Thompson wrote: > Dae Park wrote: > > Is there anyway to share "mjt.def" declarations across multiple > templates? > > in the most recent version of mjt, mjt.run() returns a javascript > object > that contains all the toplevel mjt.def= declarations from the > template. > so you can do: > > >
>
> $arg1 >
>
>
> > then later, in js: > window.mytemplate = mjt.run('mydiv'); > then you can use something like ${mytemplate.mydef(...)} in other > templates. > > nick From nix at metaweb.com Tue Jul 3 02:50:26 2007 From: nix at metaweb.com (Nick Thompson) Date: Mon, 02 Jul 2007 19:50:26 -0700 Subject: [Developers] mjt html generation In-Reply-To: References: Message-ID: <4689B972.9030509@metaweb.com> nope - all the templates are expanded into a single string, which is then pasted in using innerHTML. mjt.script="" is evaluated as the string is being created, well before it gets turned into DOM elements. this is usually what you want, but i've run into the situation you're describing too. my way of dealing with it has to set up a short timeout - in most cases 'bar' should be ready immediately after the current mjt.run() completes, and the javascript interpreter won't run timeouts until then. this doesn't feel clean or robust but it's worked for me so far. in the future i'm planning to add something like mjt.script="ondomready" to declare that the script should execute after the dom is ready, but before mjt.run() returns. this should be simpler to use, more reliable, and more efficient. but i'm only going to be on email sporadically for the next few weeks, so it will probably show up in mjt 0.6 sometime in early to mid-august. nick Dae Park wrote: > Is the mjt template generation synchronous? For example if I call a > mjt.def, will I be able to access the element created in the mjt.def in > a mjt.script: > >
>

Hello world

>
>
> ${foo()} >
>     alert(document.getElementById("bar"));
>   
>
From nix at metaweb.com Tue Jul 3 03:21:31 2007 From: nix at metaweb.com (Nick Thompson) Date: Mon, 02 Jul 2007 20:21:31 -0700 Subject: [Developers] mjt.def In-Reply-To: References: <19E07FD9-D6CB-42E2-A70F-59FC6D5127C5@metaweb.com> <4689B441.4090602@metaweb.com> Message-ID: <4689C0BB.3020106@metaweb.com> > I was thinking more along the lines of including a javasript library and > maybe something similar could be applied to a library of mjt.def > declarations. there is an undocumented library mechanism that might be you want in this case. be warned: it's undocumented because it is confusing and has only been used in very restricted circumstances so far. fetching a library from a url is an asynchronous operation, so evaluation order can be surprising. to use library inclusion, you must be using mjt.run() with no arguments to expand the entire as a template. if you do this, mjt.run will also check the for link tags. if mjt.run() finds a tag of the form: then it will automatically fetch mylib.html using a dynamically generated iframe. when it detects that mylib.html has been loaded, it compiles the of mylib.html first, and then completes the mjt.run() on the of the current page. the link title= attribute declares a variable that will be bound to a namespace containing the toplevel mjt.def="" calls from mylib.html. so you can use ${mylib.mydef('xyz')} to refer to the template function mydef inside mylib.html. it's best not to include any