3 min read

J-NRL Examples: Representing Normative Text in JSON

Explore J-NRL examples for encoding legal and regulatory statements in JSON. Learn how J-NRL represents obligations, permissions, prohibitions, and more.
J-NRL Examples: Representing Normative Text in JSON
Photo by Mikhail Pavstyuk / Unsplash

In our previous post, we introduced J-NRL, a JSON-based language for representing normative texts. Now, let's dive into practical examples of how J-NRL can be used to encode various types of legal and regulatory statements.

Core Principles of J-NRL Representation

Before we delve into the examples, let's reiterate the core principles of how J-NRL represents normative statements:

  • JSON Structure: Each norm is represented as a JSON object.
  • Key-Value Pairs: Normative elements are captured as key-value pairs (e.g., "deonticModality": "Obligation").
  • Explicit Linking: The "source" field always links back to the original text.
  • Structured Conditions and Consequences: Conditions and consequences are represented as structured objects, allowing for complex logic.
  • Actor-Centered: The actor field specifies who the norm applies to.
  • Action-Oriented: The action field describes the regulated behavior.
  • Deontic Modality: Uses "Obligation", "Permission", and "Prohibition".

J-NRL Examples

Here are several examples illustrating how J-NRL can represent different types of normative statements:

1. A Simple Obligation (GDPR - Consent)

  • Normative Statement: "The controller shall base processing on consent..." (GDPR, Article 6(1)(a))
  • Explanation: This example represents an obligation for a Data Controller. The condition includes the use of negation.

J-NRL Representation:

{
  "normId": "gdpr-consent-basis",
  "source": "GDPR, Article 6(1)(a)",
  "actor": {
    "type": "DataController",
    "description": "The entity that determines the purposes and means of the processing of personal data"
  },
  "action": {
    "verb": "Base",
    "object": "Processing of personal data",
    "purpose": "Processing personal data"
  },
  "deonticModality": "Obligation",
  "condition": {
    "facts": [
      "Processing is not necessary for the performance of a contract",
      "Processing is not necessary for compliance with a legal obligation",
      "Processing is not necessary to protect the vital interests of the data subject",
      "Processing is not necessary for the performance of a task carried out in the public interest",
      "Processing is not necessary for the purposes of the legitimate interests pursued by the controller"
    ],
    "negation": true
  },
  "consequence": {
    "stateChange": "Processing of personal data is lawful"
  }
}

2. A Permission with Conditions (Building Permit)

  • Normative statement: "A building permit is required for the construction of a fence, unless the fence is not higher than 1 meter."
  • Explanation: This example shows a permission with a constraint on the height of the fence.

J-NRL Representation:

{
  "normId": "building-permit-fence",
  "source": "Fictional Building Code, Section 3.2",
  "actor": {
    "type": "PropertyOwner",
    "description": "Owner of a property"
  },
  "action": {
    "verb": "Construct",
    "object": "Fence"
  },
  "deonticModality": "Permission",
  "condition": {
    "constraints": [
      {
        "property": "height",
        "operator": "<=",
        "value": "1 meter"
      }
    ]
  }
}

3. A Prohibition with Exceptions (Traffic Law)

  • Normative Statement: "Parking is prohibited in this zone, except for emergency vehicles."
  • Explanation: This example demonstrates a prohibition with an exception for a specific type of vehicle. It also shows the use of the temporalConstraints and consequence fields.

J-NRL Representation:

{
  "normId": "prohibition-parking-zone",
  "source": "City Traffic Ordinance, Section 4.5",
  "actor": {
    "type": "VehicleOperator",
    "description": "Person operating a vehicle"
  },
  "action": {
    "verb": "Park",
    "object": "Vehicle"
  },
  "deonticModality": "Prohibition",
  "condition": {
    "location": "Within the designated zone"
  },
  "temporalConstraints": {
    "applicability": "24/7"
  },
  "exceptions": [
    {
      "type": "Vehicle",
      "description": "Emergency vehicle (e.g., ambulance, fire truck, police car)"
    }
  ],
  "consequence": {
    "sanction": {
      "type": "Fine",
      "description": "Parking fine"
    }
  }
}

4. A Conditional Obligation with a Deadline (Contractual)

  • Normative Statement: "The supplier shall deliver the goods within 10 days of receiving the purchase order."
  • Explanation: This example shows an obligation that is conditional on receiving a purchase order and has a deadline.

J-NRL Representation:

{
  "normId": "contract-delivery-obligation",
  "source": "Contract Agreement #123, Clause 5",
  "actor": {
    "type": "Supplier",
    "description": "The party responsible for delivering goods"
  },
  "action": {
    "verb": "Deliver",
    "object": "Goods",
    "purpose": "Fulfill purchase order"
  },
  "deonticModality": "Obligation",
  "condition": {
    "facts": [
      "Received purchase order"
    ]
  },
  "temporalConstraints": {
    "deadline": "10 days after receiving purchase order"
  },
  "consequence": {
    "stateChange": "Goods are delivered"
  }
}

5. A Norm with References to Other Norms (Interlinked Regulation)

  • Normative Statement 1: "Only registered users are allowed to post comments."
  • Normative Statement 2: "To register, a user must provide a valid email address."
  • Explanation: This example demonstrates how J-NRL can represent norms that refer to each other. The refersToNorm field in the first norm links the permission to post comments to the obligation to register.

J-NRL Representation:

[
  {
    "normId": "permission-post-comment",
    "source": "Website Terms of Service, Section 4.1",
    "actor": {
      "type": "User"
    },
    "action": {
      "verb": "Post",
      "object": "Comment"
    },
    "deonticModality": "Permission",
    "condition": {
      "facts": [
        "User is registered"
      ],
      "refersToNorm": "obligation-user-registration"
    }
  },
  {
    "normId": "obligation-user-registration",
    "source": "Website Terms of Service, Section 3.2",
    "actor": {
      "type": "User"
    },
    "action": {
      "verb": "Register"
    },
    "deonticModality": "Obligation",
    "condition": {
      "facts": [
        "Provides a valid email address"
      ]
    }
  }
]

Key Takeaways

  • J-NRL can represent a wide variety of normative statements found in laws, regulations, and contracts.
  • The JSON structure provides a clear and organized way to capture the different elements of a norm.
  • The condition and consequence fields allow for the representation of complex normative logic.
  • The source field ensures traceability, while refersToNorm allows for linking between norms.

These examples illustrate the flexibility and expressiveness of J-NRL. By providing a standardized way to represent normative text, J-NRL can facilitate the development of applications for automated compliance checking, legal reasoning, and more.