### OCL Constraint: Bruk av utnyttingstall Source: https://sosi.geonorge.no/standarder/Plan/5.0 Denne OCL-koden definerer en restriksjon for bruk av utnyttingstall og utnyttingstall_minimum. Disse skal ikke brukes for utnyttingstype 10 og 11, men er påkrevd for alle andre utnyttingstyper. ```ocl inv: (utnyttingstype = 10 or utnyttingstype = 11) xor (utnyttingstall.notEmpty() or utnyttingstall_minimum.notEmpty() ) ``` -------------------------------- ### OCL Constraint for Reguleringsplan Source: https://sosi.geonorge.no/standarder/Plan/5.0 OCL-kode som sikrer at et objekt tilhører en reguleringsplan. Brukes for å håndheve dataintegritet. ```OCL inv: arealplan.plantype.RpPlantype.notEmpty() ``` -------------------------------- ### OCL Constraint: Bruk av terrengreferanse Source: https://sosi.geonorge.no/standarder/Plan/5.0 Denne OCL-koden spesifiserer at terrengreferanse kan brukes i stedet for høydereferansesystem når typeHøyde er 'TH' (terrenghøyde) eller 'PH' (planert høyde). ```ocl inv: høydereferansesystem->notEmpty() xor terrengreferanse->notEmpty() and (typeHøyde='TH' or typeHøyde='PH') ``` -------------------------------- ### OCL Constraint for Plan Content and Legal Reference Source: https://sosi.geonorge.no/standarder/Plan/5.0 This OCL constraint checks if plans with specific elements have the correct legal reference, and if the legal reference is 6, it ensures certain other elements are empty. Use this to validate plan data against legal requirements. ```ocl inv: ( ( ( arealformål->notEmpty() or hensyn->notEmpty() or regulertHøyde->notEmpty() or bestemmelseOmråde->notEmpty() or midlByggAnlegg->notEmpty() ) implies lovreferanse = 6 ) and ( lovreferanse = 6 implies fare->isEmpty() and rekkefølge->isEmpty() and fornyelse->isEmpty() and restriksjon->isEmpty() and bevaring->isEmpty() and reguleringsformål->isEmpty() ) ) ```