The SpaCy Law Property Graph is an integrated system consisting of three interoperable tools:
- Legislative Text Parser — converts legislative documents (PDF) into structured JSON.
- GraphGenerator — extracts semantic relationships between legal entities and builds Knowledge Graphs.
- GraphViewerApp — visualizes the resulting graphs and presents dynamic checklists for exploration.
Together, these tools automate the complex process of legal text analysis and compliance verification.
- Input: legislative document (PDF).
- Output:
lawObject.json. - Performed by Legislative Text Parser.
- Input:
lawObject.json,entities.txt. - Process: syntactic and semantic analysis using spaCy and RapidFuzz.
- Output:
relationships.json,triplets.csv,graph.graphml,merged.graphml. - Performed by GraphGenerator.
- Input:
merged.graphml,relationships.json,paragraphs.json. - Process: interactive exploration of entities, relations, and relevant legal snippets.
- Output: graphical and textual views.
- Performed by GraphViewerApp.
Each tool can be run independently or as part of a complete pipeline.
| Tool | Language | Core Dependencies |
|---|---|---|
| Legislative Text Parser | Java | Swing, Maven, JSON |
| GraphGenerator | Python | spaCy, RapidFuzz, NetworkX |
| GraphViewerApp | Python | NetworkX, Tkinter |
# 1. Extract structured text
open LegislativeTextParser in your prefered IDE and run.
# 2. Generate relationships and graphs
python engine.py
python graphml_exporter.py
python merge_graphml_nodes.py
# 3. View checklist
open GraphViewer in your prefered IDE and run.| File | Description |
|---|---|
lawObject.json |
Structured legislative text |
entities.txt |
Entity definitions |
paragraphs.json |
Paragraph text segments |
relationships.json |
Extracted semantic relationships |
triplets.csv |
Relationship table |
graph.graphml / merged.graphml |
Knowledge Graphs ready for visualization |
This project is developed as part of an academic thesis at the Department of Computer Science, University of Ioannina.
Use for research and educational purposes is permitted.