Designing a dataset class
This page is for website creators and administrators who build the place where a public body publishes its datasets. Exponential ships no dataset class, so you make one in the class editor. The design below uses only datatypes that ship with the kernel, and names its fields after the DCAT 3 terms catalogs use, so a later DCAT export can be written from them. The class editor steps come from Content classes for websites.
Contents
- Two classes: dataset and distribution
- The Dataset class
- The Distribution class
- Creating the classes
- Decisions to write down
- Pitfalls
Two classes: dataset and distribution
DCAT separates a dataset (the collection of data, with its description) from its distributions (each file or format you offer: a CSV, a JSON file, a spreadsheet). The same split works well as content:
| Content | Class | Container | DCAT term |
|---|---|---|---|
| Data catalog folder | Folder (shipped) | yes | dcat:Catalog |
| One dataset page | Dataset (yours) | yes | dcat:Dataset |
| One file below it | Distribution (yours), or the shipped File class | no | dcat:Distribution |
Making the dataset a container keeps its files together, so the dataset page can list its children and an RSS export of the catalog folder can follow new datasets.
The Dataset class
| Attribute name | Identifier | Datatype | Required | Translatable | DCAT term |
|---|---|---|---|---|---|
| Title | title | Text line (ezstring) | yes | yes | dct:title |
| Description | description | Rich text (ezxmltext) | yes | yes | dct:description |
| Publisher | publisher | Text line, or an object relation to an organization page | yes | no | dct:publisher |
| Contact point | contact_point | E-mail (ezemail) of a team mailbox, never a person | yes | no | dcat:contactPoint |
| License | license | Selection (ezselection) | yes | no | dct:license |
| Theme | theme | Tags (eztags) or Selection | no | no | dcat:theme |
| Keywords | keywords | Keywords (ezkeyword) | no | yes | dcat:keyword |
| Issued | issued | Date (ezdate) | yes | no | dct:issued |
| Modified | modified | Date (ezdate) | no | no | dct:modified |
| Update frequency | accrual_periodicity | Selection | no | no | dct:accrualPeriodicity |
| Spatial coverage | spatial | Text line | no | yes | dct:spatial |
| Temporal coverage | temporal | Text line, such as "2020-2025" | no | yes | dct:temporal |
| Conformance or schema | conforms_to | URL (ezurl) | no | no | dct:conformsTo |
Set the object name pattern to <title>. Mark Title, Description and Keywords Searchable. The contact point is
a function mailbox (for example [email protected]) so the page names no individual.
The Distribution class
| Attribute name | Identifier | Datatype | DCAT term |
|---|---|---|---|
| Title | title | Text line | dct:title |
| File | file | File (ezbinaryfile) | dcat:downloadURL (the download address) |
| Or: access address | access_url | URL, for data served elsewhere | dcat:accessURL |
| Format | format | Selection: CSV, JSON, XML, XLSX, GeoJSON ... | dct:format |
| Description | description | Text block (eztext) | dct:description |
The shipped File class (file) also works when you do not need a format field: its name and file are enough,
and the MIME type of the upload is shown by the file datatype.
Creating the classes
- Open Setup > Classes, the group Content, then New class.
- Name
Dataset, identifierdataset, object name pattern<title>, tick Container. - For each row of the table: choose the datatype under Add attribute, press Add, give the name and the identifier, set Required, Searchable and Translatable as in the table.
- For the License selection, enter the licenses your body has approved (see "Licensing datasets").
- Press OK. Repeat for
distribution. - Allow the classes where they belong: give the data team
content/createfor the classesdatasetanddistributionbelow the catalog folder (Roles and policies).
Decisions to write down
- Which fields are required: few required fields make drafts easy, but license, publisher and contact point should never be empty on a published dataset.
- Which fields are translated: titles and descriptions yes; dates, licenses and formats no.
- Who owns the class: a change to an identifier later breaks every template that reads it.
Pitfalls
- Removing an attribute deletes its data from every object. Add new fields freely; remove them only after a backup (Content classes for websites).
- Do not reuse the article class for datasets: the fields differ, and templates and feeds become hard to keep apart.
- No schema check. The Format field records what the editor chose; Exponential does not inspect the file.
Related pages
- Choosing datatypes
- Designing your content model
- Content model and editing
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.