# NetWrittenPremium — ShEx shape
#
# Illustration for a fictional insurer. Hand-authored in a format CoreModels exports
# (JSON Schema, ShEx) or renders to in an Ariesnet engagement (SQL, Cypher); not
# produced by CoreModels.
# https://ariesnet.com/resources/governed-definition-end-to-end
#
# Grain: one row per policy per accounting month. Every conforming node carries
# exactly one policy, exactly one accounting month, and exactly one amount.
#
# Netting rule: cancellations net at period close, not in the month the cancellation
# is recorded. The rule is carried by whatever produces the amount, not by the shape
# — the shape can hold a producer to the grain and the types, and it cannot see which
# month a cancellation was attributed to. Read it with the definition, not instead of it.
#
# Amount: netWrittenPremium is xsd:decimal here rather than the JSON Schema render's
# `number`, because JSON Schema has no exact-decimal type and money is not a float.
#
# The month pattern is written [0-9] rather than \d: a ShExC regular expression allows only
# the escapes \n \r \t \\ | . ? * + ( ) { } $ - [ ] ^ / and the reference parser
# (@shexjs/parser 1.0.0-alpha.30) rejects \d. Parsed with that parser on 2026-09-05;
# validation of instance data was not run.

PREFIX : <https://ariesnet.com/downloads/governed-definition/net-written-premium#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

<NetWrittenPremiumShape> {
  :policyId          xsd:string ;
  :accountingMonth   xsd:string /^[0-9]{4}-[0-9]{2}$/ ;
  :netWrittenPremium xsd:decimal
}
