Virtuoso Open-Source Edition

  • Topic
  • Discussion
  • Virtuoso Sponger Query Language Cartridges

    What Are They?

    Most of the Sponger's extractor cartridges work on a pool of data, such as an HTML webpage containing metadata, which are extracted into triples. Some of the cartridges make API calls to upstream web services to retrieve the relevant pool of data first.

    Query Language cartridges are for situations where the data arises from a query executed on the upstream site, ie the data being sponged is the result-set of another query.

    Why?

    Maybe the upstream server holds control over, or offers limited or restricted access to, the data; maybe you have a pre-existing application that uses the given language to express its queries.

    How?

    Virtuoso's Sponger has 3 cartridges that support upstream queries:

    Freebase Query Editor (MQL)

    Upstream query editor interface: http://www.freebase.com/queryeditor

    Language: MQL, a means of expressing filters in JSON.

    Sample:

    {
      "album": [{
        "id":    null,
        "limit": 2,
        "name":  null,
        "track": []
      }],
      "id":   null,
      "name": "The Police",
      "type": "/music/artist"
    }
    

    Permalink to query URL: http://www.freebase.com/queryeditor?q=%7B%22album%22%3A%5B%7B%22id%22%3Anull%2C%22limit%22%3A2%2C%22name%22%3Anull%2C%22track%22%3A%5B%5D%7D%5D%2C%22id%22%3Anull%2C%22name%22%3A%22The%20Police%22%2C%22type%22%3A%22%2Fmusic%2Fartist%22%7D

    Cartridge Configuration Requirements

    There are no special requirements; because it doesn't even need an app key to use it, it should be enabled by default after installing the Cartridges VAD package.

    Examples

    Yahoo Query Language (YQL)

    Upstream query editor interface: http://developer.yahoo.com/yql/console/

    Language: a web-based SQL-style dialect

    Sample:

    select * from local.search where query="sushi" and location="san francisco, ca"
    

    Permalink to query URL: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20local.search%20where%20query%3D%22sushi%22%20and%20location%3D%22san%20francisco%2C%20ca%22&diagnostics=true

    Cartridge Configuration Requirements

    There are no special requirements; because it doesn't even need an app key to use it, it should be enabled by default after installing the Cartridges VAD package.

    Examples

    Wolfram|Alpha

    Upstream query editor interface: http://www.wolframalpha.com/

    Language: custom, pseudo-natural-language

    Sample:

    airspeed of a laden swallow
    

    Permalink to query URL: http://www.wolframalpha.com/input/?i=airspeed+of+a+laden+swallow&dataset=

    Cartridge Configuration Requirements

    Both the Wolfram|Alpha cartridge and meta-cartridge require an App-ID issued from the Wolfram Alpha developer dashboard. For a detailed overview, see the cartridge configuration instructions.

    Examples

    Treasury.IO

    Upstream query editor interface: http://treasury.io/

    Language: a web-based SQL-style dialect

    Sample:

    SELECT "table", "date", "year_month", "year", "month", "day", "weekday", 
    "account", "account_raw", "is_total", "close_today", "open_today", "open_mo", 
    "open_fy", "url"
    FROM "t1" 
    limit 10
    

    Permalink to query URL: http://api.treasury.io/cc7znvq/47d80ae900e04f2/sql/?q=SELECT%20%22table%22,%20%22date%22,%20%22year_month%22,%20%22year%22,%20%22month%22,%20%22day%22,%20%22weekday%22,%20%22account%22,%20%22account_raw%22,%20%22is_total%22,%20%22close_today%22,%20%22open_today%22,%20%22open_mo%22,%20%22open_fy%22,%20%22url%22%20FROM%20%22t1%22%20%20limit%2010

    Cartridge Configuration Requirements

    There are no special requirements; because it doesn't even need an app key to use it, it should be enabled by default after installing the Cartridges VAD package.

    Examples