This document outlines the mapping of relational databases to RDF and discusses constraint rewriting techniques. It begins with an overview of direct mapping and the R2RML specification. It then examines previous work on extending direct mapping with OWL axioms and SHACL shapes. The document introduces the concept of a constraint rewriting that maximally translates SQL constraints to equivalent SHACL constraints. It presents an algorithm for performing this rewriting on simple database to RDF mappings. An example demonstrates applying the rewriting to a sample schema, mapping, and constraints. The rewriting aims to preserve semantics between the SQL and SHACL constraints when possible.