This is a sequel to the previous article on Competency Questions (CQ) where we discussed how CQs can be run in Protégé. If you are not familiar with the concept, it is just a 5 minutes read here Competency Questions…
Here, we will discuss scaling the ontology we created into the next level of usage with the help of a Graph database.
Why put ontologies in a graph database
Ideally, the ontology does not have to be in a graph database during design and evaluation. But putting it in a graph database unlocks capabilities that an integrated development environment (IDE) alone cannot provide. Yes, you heard it right. Protégé is an editor; whereas a graph database is an engine.
Protégé is fantastic for designing, debugging, and reasoning over an ontology. But it is not designed for:
- storing large datasets
- running fast SPARQL queries
- integrating with applications
- serving data to external tools (R, Python, Java, APIs)
- handling millions of triples
- concurrent access
- persistence
- analytics
- dashboards
- real‑time querying
A graph database is designed for all of these.
1. GraphDB lets you run SPARQL queries at scale
Protégé’s SPARQL/DL tab is slow, limited, stateless obviously, is not meant for production. A GraphDB gives a proper SPARQL endpoint, fast query execution, support for large dataset, integration with R, Python, Java, PowerBI etc. for CQs.
2. GraphDB stores both ontology + data
Protégé stores only the ontology whereas the GraphDB stores:
- ontology (TBox)
- individuals (ABox)
- inferred triples
- imported datasets
- updates over time
So, if you want to model:
- thousands of customers
- thousands of accounts
- millions of transactions
Protégé cannot handle this. GraphDB can.
3. GraphDB supports reasoning at query time
Protégé’s reasoner works only inside Protégé. GraphDB supports:
- OWL‑Horst reasoning
- RDFS reasoning
- custom rule sets
- inference during SPARQL queries
This means the competency questions return inferred answers, not just explicit ones.
4. GraphDB is built for integration
Protégé is a desktop tool. GraphDB is a server. GraphDB allows connection to external systems and tools to integrate ontologies into real systems.
- R
- Python
- Java
- Node.js
- Web apps
- Dashboards
- Microservices
5. GraphDB is persistent and multi‑user
Protégé stores everything in memory and loses data when it is closed. It is a single-user ide to design ontologies.
GraphDB stores data permanently, supports multiple users, provides backups, supports transactions and security which is essential for real applications.
In short, the typical workflow is toe Design ontology in Protégé, deploy it to GraphDB and analyse data in R/Python/ BI tools. In the following sections, we will explore how to load the ontology into a GraphDB.
Loading banking ontology into GraphDB
Now that we have understood the reasons for having the ontology in the GraphDB, let us explore how to load it in the first place.
Create a repository in the GraphDB
Before an ontology can be imported, there needs to be a repository created. Select the GraphDB repository as in the below screen.

Assign a name after selecting the options as in Figure 2.

Once created, the screen displays the created repository. Note that the repository is not yet connected to the workspace. That is what we will do next.

Once the repository is created, click the “Plug & Socket” icon to the left of the repository to connect the workspace to the repo.
Import the ontology into the repository
Now that the repository is connected, click the import button to display the options for importing an ontology. Refer to Figure

Select Upload RDF files and select the banking.ttl file in the local folder and continue till the end of the workflow. Once the import is successful, the filename will show up in the window as in Figure 5.

Now that we have completed importing the ontology into the GraphDB, we will explore options to query it in the next article.


Leave a Reply