models

This is a Go package used to describe data models aligned with the HTML5 data types.

https://github.com/caltechlibrary/models

Science Score: 52.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
    Organization caltechlibrary has institutional domain (www.library.caltech.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

This is a Go package used to describe data models aligned with the HTML5 data types.

Basic Info
Statistics
  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 5
Created over 1 year ago · Last pushed 11 months ago
Metadata Files
Readme License Citation Codemeta

README.md

License Latest release

models

This is a Go package used to describe data models aligned with the HTML5 data types. The model can be expressed in YAML or JSON. The YAML (or JSON) data structure is patterned after the HTML5 form elements. A single model can be used to generate HTML web forms or used to validate a map that confirms to the model. In princple generators can be written to express the model in other forms, e.g. SQL.

It is important to note that is not an Object Relational Mapper (ORM). The purpose of the model package is to facilitate describing simple data models using YAML then beable to reuse the models in other Go based projects (e.g. dataset, Newt).

This Go package assumes Go version 1.23.1 or better.

Oberservation: Web forms describe a simple data structure

The models package grew out of an observation that if you can define the elements of an HTML5 web form you can also describe a simple data model or schema. The problem is HTML5 is combersum to type, read and work with. On the other hand it lends itself to expression in simpler representations.

YAML can be used to represent a web form in a clear and concise way. From that description you can extrapulate HTML and SQL Schema. You can also use it as a guide to data validation for web form submissions.

Our common use cases.

  1. Web form as YAML can be used to generate HTML web forms
  2. Web form elements can be used to inferring the SQL column type
  3. Web form as YAML is a guide to validating web form submissions

A simple example

A "guest book" model.

~~~yaml id: guestbookentry attributes: action: ./signbook.html method: POST x-success: ./thankyou.html x-failure: ./oops.html elements: - id: recordid type: text pattern: [a-z0-9]+.[a-z0-9]+ attributes: name: recordid placeholder: A unique record id required: true - id: name type: text attributes: name: name placeholder: E.g. Doe, Jane required: true - id: message type: text attributes: placeholder: Please leave a message name: message - id: signed type: date attributes: name: signed required: true ~~~

This "model" describes JSON data that might look like the following.

~~~json { "record_id": "jane.doe", "Doe, Jane", "signed": "2024-09-10" } ~~~

The model could be used to generate the web form and validate the data. It implies an SQL Scheme. The model package provides the means of working with a model and to validate the model's content. By normalizing your data elements to throse supported by HTML5 you also can easily generate the code you need (e.g. HTML form or SQL scheme).

The package doesn't provide the extrapolated forms but does provide the functions and method to make it easy to build them.

Owner

  • Name: Caltech Library
  • Login: caltechlibrary
  • Kind: organization
  • Email: helpdesk@library.caltech.edu
  • Location: Pasadena, CA 91125

We manage the physical and digital holdings of the California Institute of Technology, provide services and training, and develop open-source software.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
title: "models"
abstract: "A Go package for working with simple data models inspired by
HTML5 web forms."
authors:
  - family-names: Doiel
    given-names: R. S.
    orcid: ""



repository-code: "https://github.com/caltechlibary/models"
version: 0.0.5
license-url: "https://spdx.org/licenses/BSD-3-Clause"
keywords: [ "metadata" ]
date-released: 2024-10-15

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "type": "SoftwareSourceCode",
  "codeRepository": "https://github.com/caltechlibary/models",
  "author": [
    {
      "id": "https://orcid.org/0000-0003-0900-6903",
      "type": "Person",
      "givenName": "R. S.",
      "familyName": "Doiel",
      "affiliation": {
        "type": "Organization",
        "name": "Caltech Library"
      },
      "email": "rsdoiel@caltech.edu"
    }
  ],
  "dateCreated": "2024-09-20",
  "dateModified": "2025-03-24",
  "datePublished": "2025-03-24",
  "description": "A Go and TypeScript package for working with simple data models inspired by HTML5 web forms.",
  "funder": {
    "type": "Organization",
    "name": "Caltech Library"
  },
  "keywords": "metadata",
  "name": "models",
  "license": "https://spdx.org/licenses/BSD-3-Clause",
  "operatingSystem": [
    "Linux",
    "Windows",
    "macOS"
  ],
  "programmingLanguage": [
    "Go",
    "TypeScript"
  ],
  "relatedLink": [
    "https://github.com/caltechlibrary/dataset",
    "https://github.com/caltechlibrary/newt"
  ],
  "softwareRequirements": [
    "Go >= 1.23.1",
    "GNU Make",
    "Pandoc >= 3.1"
  ],
  "version": "0.0.6",
  "developmentStatus": "wip",
  "issueTracker": "https://github.com/caltehclibrary/models/isues",
  "downloadUrl": "https://github.com/caltechlibrary/models/releases",
  "releaseNotes": "Refined interactive modeler, added TypeScript modules."
}

GitHub Events

Total
  • Release event: 1
  • Push event: 8
  • Create event: 1
Last Year
  • Release event: 1
  • Push event: 8
  • Create event: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
proxy.golang.org: github.com/caltechlibrary/models
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.2%
Average: 6.4%
Dependent repos count: 6.6%
Last synced: 7 months ago

Dependencies

go.mod go
  • gopkg.in/yaml.v3 v3.0.1
go.sum go
  • gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
  • gopkg.in/yaml.v3 v3.0.1