Question

Suppose I have an Open Data Table definition at a publicly accessible location such as http://example.com/mytable.xml:

<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
  ...
</table>

How can I run a query (e.g. show tables) against this definition? Is there some way to import the table definition into the YQL console directly?

(The example doesn't explain how to get YQL to actually read the table definition--it leaves this bit as an exercise to the reader...)

Était-ce utile?

La solution

One or more tables can be manually imported by using the use statement:

use "http://example.com/mytable.xml" as mytable;
desc mytable;

If you have many tables, or want to reuse a bunch of them for different queries, then create a YQL environment file, and use this in the console or the actual query URLs with the env GET parameter (docs).

See Invoking an Open Data Table Definition within YQL for full details.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top