Go types of schema.org ontology

schema.org for golang

The library declares Go types of https://schema.org ontology.

Version Documentation Git Hub

Inspiration

Schema.org is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet, on web pages, in email messages, and beyond.

The common vocabulary layouts content into data structure interpretable by human and machines. It also guarantees an interoperability baseline for software in the distribute systems, in the absence of strong content negotiation techniques. Despite, the scheme.org elevates creation of web structured data markup schema, it also defines an ontology usable for data design in other context such as public RESTful interfaces, gRPC or GraphQL.

A core principle of the schema.org vocabulary is to indicate an entity type. As an example, the vocabulary defines a rich collection of rdf:Property, which are essential building blocks for product types.

type Person struct {
  schemaorg.FamilyName `json:"schema:familyName"`
}

Get started

The latest version of the library is available at its main branch. All development, including new features and bug fixes, take place on the main branch using forking and pull requests as described in contribution guidelines. The stable version is available via Golang modules.

Core domain types (product types)

Ontologies use rdf:Property to depict characteristic of entities, which differs significantly from Golang type system. Instead of defining product type in terms of named properties, ontologies describe properties in terms of types to which they apply, which allows to extends concepts, defining additional properties without the need to re-define the original description of types.

rdf:Property is a relation between subject resources and object resources. The concept of property at Go programming languages does not correspond to the rdf:Property, with an exception that "properties" of structs has names and corresponding types.

/*
The statement 
  Person schema:familyName "Doe"
*/
type Person struct {
  schemaorg.FamilyName `json:"schema:familyName"`
}

Type-level meta-programming helps us better reflect the rdf:Property concept but type-level programming is not supported at Golang. Therefore, this library reflects the rdf:Property to the type.

/*
{
  "@id": "schema:familyName",
  "@type": "rdf:Property",
  "rdfs:comment": "Family name. In the U.S., the last name of a Person.",
  "rdfs:label": "familyName",
  ...
}
*/
type FamilyName string

So that, the application "assembles" core domain type as a product of the types defined by schema.org

import "github.com/fogfish/schemaorg"

type Person struct {
  schemaorg.Identifier `json:"schema:@id"`
  schemaorg.GivenName  `json:"schema:givenName"`
  schemaorg.FamilyName `json:"schema:familyName"`
  schemaorg.Email      `json:"schema:email"`
}

How To Contribute

The library is auto-generated from schema.org JSON-LD definition using schemacli utility.

Use the following commands to re-generate the type definitions

schemacli property -f schemaorg-all-http.jsonld > types.go

If you experience any issues with the library or requires a new feature, please let us know via GitHub issues.

License

See LICENSE

Owner
🄐ddict to Functional Programming & Category Theory ∴ Golang ∴ Scala ∴ Erlang.erl ∴ Service Creator ∴ 🄕 ⤳ Distributed Systems, Linked Data, Cloud & Security
null
Similar Resources

[TOOL, CLI] - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships. Export structural types as TypeScript value object or bare type representations.

typex Examine Go types and their transitive dependencies. Export results as TypeScript value objects (or types) declaration. Installation go get -u gi

Dec 6, 2022

Some helper types for go1: priority queue, slice wrapper.

go-villa Package villa contains some helper types for Go: priority queue, slice wrapper, binary-search, merge-sort. GoDoc Link: http://godoc.org/githu

Apr 24, 2021

Library to work with MimeHeaders and another mime types. Library support wildcards and parameters.

Mime header Motivation This library created to help people to parse media type data, like headers, and store and match it. The main features of the li

Nov 9, 2022

Go package that adds marshal and unmarshal features to nullable sql types.

#Nullable Very simple Go module to handle nullable fields. Basically, it adds to sql package types the JSON marshal and unmarshal features. It has 100

Jan 20, 2022

Mimetype - This package provides mime-types as constants.

mimetype This package provides mimetypes as constants. The constants are generated for the IONA website: https://www.iana.org/assignments/media-types/

Dec 27, 2022

schema.org ontology command-line

schema.org ontology command-line

Oct 11, 2022

Plugs module to see different types of plug types needed in different countries, and a comparison tool between two countries plug socket types.

plugs Importing the module: go get github.com/matthewboyd/plugs "github.com/matthewboyd/plugs" How to use the module: There are two functions wi

Dec 28, 2021

A tool to compare if terraform provider migration schema snapshot is equal to schema defined in resource code

migration schema comparer for Terraform When develop Terraform provider sometimes we need do some state migration(not schema migration) via StateUpgra

Nov 18, 2021

Schema - JSON Schema rules plugin

This plugin allows to configure JSON Schema validations rules ensuring user-submitted records adhere to a pre-defined data schema.

Feb 16, 2022

Github-org-diff - Simple CLI tool to check a diff between 2 branches of all org repos

github-org-diff Simple CLI tool to list org repos that have diff between dev and

Jan 25, 2022

Library providing opanapi3 and Go types for store/validation and transfer of ISO-4217, ISO-3166, and other types.

go-types This library has been created with the purpose to facilitate the store, validation, and transfer of Go ISO-3166/ISO-4217/timezones/emails/URL

Nov 9, 2022

Go linter that checks types that are json encoded - reports unsupported types and unnecessary error checks

Checks types passed to the json encoding functions. Reports unsupported types and reports occations, where the check for the returned error can be omited.

Oct 7, 2022

Optional is a library that provides option types for Go types.

Option Optional is a library that provides option types for Go types. Installation Golang version 1.18 + required go get -u github.com/eatmoreapple/op

Nov 9, 2022

Database schema evolution library for Go

Try browsing the code on Sourcegraph! Darwin Database schema evolution library for Go Example package main import ( "database/sql" "log" "github.

Dec 5, 2022

Schema management CLI for MySQL

Schema management CLI for MySQL

Skeema is a tool for managing MySQL tables and schema changes in a declarative fashion using pure SQL. It provides a CLI tool allowing you to: Export

Dec 27, 2022

SQL schema migration tool for Go.

sql-migrate SQL Schema migration tool for Go. Based on gorp and goose. Using modl? Check out modl-migrate. Features Usable as a CLI tool or as a libra

Jan 2, 2023

Generate a Go ORM tailored to your database schema.

Generate a Go ORM tailored to your database schema.

SQLBoiler is a tool to generate a Go ORM tailored to your database schema. It is a "database-first" ORM as opposed to "code-first" (like gorm/gorp). T

Jan 2, 2023

auto-generate capnproto schema from your golang source files. Depends on go-capnproto-1.0 at https://github.com/glycerine/go-capnproto

bambam: auto-generate capnproto schema from your golang source files. Adding capnproto serialization to an existing Go project used to mean writing a

Sep 27, 2022

jio is a json schema validator similar to joi

jio is a json schema validator similar to joi

jio Make validation simple and efficient ! 中文文档 Why use jio? Parameter validation in Golang is really a cursing problem. Defining tags on structs is n

Dec 25, 2022
SampleD - scalable sample collection, routing, and schema evolution

SampleD Realtime event analytics capture and processor Emit samples from your application code (libraries provided) Configure fluentbit to capture sam

Dec 7, 2022
Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more
Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more

ghorg ghorg allows you to quickly clone all of an orgs, or users repos into a single directory. This can be useful in many situations including Search

Jan 1, 2023
FreeDesktop.org (xdg) Specs implemented in Go

xdg Package xdg provides access to the FreeDesktop.org (XDG) specs. Documentation Documentation is available via godoc. Here are direct links to the d

Nov 11, 2022
A reverse-proxy cache for external images used on LinuxFr.org

External images on LinuxFr.org Our users can use images from external domains on LinuxFr.org. This component is a reverse-proxy / cache for these imag

May 14, 2021
Clone of the old gasnow.org, now available at gasnow.dev

Gasnow 2 Clone of gasnow.org Quickstart The application connects to infura to get data from its ethereum full node. In order to do so the following en

Mar 30, 2022
OPG sirius supervision firm deputy hub: Managed by opg-org-infra & Terraform

OPG sirius supervision firm deputy hub: Managed by opg-org-infra & Terraform

Jan 10, 2022
Go client library for Geonames Web Services (geonames.org)

geonames Go client library for Geonames Web Services (geonames.org) Usage Register your username at geonames.org Export ENV Var or read the username f

Nov 23, 2022
Run goplus org

Run goplus org

Jan 11, 2022
Github-org-stats - Returns the star and fork count of repositories in an organisation

github-org-stats Utility to get github star and fork count of repositories in an

Sep 27, 2022
Fast conversions across various Go types with a simple API.

Go Package: conv Get: go get -u github.com/cstockton/go-conv Example: // Basic types if got, err := conv.Bool(`TRUE`); err == nil { fmt.Printf("conv.

Nov 29, 2022