Skip to content
Become a partner
Research · Ontologies & business rules

The company's rules, written once and applied exactly

An ontology describes what the company handles: its objects, their attributes, their links, and the rules that apply to them. In VAILS, it is not a design document: it runs. Documents are transcribed into it, business rules are applied to it, and it can be queried or checked for consistency at any time.

How it works

Declare, populate, apply, query

An ontology is declared with classes, typed and constrained attributes (mandatory, bounds, closed list of values, inheritance) and relations. It is compiled into logical rules, in a knowledge base specific to the ontology and to the session.

  1. 01Declare

    Classes, typed and constrained attributes, relations.

  2. 02Populate

    Instances extracted from a text or an image, created by the program, or produced by an optimisation.

  3. 03Apply the rules

    Condition, action, priority: inference applies them until nothing changes any more.

  4. 04Query and check

    Through filters, or in natural language; consistency checked at any time.

Business examples

Rules the business can read

Banking: blocking risky transfers

Three rules, in order of priority: a high amount or a sensitive country makes the transfer risky, and a risky transfer is blocked. The rules can be read by the compliance department.

Result obtained on the server: the 15,500 € transfer to the Cayman Islands is blocked; the 820 € one remains pending.

Banque_SecuriteVVL
$Banque = [ontology:define "Banque_Securite"
    [ontology:class Virement
        [attributes
            [montant Float [required true]]
            [pays_destination String [default "France"]]
            [niveau_risque String [default "FAIBLE"]]
            [statut String [default "EN_ATTENTE"]]]]]
[ontology:rule "MontantEleve" $Banque [target "Virement"] [priority 100]
    [when ($this.montant > 10000)]
    [then [ontology:set $this "niveau_risque" "ELEVE"]]]
[ontology:rule "PaysSensible" $Banque [target "Virement"] [priority 90]
    [when ($this.pays_destination == "Iles Caimans")]
    [then [ontology:set $this "niveau_risque" "ELEVE"]]]
[ontology:rule "Blocage" $Banque [target "Virement"] [priority 10]
    [when ($this.niveau_risque == "ELEVE")]
    [then [ontology:set $this "statut" "BLOQUE"]]]
[ontology:commit [new Virement [montant 15500] [pays_destination "Iles Caimans"]]]
[ontology:commit [new Virement [montant 820]]]
[ontology:infer-fixpoint $Banque 10]
[ontology:select $Banque "Virement" [statut "BLOQUE"]]

Recruitment: a chain of rules

A first rule determines the level from experience; a second decides from the level and the score. Inference chains the two.

Result obtained on the server: only Marie is accepted; Paul is senior but his score is too low, and Léa is not yet senior.

MarieACCEPTE9 years · score 82
PaulA_ETUDIERsenior · score 55
LéaA_ETUDIER3 years · score 90
RH_TriVVL
$RH = [ontology:define "RH_Tri"
    [ontology:class Candidat
        [attributes [nom String [required true]] [experience Integer [min 0]]
                    [score Integer [min 0] [max 100]]
                    [niveau String [default "JUNIOR"]] [decision String [default "A_ETUDIER"]]]]]
[ontology:rule "NiveauSenior" $RH [target "Candidat"] [priority 100]
    [when ($this.experience >= 7)]
    [then [ontology:set $this "niveau" "SENIOR"]]]
[ontology:rule "Accepte" $RH [target "Candidat"] [priority 10]
    [when (($this.niveau == "SENIOR") && ($this.score >= 70))]
    [then [ontology:set $this "decision" "ACCEPTE"]]]
[ontology:commit [new Candidat [nom "Marie"] [experience 9] [score 82]]]
[ontology:commit [new Candidat [nom "Paul"] [experience 9] [score 55]]]
[ontology:commit [new Candidat [nom "Lea"] [experience 3] [score 90]]]
[ontology:infer-fixpoint $RH 10]
[ontology:select $RH "Candidat" [decision "ACCEPTE"]]

Purchasing: checking the quality of supplier data

Before paying or listing a supplier, the ontology checks that the mandatory fields are present and that the values stay within their bounds. This check is purely symbolic.

Result obtained on the server: two blocking violations, the missing SIRET and a quality rating of 25 out of a maximum of 20.

FournisseursVVL
$Four = [ontology:define "Fournisseurs"
    [ontology:class Fournisseur
        [attributes [raison_sociale String [required true]] [siret String [required true]]
                    [note_qualite Integer [min 0] [max 20]]]]]
[ontology:commit [new Fournisseur [raison_sociale "Alpha SARL"] [note_qualite 25]]]
[ontology:consistent $Four]
From text and images to data

Extraction, guided by the schema

Orders: mapping a free-form value to the catalogue

The colour and size of a joinery product accept only catalogue values. When the customer writes anthracite or large format, extraction maps the value to the right label according to its meaning.

“anthracite”Gris 7016“large format”L
ontology:fromTextVVL
$menuiserie = [ontology:define menuiserie
    [ontology:class Fenetre [attributes
        [reference String]
        [couleur String [in_values "Blanc 9010" "Gris 7016" "Brun 8019" "Noir 9005"]]
        [taille String [in_values "S" "M" "L" "XL"]]]]]
$f = [ontology:fromText $menuiserie "Fenetre" "Commande REF-001 : fenetre coulissante, profil couleur anthracite, grand format (large)."]
[print $f.couleur]     # Gris 7016
[print $f.taille]      # L

Quotes: extracting a scanned document

A PDF quote is converted into images, then transcribed into the schema, including its table of line items. The amounts arrive typed, ready to be checked by rules.

ontology:fromImageVVL
[ontology:class Devis
    [attributes
        [numero String [key true]]
        [date Date]
        [client Client]
        [lignes List [of LigneDevis]]      # déclenche l'extraction du tableau
        [total_ht Currency]
        [taux_tva Number]
        [total_ttc Currency]]]
$images = [pdfToImages $fichier_pdf 2.0]
$devis  = [ontology:fromImage $DevisSystem "Devis" $images]

Rules written by business teams

Rules can also be written in Gherkin, the format of test scenarios, then turned automatically into an executable ontology.

ontology:loadGherkinVVL
$source = "
Feature: SecurityRules
  Background: Schema
    Given I define an ontology named 'BankSystem'
    And I define a class 'Transaction' with attributes:
    | Name   | Type    | Default   |
    | amount | Integer | 0         |
    | status | String  | 'Pending' |

  @priority: 100
  Scenario: High Value Rule
    Given a 'Transaction' context
    When 'amount' is greater than 1000
    Then set 'status' to 'HighRisk'
"
$Ontologie = [evaluate [ontology:loadGherkin $source]]
Guarantees

What it guarantees, and its limits

  • Rules are applied exactly and reproducibly, in order of priority, until a stable state is reached.
  • Consistency is checked without a language model: mandatory fields, bounds, value lists, cardinalities.
  • Each session has its own ontologies; keeping them beyond the session is done explicitly, by saving them to the workspace.
  • Extraction from a text or an image goes through the language model; ontological contracts make it possible to validate it and rerun it if there is a discrepancy.
Putting it into practice

Apply this work to your processes?

These tools are instructions of the VVL language: our partners implement them for their clients, on the ProSuite platforms.