Cargo Queries

From Salish Sea Wiki

See also Page Editing Forms

This page has information about using structure data created thorugh page edit forms to complete queries. On the left we have an overview of syntax. On the right we have information about all the cargo tables.

  • Cargo Extension - Query Guidance
  • Special:ViewData - is a special page that lets you query all tables.
  • Use the magic words __NOCACHE__ to require a query be reconstructed upon each page view.
  • For a WHERE clause for a field that uses multiple values, use HOLDS instead of =. Behind the scenes, cargo creates helper tables to manage field with multiple values.
  • Special:RunQuery/ProductQuery is an example of a custom query form page

Syntax

{{#cargo_query:
tables=table1=tableAlias1, table2=tablesAlias2, etc.
|join on=table1.fieldA = table2.fieldB,table2.fieldC=table3.fieldD, etc.
|fields=field1=fieldAlias1,field2=Alias2, etc.
|where=table1.fieldE='some value' AND/OR etc.
|group by=table1.fieldG
|having=table1.fieldG='some value', etc.
|order by=table2.fieldF, etc.
|limit=some number
|offset=some number
|intro=some text
|outro=some text
|default=some text
|more results text=some text
|no html
|max display chars=some number
|format=format
...additional format-based parameters
}}

Quick Examples

  • {{#cargo_query:tables=Products|fields=COUNT(*)|where=Type_Group='Dataset'}} - creates a count of pages fitting a query

Dynamic Table

{{#cargo_query:
tables=Products
|fields=_pageName=Page,Type_Group=Type,Authors,Categories
|format=dynamic table
|rows per page=1000
|searchable columns=yes
|limit=1000
}}

Tables

Place

  • Place Name
  • Surrounding Places
  • Place Scale
  • Architecture
  • Landform
  • Jurisdictions
  • AnthroTopics
  • EcoTopics
  • Categories

Topics

  • Topic Name
  • Architecture
  • Workgroup
  • Effort
  • Jurisdictions
  • Places
  • AnthroTopics
  • EcoTopics
  • Categories

Workgroup

  • Workgroup Name
  • Acronym
  • Logo Image
  • Architecture
  • Workgroup Type
  • Effort
  • Jurisdictions
  • Places
  • AnthroTopics
  • EcoTopics
  • Categories

Efforts

  • Effort Name
  • Start Year
  • Milestone Year
  • End Year
  • Architecture
  • Effort Type
  • Effort Credit
  • Jurisdictions
  • Places
  • Workgroups
  • AnthroTopics
  • EcoTopics

Product

  • Authors
  • Year
  • Title
  • Type Group
  • File
  • Distribution
  • Places
  • Jurisdictions
  • Workgroups
  • AnthroTopic
  • EcoTopic
  • Effort
  • Categories

Product Type Data

  • Authors Dataset
  • Year Dataset
  • Title Dataset
  • FileOrCitation Dataset
  • Type Document
  • Authors Document
  • Year Document
  • Title Document
  • FileOrCitation Document
  • Type Graphic
  • Authors Graphic
  • Year Graphic
  • Title Graphic
  • FileOrCitation Graphic
  • Type Website
  • Title Website