This repository contains the implementation of a code analysis framework to infer NoSQL database schemas and generate refactoring plans from application source code. Produces logical schemas conforming to the U-Schema metamodel.
uschema-code-analysis analyzes the source code of data-intensive applications built with JavaScript and MongoDB to extract:
- CRUD operations and their target containers.
- Implicit references between data entities.
- Logical schema models (U-Schema).
- Join query removal candidates via duplication plans.
The approach is designed to support schema discovery in schemaless NoSQL databases, improve query performance, and assist in database refactoring through code and data rewriting.
- Code metamodel.
- Control flow metamodel.
- Database operation and Structure metamodel.
- Extraction of U-Schema logical schemas from code.
- Generation of join query removal plans.
- Automated schema, data, and code updates.
- Graph visualization for control flow analysis using Neo4j.
This repository contains the prototype implementation described in the paper.
It provides tools for analyzing application code, extracting schemas, and applying refactorings.
- JDK 26. The Eclipse projects and Maven compiler configurations target Java SE 26.
- Maven 3.6.3 or later
- Eclipse Modeling with Java 26 support, EMF, and Xtend. Eclipse 2026-03 (4.39) requires the Java 26 support update.
Select JDK 26 as the Java SE 26 execution environment under
Preferences → Java → Installed JREs → Execution Environments in Eclipse.
If you use Maven from a terminal, point JAVA_HOME to the same installation
and check the version with mvn -version. JavaScript parsing continues to use
the standalone nashorn-core dependency.
To execute the prototype and reproduce the results described in the paper, please follow these steps:
-
Import the projects in Eclipse Modeling Import the Eclipse projects from this repository, together with
es.um.uschemaandes.um.uschema.utilsfrom the U-Schema checkout. Enable Xtend support and let Eclipse resolve the Maven dependencies of the projects that have apom.xml. There is no Maven reactor at the repository root. -
Locate the launcher project Open the project:
es.um.uschema.code.transfs.launcher -
Run the main class Execute the class:
Launcher.javaSet the working directory to the launcher project or the repository root. Each run prints its schema path under
outputs/<application>-<run>/nosqlschema/. Runs are kept separate so you can compare their XMI files.
This project is distributed for academic and research purposes.
This project relies on the following tools and libraries:
- Esprima – A high-performance ECMAScript parser used to generate the Abstract Syntax Tree (AST) from JavaScript source code.
This project depend on the U-Schema core projects that are found in:
- U-Schema repository - U-Schema Metamodel and Utils.
$ git clone https://github.com/modelum/uschemaList of related publications:
- Carlos J. Fernández-Candel, Anthony Cleve, Jesús García-Molina, Automated Extraction and Refactoring of NoSQL Schemas from Application Code. arXiv. — The APP used to validate the approach (music-app) in the paper can be found in "es.um.uschema.code.transfs.launcher" under the folder "inputs".