reasoning ontology overview
on this page
definition
the reasoning ontology provides a formal rdf/owl specification for representing arguments, inference rules, logical constructs, and reasoning processes. it enables semantic web applications to store, query, and reason about argumentation structures with precise semantics.
the ontology is organized around three main classes: informationunit, reasoningconstruct, and reasoningqualifier, which capture the essential elements of reasoning systems.
ontology structure
namespace and imports
@prefix re: <http://example.org/reasoning#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example.org/reasoning> rdf:type owl:Ontology ;
rdfs:label "Reasoning Taxonomy" ;
rdfs:comment """A foundational ontology for describing the concepts
and structures involved in various forms of reasoning.""" .
core class hierarchy
the ontology defines three top-level classes:
# Top-level organizational classes
re:InformationUnit rdf:type owl:Class ;
rdfs:label "Information Unit" ;
rdfs:comment """The most general class for any piece of information,
such as a statement or collection of statements.""" .
re:ReasoningConstruct rdf:type owl:Class ;
rdfs:label "Reasoning Construct" ;
rdfs:comment "Abstract tools, patterns, or rules used to perform reasoning." .
re:ReasoningQualifier rdf:type owl:Class ;
rdfs:label "Reasoning Qualifier" ;
rdfs:comment """A concept that qualifies or modifies the nature of
an InformationUnit, such as its certainty or modality.""" .
informationunit taxonomy
statements and arguments
statements are the basic units of information:
re:Statement rdf:type owl:Class ;
rdfs:subClassOf re:InformationUnit ;
rdfs:label "Statement" ;
rdfs:comment """A single declarative proposition that can be evaluated
for truth. The fundamental building block of arguments.""" .
# Statement subtypes
re:Premise rdfs:subClassOf re:Statement .
re:Conclusion rdfs:subClassOf re:Statement .
re:Fact rdfs:subClassOf re:Statement .
re:Hypothesis rdfs:subClassOf re:Statement .
re:Goal rdfs:subClassOf re:Statement .
arguments combine statements into reasoning structures:
re:Argument rdf:type owl:Class ;
rdfs:subClassOf re:InformationUnit ;
rdfs:label "Argument" ;
rdfs:comment """A structure composed of premises intended to determine
the degree of truth or acceptability of a conclusion.""" .
# Argument types
re:DeductiveArgument rdfs:subClassOf re:Argument .
re:InductiveArgument rdfs:subClassOf re:Argument .
re:AbductiveArgument rdfs:subClassOf re:Argument .
re:DefeasibleArgument rdfs:subClassOf re:Argument .
compound statements
logical structure is represented through compound statements:
re:CompoundStatement rdfs:subClassOf re:Statement .
re:AtomicStatement rdfs:subClassOf re:Statement .
# Specific compound types
re:ConjunctiveStatement rdfs:subClassOf re:CompoundStatement .
re:DisjunctiveStatement rdfs:subClassOf re:CompoundStatement .
re:ConditionalStatement rdfs:subClassOf re:CompoundStatement .
re:NegatedStatement rdfs:subClassOf re:CompoundStatement .
reasoning traces
sequences of reasoning steps are captured as traces:
re:ReasoningTrace rdf:type owl:Class ;
rdfs:subClassOf re:InformationUnit ;
rdfs:label "Reasoning Trace" ;
rdfs:comment """An ordered sequence of reasoning steps that lead
from initial facts to a final conclusion.""" .
re:Proof rdfs:subClassOf re:ReasoningTrace .
re:Justification rdfs:subClassOf re:ReasoningTrace .
reasoningconstruct taxonomy
inference rules
formal reasoning patterns are represented as constructs:
re:InferenceRule rdf:type owl:Class ;
rdfs:subClassOf re:ReasoningConstruct ;
rdfs:label "Inference Rule" ;
rdfs:comment """A formal rule that justifies a step of logical
inference from premises to a conclusion.""" .
re:RuleOfInference rdfs:subClassOf re:InferenceRule .
re:RuleOfReplacement rdfs:subClassOf re:InferenceRule .
# Specific inference rules
re:ModusPonens rdfs:subClassOf re:RuleOfInference .
re:ModusTollens rdfs:subClassOf re:RuleOfInference .
re:HypotheticalSyllogism rdfs:subClassOf re:RuleOfInference .
logical connectives
operators for combining statements:
re:LogicalConnective rdfs:subClassOf re:ReasoningConstruct .
re:UnaryConnective rdfs:subClassOf re:LogicalConnective .
re:BinaryConnective rdfs:subClassOf re:LogicalConnective .
re:NaryConnective rdfs:subClassOf re:LogicalConnective .
# Specific connectives
re:Negation rdfs:subClassOf re:UnaryConnective .
re:Conjunction rdfs:subClassOf re:BinaryConnective .
re:Disjunction rdfs:subClassOf re:BinaryConnective .
re:Implication rdfs:subClassOf re:BinaryConnective .
fallacies
flawed reasoning patterns:
re:Fallacy rdfs:subClassOf re:ReasoningConstruct .
re:FormalFallacy rdfs:subClassOf re:Fallacy .
re:InformalFallacy rdfs:subClassOf re:Fallacy .
# Specific fallacy types
re:AdHominem rdfs:subClassOf re:InformalFallacy .
re:StrawMan rdfs:subClassOf re:InformalFallacy .
re:AffirmingTheConsequent rdfs:subClassOf re:FormalFallacy .
reasoningqualifier taxonomy
modality
truth qualifications beyond simple true/false:
re:Modality rdf:type owl:Class ;
rdfs:subClassOf re:ReasoningQualifier ;
rdfs:label "Modality" ;
rdfs:comment "Qualifies the truth of a statement (necessity, possibility, belief)." .
re:AlethicModality rdfs:subClassOf re:Modality .
re:EpistemicModality rdfs:subClassOf re:Modality .
re:DeonticModality rdfs:subClassOf re:Modality .
uncertainty
confidence and probability measures:
re:Uncertainty rdfs:subClassOf re:ReasoningQualifier .
re:Probability rdfs:subClassOf re:Uncertainty .
re:FuzzyValue rdfs:subClassOf re:Uncertainty .
re:Confidence rdfs:subClassOf re:Uncertainty .
properties and relationships
structural properties
core relationships between reasoning elements:
# Argument structure
re:hasPremise rdf:type owl:ObjectProperty ;
rdfs:domain re:Argument ;
rdfs:range re:Premise .
re:hasConclusion rdf:type owl:ObjectProperty ;
rdfs:domain re:Argument ;
rdfs:range re:Conclusion .
re:usesRule rdf:type owl:ObjectProperty ;
rdfs:domain re:Argument ;
rdfs:range re:InferenceRule .
# Statement composition
re:hasOperand rdf:type owl:ObjectProperty ;
rdfs:domain re:CompoundStatement ;
rdfs:range re:Statement .
re:hasLeftOperand rdfs:subPropertyOf re:hasOperand .
re:hasRightOperand rdfs:subPropertyOf re:hasOperand .
re:hasAntecedent rdfs:subPropertyOf re:hasLeftOperand ;
rdfs:domain re:ConditionalStatement .
re:hasConsequent rdfs:subPropertyOf re:hasRightOperand ;
rdfs:domain re:ConditionalStatement .
defeasible reasoning properties
attack and support relationships:
re:attacks rdf:type owl:ObjectProperty ;
rdfs:domain re:Argument ;
rdfs:range re:Argument ;
rdfs:comment "Indicates that one argument attacks another." .
re:defeats rdfs:subPropertyOf re:attacks ;
rdfs:comment "A successful attack that defeats the target argument." .
re:undercuts rdfs:subPropertyOf re:attacks ;
rdfs:comment "Attacks the inferential link between premises and conclusion." .
re:rebuts rdfs:subPropertyOf re:attacks ;
rdfs:comment "Directly contradicts the conclusion of another argument." .
re:supports rdf:type owl:ObjectProperty ;
rdfs:domain re:Argument ;
rdfs:range re:Argument .
data properties
literal values and measurements:
re:hasContent rdf:type owl:DatatypeProperty ;
rdfs:domain re:Statement ;
rdfs:range xsd:string ;
rdfs:comment "The literal content of a statement." .
re:isValid rdf:type owl:DatatypeProperty ;
rdfs:domain re:DeductiveArgument ;
rdfs:range xsd:boolean .
re:hasInductiveStrength rdf:type owl:DatatypeProperty ;
rdfs:domain re:InductiveArgument ;
rdfs:range xsd:float .
re:hasProbabilityValue rdf:type owl:DatatypeProperty ;
rdfs:domain re:Probability ;
rdfs:range xsd:float .
constraints and restrictions
structural constraints
mandatory relationships and cardinality restrictions:
# Every Argument must have at least one Premise
re:Argument rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:onProperty re:hasPremise ;
owl:minCardinality "1"^^xsd:nonNegativeInteger ] .
# Every Argument must have exactly one Conclusion
re:Argument rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:onProperty re:hasConclusion ;
owl:cardinality "1"^^xsd:nonNegativeInteger ] .
# Every Statement must have content
re:Statement rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:onProperty re:hasContent ;
owl:cardinality "1"^^xsd:nonNegativeInteger ] .
value constraints
data type restrictions:
# Probability values must be between 0 and 1
re:hasProbabilityValue rdfs:range
[ rdf:type rdfs:Datatype ;
owl:onDatatype xsd:float ;
owl:withRestrictions (
[ xsd:minInclusive "0.0"^^xsd:float ]
[ xsd:maxInclusive "1.0"^^xsd:float ]
) ] .
# Confidence values must be between 0 and 1
re:hasConfidenceValue rdfs:range
[ rdf:type rdfs:Datatype ;
owl:onDatatype xsd:float ;
owl:withRestrictions (
[ xsd:minInclusive "0.0"^^xsd:float ]
[ xsd:maxInclusive "1.0"^^xsd:float ]
) ] .
disjointness constraints
mutual exclusion between classes:
# Core class disjointness
owl:AllDisjointClasses ;
owl:members ( re:InformationUnit re:ReasoningConstruct re:ReasoningQualifier ) .
# Argument type disjointness
owl:AllDisjointClasses ;
owl:members ( re:DeductiveArgument re:InductiveArgument
re:AbductiveArgument re:DefeasibleArgument ) .
# Modality type disjointness
owl:AllDisjointClasses ;
owl:members ( re:AlethicModality re:EpistemicModality re:DeonticModality ) .
usage examples
simple deductive argument
the classic socrates argument in turtle syntax:
@prefix ex: <http://example.org/reasoning-example#> .
# Define the statements
ex:premise1 rdf:type re:Premise ;
re:hasContent "All men are mortal." .
ex:premise2 rdf:type re:Premise ;
re:hasContent "Socrates is a man." .
ex:conclusion1 rdf:type re:Conclusion ;
re:hasContent "Socrates is mortal." .
# Define the argument
ex:SocratesArgument rdf:type re:DeductiveArgument ;
re:hasPremise ex:premise1, ex:premise2 ;
re:hasConclusion ex:conclusion1 ;
re:usesRule re:ModusPonens ;
re:isValid true .
# Define the reasoning trace
ex:SocratesProof rdf:type re:Proof ;
re:hasStep ex:SocratesArgument ;
re:hasGoal ex:conclusion1 ;
re:hasInitialFactSet ex:premise1, ex:premise2 .
defeasible reasoning example
non-monotonic reasoning with defeat relations:
# Default argument: birds fly
ex:premise3 rdf:type re:Premise ;
re:hasContent "Tweety is a bird." .
ex:premise4 rdf:type re:Premise ;
re:hasContent "Birds typically fly." .
ex:conclusion2 rdf:type re:Conclusion ;
re:hasContent "Tweety flies." .
ex:BirdFliesArgument rdf:type re:DefaultArgument ;
re:hasPremise ex:premise3, ex:premise4 ;
re:hasConclusion ex:conclusion2 ;
re:defeasibilityStrength "0.8"^^xsd:float .
# Defeating argument: penguins don't fly
ex:premise5 rdf:type re:Premise ;
re:hasContent "Tweety is a penguin." .
ex:conclusion3 rdf:type re:Conclusion ;
re:hasContent "Tweety does not fly." .
ex:PenguinArgument rdf:type re:DefeasibleArgument ;
re:hasPremise ex:premise5 ;
re:hasConclusion ex:conclusion3 ;
re:defeats ex:BirdFliesArgument .
modal reasoning example
necessity and possibility with uncertainty:
# Alethic modal statement
ex:modalStatement1 rdf:type re:Statement ;
re:hasContent "All bachelors are unmarried men." ;
re:hasQualifier ex:necessaryTruth .
ex:necessaryTruth rdf:type re:AlethicModality .
# Epistemic modal statement with uncertainty
ex:modalStatement2 rdf:type re:Statement ;
re:hasContent "It will rain tomorrow." ;
re:hasQualifier ex:believedTrue .
ex:believedTrue rdf:type re:EpistemicModality .
ex:weatherProbability rdf:type re:Probability ;
re:hasProbabilityValue "0.7"^^xsd:float ;
re:qualifies ex:modalStatement2 .
argumentation framework
abstract argumentation structure:
ex:DebateFramework rdf:type re:ArgumentationFramework ;
re:hasArgument ex:Argument1, ex:Argument2, ex:Argument3 ;
re:hasAttackRelation ex:attack1, ex:attack2 .
ex:attack1 rdf:type re:AttackRelation ;
re:attacks ex:Argument1 ;
re:isAttackedBy ex:Argument2 .
ex:Argument1 re:hasArgumentStatus ex:rejectedStatus .
ex:Argument2 re:hasArgumentStatus ex:acceptedStatus .
ex:acceptedStatus rdf:type re:AcceptedStatus .
ex:rejectedStatus rdf:type re:RejectedStatus .
query examples
sparql queries for reasoning analysis
find all valid deductive arguments:
PREFIX re: <http://example.org/reasoning#>
SELECT ?argument ?premise ?conclusion WHERE {
?argument a re:DeductiveArgument ;
re:isValid true ;
re:hasPremise ?premise ;
re:hasConclusion ?conclusion .
}
find defeated arguments:
PREFIX re: <http://example.org/reasoning#>
SELECT ?defeated ?defeater WHERE {
?defeater re:defeats ?defeated .
OPTIONAL {
?defeated re:hasConclusion ?defeatedConclusion .
?defeater re:hasConclusion ?defeaterConclusion .
}
}
find arguments with high uncertainty:
PREFIX re: <http://example.org/reasoning#>
SELECT ?argument ?uncertainty ?value WHERE {
?argument re:hasConclusion ?conclusion .
?conclusion re:hasQualifier ?uncertainty .
?uncertainty a re:Uncertainty .
{
?uncertainty re:hasProbabilityValue ?value .
FILTER(?value < 0.5)
} UNION {
?uncertainty re:hasConfidenceValue ?value .
FILTER(?value < 0.5)
}
}
implementation patterns
python integration
owlready2 for ontology manipulation:
from owlready2 import *
# Load the reasoning ontology
onto = get_ontology("http://example.org/reasoning").load()
# Create a new argument instance
class MyArgument(onto.DeductiveArgument):
pass
# Instantiate premises and conclusion
premise1 = onto.Premise("All humans are mortal")
premise2 = onto.Premise("Socrates is human")
conclusion = onto.Conclusion("Socrates is mortal")
# Create the argument
socrates_arg = MyArgument()
socrates_arg.hasPremise = [premise1, premise2]
socrates_arg.hasConclusion = [conclusion]
socrates_arg.isValid = True
# Save the ontology
onto.save("reasoning_kb.owl")
rdflib for sparql
import rdflib
from rdflib import Graph, Namespace, Literal, URIRef
# Create graph and load ontology
g = Graph()
g.parse("reasoning_ontology.ttl", format="turtle")
# Define namespaces
RE = Namespace("http://example.org/reasoning#")
# Query for all arguments and their validity
query = """
SELECT ?arg ?valid WHERE {
?arg a re:DeductiveArgument ;
re:isValid ?valid .
}
"""
results = g.query(query, initNs={'re': RE})
for row in results:
print(f"Argument: {row.arg}, Valid: {row.valid}")
reasoning engine integration
apache jena for inference:
import org.apache.jena.ontology.OntModel;
import org.apache.jena.ontology.OntModelSpec;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.reasoner.Reasoner;
import org.apache.jena.reasoner.ReasonerRegistry;
// Load ontology
OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
model.read("reasoning-ontology.ttl", "TURTLE");
// Create reasoner
Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
InfModel infModel = ModelFactory.createInfModel(reasoner, model);
// Query for inferred relationships
String queryString = """
PREFIX re: <http://example.org/reasoning#>
SELECT ?arg1 ?arg2 WHERE {
?arg1 re:defeats ?arg2 .
}
""";
Query query = QueryFactory.create(queryString);
QueryExecution qe = QueryExecutionFactory.create(query, infModel);
ResultSet results = qe.execSelect();
validation and testing
consistency checking
owl reasoning for validation:
from owlready2 import sync_reasoner_pellet
# Load ontology with instances
onto = get_ontology("reasoning_kb.owl").load()
# Run consistency check
try:
sync_reasoner_pellet(infer_property_values=True, infer_data_property_values=True)
print("Ontology is consistent")
except InconsistentOntologyError as e:
print(f"Inconsistency detected: {e}")
constraint validation
shacl shapes for data quality:
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix re: <http://example.org/reasoning#> .
# Shape for valid arguments
re:ArgumentShape a sh:NodeShape ;
sh:targetClass re:Argument ;
sh:property [
sh:path re:hasPremise ;
sh:minCount 1 ;
sh:message "Every argument must have at least one premise" ;
] ;
sh:property [
sh:path re:hasConclusion ;
sh:exactCount 1 ;
sh:message "Every argument must have exactly one conclusion" ;
] .
# Shape for probability values
re:ProbabilityShape a sh:NodeShape ;
sh:targetClass re:Probability ;
sh:property [
sh:path re:hasProbabilityValue ;
sh:datatype xsd:float ;
sh:minInclusive 0.0 ;
sh:maxInclusive 1.0 ;
sh:message "Probability values must be between 0 and 1" ;
] .
advantages and limitations
advantages
semantic interoperability: standard rdf/owl enables data exchange between systems
formal semantics: precise meaning through description logic foundations
extensibility: easy to add domain-specific reasoning concepts
tool support: mature ecosystem of semantic web tools and reasoners
query capability: powerful sparql queries for complex reasoning analysis
limitations
complexity: owl’s expressiveness can lead to computational intractability
learning curve: requires understanding of semantic web technologies
performance: reasoning over large knowledge bases can be slow
modeling choices: multiple ways to represent the same concepts
tool dependency: requires specialized tools for effective use
related ontologies
existing standards
dublin core: metadata elements for information resources
foaf: describing people and social networks
prov-o: provenance and derivation of information
skos: knowledge organization systems
time: temporal concepts and relationships
domain-specific extensions
legal reasoning: extensions for legal arguments and case law
scientific reasoning: modeling experimental reasoning and hypothesis testing
ethical reasoning: deontic logic and moral reasoning frameworks
argumentation mining: natural language processing integration
further study
semantic web foundations
- hitzler, krötzsch & rudolph: “foundations of semantic web technologies” (comprehensive owl reference)
- antoniou & van harmelen: “a semantic web primer” (introduction to rdf/owl)
- allemang & hendler: “semantic web for the working ontologist” (practical modeling guide)
ontology engineering
- noy & mcguinness: “ontology development 101: a guide to creating your first ontology”
- staab & studer: “handbook on ontologies” (comprehensive ontology reference)
- sure, staab & studer: “ontology engineering methodology”
reasoning and inference
- baader et al.: “the description logic handbook” (formal foundations)
- horrocks & sattler: “ontology reasoning in the shoq(d) description logic”
- parsia & sirin: “pellet: an owl dl reasoner”
implementation tools
- protégé: ontology editor with reasoning support
- owlready2: python library for owl ontology manipulation
- apache jena: java framework for semantic web applications
- rdflib: python library for rdf processing
- allegrograph: scalable rdf graph database
══════════════════════════════════════════════════════════════════