SWRL (Semantic Web Rule Language) allows you to create custom reasoning rules that extend your ontology’s inference capabilities.
Plant Disease SWRL Examples (PPIO-Inspired)
Create practical rules for plant disease diagnosis based on PPIO framework:
# PPIO Rule 1: Host-Pathogen Specificity (Core PPIO Concept)
# If a pathogen is specific to a host and the plant is that host, infection can occur
pathogen_of(?pathogen, ?hostType) ∧ ?hostType(?plant)
→ susceptibleTo(?plant, ?pathogen)
# PPIO Rule 2: Phenotype Expression (PPIO Framework)
# If a plant has a disease that manifests specific phenotypes, express those phenotypes
hasDisease(?plant, ?disease) ∧ manifests_in_species(?disease, ?plant) ∧
causedBy(?disease, ?pathogen) ∧ expresses_phenotype(?plant, NecroticLesions)
→ expresses_phenotype(?plant, ChloroticHalo)
# PPIO Rule 3: Resistance Mechanism (PPIO Defense)
# If a plant can acquire resistance and shows resistance response, it becomes resistant
able_to_acquire_resistance(?plant, true) ∧ expresses_phenotype(?plant, HypersensitiveResponse)
→ ResistantPlant(?plant)
# PPIO Rule 4: Host Range Inference (PPIO Specificity)
# If a pathogen has Solanaceae host specificity, it can infect tomato and potato hosts
host_specificity(?pathogen, "Solanaceae family") ∧ TomatoHost(?plant)
→ pathogen_of(?pathogen, ?plant)
# Rule 5: Disease Inheritance (Enhanced with PPIO)
# If a plant has a fungal disease, it requires fungicide treatment
hasDisease(?plant, ?disease) ∧ FungalDisease(?disease)
→ requiresTreatment(?plant, Fungicide)
# Rule 6: PPIO Symptom-based Disease Inference
# Plants showing necrotic lesions and chlorotic halos likely have early blight
expresses_phenotype(?plant, NecroticLesions) ∧ expresses_phenotype(?plant, ChloroticHalo)
→ likelyHasDisease(?plant, EarlyBlight)
# Rule 7: PPIO Pathogenicity Level Assessment
# If pathogen has high pathogenicity and infects susceptible host, severe disease results
pathogenicity_level(?pathogen, ?level) ∧ swrlb:greaterThan(?level, 8.0) ∧
pathogen_of(?pathogen, ?plant) ∧ HostPlant(?plant)
→ severityScore(?disease, 9.0)
# Rule 8: Environmental Risk Assessment (PPIO Enhanced)
# Plants in high humidity with poor air circulation are disease-prone
growsIn(?plant, ?environment) ∧ hasHumidity(?environment, High) ∧
hasAirCirculation(?environment, Poor)
→ isDiseaseRisk(?plant, true)
# Rule 9: Resistance Breaking (PPIO Concept)
# If pathogen pathogenicity exceeds plant resistance threshold, resistance is overcome
pathogenicity_level(?pathogen, ?pLevel) ∧ resistance_mechanism(?plant, ?mechanism) ∧
swrlb:greaterThan(?pLevel, 8.5) ∧ pathogen_of(?pathogen, ?plant)
→ able_to_acquire_resistance(?plant, false)
# CropPest Rules 10-15: Integrated Pest Management (IPM)
# Rule 10: Economic Threshold Decision (CropPest)
# If pest count exceeds damage threshold, trigger control action
infests(?pest, ?plant) ∧ damage_threshold(?pest, ?threshold) ∧
trap_count(?monitor, ?count) ∧ monitors(?monitor, ?pest) ∧
swrlb:greaterThan(?count, ?threshold)
→ requiresTreatment(?plant, IPMStrategy)
# Rule 11: Pest-Vector Disease Transmission (CropPest)
# If insect pest is vector of pathogen and infests plant, plant gets disease
vector_of(?insect, ?pathogen) ∧ infests(?insect, ?plant) ∧
InsectPest(?insect) ∧ PlantPathogen(?pathogen)
→ causedBy(?disease, ?pathogen) ∧ hasDisease(?plant, ?disease)
# Rule 12: Host Range Pest Susceptibility (CropPest)
# If pest has polyphagous host range, more plants are susceptible
host_range(?pest, "polyphagous") ∧ Plant(?plant)
→ susceptible_to_pest(?plant, ?pest)
# Rule 13: IPM Strategy Selection (CropPest)
# If pest has high mobility, use area-wide control strategies
mobility(?pest, "high") ∧ infests(?pest, ?plant) ∧
IPMStrategy(?strategy) ∧ targets(?strategy, ?pest)
→ requiresTreatment(?plant, ?strategy)
# Rule 14: Biological Control Timing (CropPest)
# If pest life cycle is short, use frequent biological releases
pest_life_cycle(?pest, ?days) ∧ swrlb:lessThan(?days, 21) ∧
BiologicalControl(?control) ∧ targets(?control, ?pest)
→ application_timing(?control, "frequent")
# Rule 15: Economic Impact Assessment (CropPest)
# If yield loss percentage is high, prioritize immediate control
yield_loss_percentage(?pest, ?loss) ∧ swrlb:greaterThan(?loss, 20.0) ∧
infests(?pest, ?plant) ∧ IPMStrategy(?strategy) ∧ targets(?strategy, ?pest)
→ requiresTreatment(?plant, ?strategy)
# Rule 16: Resistance Management (CropPest)
# If pest shows resistance to chemical control, switch to biological
ChemicalControl(?chemical) ∧ efficacy_rate(?chemical, ?rate) ∧
swrlb:lessThan(?rate, 60.0) ∧ targets(?chemical, ?pest) ∧
BiologicalControl(?biological) ∧ targets(?biological, ?pest)
→ controlledBy(?pest, ?biological)
# Plant Ontology Rules 17-22: Anatomical Localization & Development
# Rule 17: Symptom Anatomical Localization (PO)
# If disease symptom occurs on specific plant part, localize precisely
occurs_on(?symptom, ?plantPart) ∧ PlantAnatomicalEntity(?plantPart) ∧
part_of(?plantPart, ?wholePlant) ∧ WholePlant(?wholePlant)
→ located_in(?symptom, ?plantPart)
# Rule 18: Tissue-Level Disease Targeting (PO)
# If disease affects leaves and symptom is visible, it targets epidermis
hasSymptom(?disease, ?symptom) ∧ occurs_on(?symptom, ?leaf) ∧
Leaf(?leaf) ∧ visibility(?symptom, "visible") ∧
part_of(?epidermis, ?leaf) ∧ Epidermis(?epidermis)
→ affects_tissue(?disease, ?epidermis)
# Rule 19: Vascular Disease Spread (PO)
# If disease affects vascular tissue, it can spread systemically
affects_tissue(?disease, ?vascular) ∧ VascularTissue(?vascular) ∧
transports(?vascular, ?plantPart) ∧ PlantAnatomicalEntity(?plantPart)
→ manifests_in_species(?disease, ?plantPart)
# Rule 20: Developmental Stage Vulnerability (PO)
# If plant part is in primordium stage, it's more susceptible to disease
developmental_stage(?plantPart, "primordium") ∧
PlantAnatomicalEntity(?plantPart) ∧ part_of(?plantPart, ?plant)
→ susceptibleTo(?plant, Disease)
# Rule 21: Root Disease Impact on Whole Plant (PO)
# If root system is diseased, whole plant health is affected
hasSymptom(?disease, ?symptom) ∧ occurs_on(?symptom, ?root) ∧
Root(?root) ∧ part_of(?root, ?wholePlant) ∧ WholePlant(?wholePlant)
→ hasDisease(?wholePlant, ?disease)
# Rule 22: Anatomical Development Progression (PO)
# If embryonic structure develops into mature structure, inherit properties
develops_from(?mature, ?embryonic) ∧ developmental_stage(?embryonic, "primordium") ∧
hasDisease(?plant, ?disease) ∧ part_of(?embryonic, ?plant)
→ susceptibleTo(?mature, ?disease)
# Rule 23: Leaf Position Disease Gradient (PO)
# Lower leaves (higher node numbers) are more susceptible to soil-borne diseases
node_number(?leaf, ?nodeNum) ∧ swrlb:greaterThan(?nodeNum, 5) ∧
Leaf(?leaf) ∧ part_of(?leaf, ?plant) ∧ FungalDisease(?disease)
→ susceptibleTo(?plant, ?disease)
# Rule 24: Tissue Thickness and Disease Penetration (PO)
# If tissue is thin and disease is present, penetration is easier
tissue_thickness(?tissue, ?thickness) ∧ swrlb:lessThan(?thickness, 0.1) ∧
PlantTissue(?tissue) ∧ part_of(?tissue, ?plant) ∧
hasDisease(?plant, ?disease) ∧ FungalDisease(?disease)
→ affects_tissue(?disease, ?tissue)
# Rule 25: Stomatal Density and Pathogen Entry (PO)
# High stomatal density increases pathogen entry points
stomatal_density(?epidermis, ?density) ∧ swrlb:greaterThan(?density, 300.0) ∧
Epidermis(?epidermis) ∧ part_of(?epidermis, ?leaf) ∧
part_of(?leaf, ?plant) ∧ PlantPathogen(?pathogen)
→ pathogen_of(?pathogen, ?plant)