Semsql schema

A datamodel for RDF, OWL, and OBO Ontologies designed to work harmoniously with SQL databases.

Note that the primary purpose of this linkml schema is to organize and define SQL VIEWs to be used on top of a generic SQL database following the rdftab statements schema. These SQL views are encoded with the sqlviews>> tag inside the yaml.

We use linkml to do this rather than a simple SQL DDL file because linkml gives us a standard way to do things such as:

  • attach descriptions to each view
  • define a data dictionary of all columns used, together with domains/ranges
  • modular structure with imports
  • the ability to attach rich semantic metadata to each schema element

Additionally, the framework provides automatic compilation to SQLAlchemy models, and tools for being able to turn views into indexed tables for efficient querying, as well as a rich searchable documentation system and other tooling.

This schema is best browsed online:

Note that things are in flux, and there some oddities that need ironed out, see issues for details

See the github repo for code to convert from the linkml yaml into SQL DDL






Built in

  • Bool
  • Decimal
  • ElementIdentifier
  • NCName
  • NodeIdentifier
  • URI
  • XSDDate
  • XSDDateTime
  • XSDTime
  • float
  • int
  • str


  • Boolean (Bool) - A binary (true or false) value
  • Date (XSDDate) - a date (year, month and day) in an idealized calendar
  • Datetime (XSDDateTime) - The combination of a date and time
  • Decimal (Decimal) - A real number with arbitrary precision that conforms to the xsd:decimal specification
  • Double (float) - A real number that conforms to the xsd:double specification
  • Float (float) - A real number that conforms to the xsd:float specification
  • Integer (int) - An integer
  • LiteralAsStringType (String)
  • Ncname (NCName) - Prefix part of CURIE
  • NodeIdType (Uriorcurie)
  • Nodeidentifier (NodeIdentifier) - A URI, CURIE or BNODE that represents a node in a model.
  • Objectidentifier (ElementIdentifier) - A URI or CURIE that represents an object in the model.
  • String (str) - A character string
  • Time (XSDTime) - A time object represents a (local) time of day, independent of any particular day
  • Uri (URI) - a complete URI
  • Uriorcurie (URIorCURIE) - a URI or a CURIE