Skip to content

Theology Example (THEO)

This tutorial shows how FiveLoaves.ai uses OWLGraph to model the Bible as a theological knowledge graph — the first production use case for OWLGraph.

Existing Bible software treats Scripture as flat text with manual cross-references. A pastor preparing a sermon on Isaiah 53 has no systematic way to:

  • Trace prophecy-fulfillment chains across testaments
  • Navigate typological relationships (Adam → Christ, Passover → Crucifixion)
  • Query thematic connections ranked by ontological distance
  • See how different theological traditions interpret the same passage

FiveLoaves defines a theological ontology that captures the structure of biblical knowledge:

@prefix theo: <http://fiveloaves.ai/ontology#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
# === Core Classes ===
theo:Scripture a owl:Class .
theo:Passage a owl:Class ; rdfs:subClassOf theo:Scripture .
theo:Prophecy a owl:Class ; rdfs:subClassOf theo:Passage .
theo:Fulfillment a owl:Class ; rdfs:subClassOf theo:Passage .
theo:Parable a owl:Class ; rdfs:subClassOf theo:Passage .
theo:Person a owl:Class .
theo:BiblicalFigure a owl:Class ; rdfs:subClassOf theo:Person .
theo:Prophet a owl:Class ; rdfs:subClassOf theo:BiblicalFigure .
theo:Apostle a owl:Class ; rdfs:subClassOf theo:BiblicalFigure .
theo:Patriarch a owl:Class ; rdfs:subClassOf theo:BiblicalFigure .
theo:Place a owl:Class .
theo:City a owl:Class ; rdfs:subClassOf theo:Place .
theo:Region a owl:Class ; rdfs:subClassOf theo:Place .
theo:Nation a owl:Class ; rdfs:subClassOf theo:Place .
theo:Theme a owl:Class .
theo:Covenant a owl:Class ; rdfs:subClassOf theo:Theme .
theo:Event a owl:Class .
theo:Book a owl:Class .
# === Disjointness ===
theo:Person owl:disjointWith theo:Place .
theo:Prophecy owl:disjointWith theo:Fulfillment .
# === Object Properties ===
theo:fulfills a owl:ObjectProperty ;
rdfs:domain theo:Fulfillment ;
rdfs:range theo:Prophecy .
theo:fulfilledBy a owl:ObjectProperty ;
owl:inverseOf theo:fulfills .
theo:typifies a owl:ObjectProperty ;
rdfs:domain theo:BiblicalFigure ;
rdfs:range theo:BiblicalFigure .
theo:typifiedBy a owl:ObjectProperty ;
owl:inverseOf theo:typifies .
theo:locatedIn a owl:ObjectProperty, owl:TransitiveProperty ;
rdfs:domain theo:Place ;
rdfs:range theo:Place .
theo:partOfCovenant a owl:ObjectProperty ;
rdfs:domain theo:Event ;
rdfs:range theo:Covenant .
theo:hasTheme a owl:ObjectProperty ;
rdfs:domain theo:Passage ;
rdfs:range theo:Theme .
theo:references a owl:ObjectProperty, owl:SymmetricProperty ;
rdfs:domain theo:Passage ;
rdfs:range theo:Passage .
theo:inBook a owl:ObjectProperty ;
rdfs:domain theo:Passage ;
rdfs:range theo:Book .
theo:mentions a owl:ObjectProperty ;
rdfs:domain theo:Passage ;
rdfs:range theo:BiblicalFigure .
# === Data Properties ===
theo:name a owl:DatatypeProperty ; rdfs:range xsd:string .
theo:reference a owl:DatatypeProperty ; rdfs:domain theo:Passage ; rdfs:range xsd:string .
theo:text a owl:DatatypeProperty ; rdfs:domain theo:Passage ; rdfs:range xsd:string .
theo:testament a owl:DatatypeProperty ; rdfs:domain theo:Book ; rdfs:range xsd:string .
theo:tradition a owl:DatatypeProperty ; rdfs:range xsd:string .
Terminal window
# Insert Isaiah 53 as a Prophecy
curl -X POST http://INSTANCE/mutate?commitNow=true \
-H "Content-Type: application/json" \
-d '{
"set": [{
"uid": "_:isa53",
"dgraph.type": "Prophecy",
"reference": "Isaiah 53:5",
"text": "But he was pierced for our transgressions...",
"hasTheme": { "uid": "_:atonement" },
"inBook": { "uid": "_:isaiah" },
"mentions": { "uid": "_:servant" }
},
{
"uid": "_:matt2728",
"dgraph.type": "Fulfillment",
"reference": "Matthew 27:28-31",
"text": "They stripped him and put a scarlet robe on him...",
"fulfills": { "uid": "_:isa53" },
"hasTheme": { "uid": "_:atonement" },
"inBook": { "uid": "_:matthew" }
},
{ "uid": "_:atonement", "dgraph.type": "Theme", "name": "Atonement" },
{ "uid": "_:isaiah", "dgraph.type": "Book", "name": "Isaiah", "testament": "Old" },
{ "uid": "_:matthew", "dgraph.type": "Book", "name": "Matthew", "testament": "New" },
{ "uid": "_:servant", "dgraph.type": "Prophet", "name": "Suffering Servant" }
]}'

Automatic inferences:

  • Isaiah 53:5 gets types: Prophecy, Passage, Scripture (hierarchy)
  • Matthew 27:28-31 gets types: Fulfillment, Passage, Scripture (hierarchy)
  • fulfilledBy edge created on Isaiah 53:5 → Matthew 27:28-31 (inverse of fulfills)
  • Suffering Servant gets types: Prophet, BiblicalFigure, Person (hierarchy)
  • references is symmetric: both passages reference each other
# All Scripture about Atonement (Prophecies AND Fulfillments)
{
atonement(func: type(Scripture)) @filter(has(hasTheme)) {
reference
text
dgraph.type
hasTheme @filter(eq(name, "Atonement")) { name }
}
}
# Prophecy-Fulfillment chains
{
prophecies(func: type(Prophecy)) {
reference
text
fulfilledBy {
reference
text
inBook { name testament }
}
}
}
# All passages mentioning BiblicalFigures (Prophets, Apostles, Patriarchs)
{
passages(func: type(Passage)) {
reference
mentions @filter(type(BiblicalFigure)) {
name
dgraph.type
}
}
}
# Transitive location: places in a region
{
places(func: eq(name, "Jerusalem")) {
name
locatedIn* { name dgraph.type }
}
}

The ontology captures what theologians already know — that prophecy and fulfillment are both kinds of scripture, that typology is a directional relationship, that location is transitive. OWLGraph makes these relationships queryable without hand-coding the logic.

When the FiveLoaves AI agent prepares a sermon, it queries OWLGraph for the passage context, walks the prophecy chains, follows typological links, and gathers cross-references — all through standard graph queries on materialized data.