Skip to content

sefanja/ArchiRules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ArchiRules

Lightweight SPARQL-based model validation for Archi. It exports your model as RDF, runs SPARQL-based validation, and reports violations directly in the jArchi console.

πŸ“‹ Features

  • Validate Archi models directly from inside Archi
  • Define rules declaratively in SPARQL
  • Feedback directly in the jArchi console
  • Works on Windows without admin rights
  • Requires the jArchi plugin

▢️ Typical usage

  1. Open your model in Archi
  2. Run the ArchiRules.ajs script via jArchi
    • Exports the model as RDF (Turtle)
    • Executes SPARQL rules in the rules folder
    • Reports violations in the jArchi console
  3. Review validation results in the console

πŸ“Ÿ Example console output

βœ” 0 elements violate rule C1
⚠ 2 elements violate rule C2: Customer Support; Order Fulfilment
⚠ 233 elements violate rule C3

If there are 100 or fewer violations, element names are shown. If more, only the count is displayed.

πŸ“ SPARQL rule example

# An element may not be composed (directly or indirectly) of itself.

PREFIX archimate: <http://www.opengroup.org/xsd/archimate/3.0/#>

SELECT ?x WHERE {
  ?x archimate:Composition+ ?x .
}

πŸ“¦ Installation (Windows)

All files should be placed in a folder on your system, for example:

C:\Users\YourName\Downloads\ArchiRules\

Folder contents after installation:

ArchiRules\
β”œβ”€β”€ validate.js     # jArchi script
β”œβ”€β”€ validate.cmd     # Batch file to run all SPARQL rules
β”œβ”€β”€ rules\           # SPARQL rules (e.g. C1.rq, C2.rq, ...)
β”œβ”€β”€ tools\           # (created by the user in step 2)
β”‚   β”œβ”€β”€ jdk\         # Portable JDK
β”‚   └── jena\        # Apache Jena
└── output\          # RDF export and validation results (created after first run)

1. jArchi script installation

To use the validate.js script inside Archi:

  1. Open Archi
  2. Go to Scripts β†’ Scripts Manager, and click New Archi Script
  3. Name the new script ArchiRules
  4. In the script editor, paste the following line (adjust the path if needed):
      load("C:\\Users\\YourName\\Downloads\\ArchiRules\\validate.js");
  5. Save the script

2. JDK and Jena setup

Manually download and extract the following tools:

Place them in the tools\ directory as shown above.

πŸ“„ License

MIT

About

Lightweight SPARQL-based model validation for Archi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published