Frage

As I experiment more and more with making my own Open Data Tables for YQL I find what might be some gaps in the documentation. As I'm a hands-on learner and like to understand everything I use I probe these gaps to try to learn how everything works.

I've noticed that in the XML format for Open Data Tables, there is a <urls> "array" which usually contains just a single <url> element though sometimes there is no <url>. Here's the beginning of a typical ODT XML file:

<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="true">
  <meta>
    <author>Paul Donnelly</author>
    <documentationURL>http://developer.netflix.com/docs/REST_API_Reference#0_52696</documentationURL>
  </meta>
  <bindings>
    <select itemPath="" produces="XML">
      <urls>
        <url env="all">http://api.netflix.com/catalog/titles/</url>
      </urls>

But I can't seem to find in the documentation whether it can ever contain more than one. I can't find any examples that do but when I try adding more than one everything works and no errors are thrown, though I also can't find any way to access the <url> elements beyond the first one.

Is there any use for the url/urls fields being an XML array? Is there any way to make use of more than one url here? Or is it just a quirk of the format that has no real reason?

War es hilfreich?

Lösung

Is there any use for the url/urls fields being an XML array? Is there any way to make use of more than one url here?

The <url> elements can have an env attribute. This env attribute can contain all, prod, int, dev, stable, nightly, perf, qaperf, gamma or beta.

When the table is executed, the current environment (the YQL environment, not the more familiar environment file) is checked and the first matching <url> (if any) is used. If no matching env is found (and there is no all, which is pretty self-descriptive) then an error will be issued; for example, "Table not defined in this environment prod".

Note that for public-facing YQL, the environment is prod; only prod and all make sense to be used in your Open Data Tables.

Or is it just a quirk of the format that has no real reason?

Not at all.

I assume that this information is "missing" from the online documentation purely because it is only useful internally within Yahoo!, but equally it could just be another place where the docs are somewhat out-of-date.

Finally, none of the 1,100 or so Community Open Data Tables specify more than one <url>, and only a handful (55) make use of the env attribute (all using the value all).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top