Running an example with SQWRL & SWRL

Susana R. de Novoa

Ontology with Rules & Queries

Running SQWRL

  • Select instances of person: Name and Age
Person(?p) ∧ hasAge(?p, ?age) ∧ hasName(?p, ?name) →  sqwrl:select(?p, ?name, ?age)  

Creating Properties

hasAge


hasName

Applied Properties

  • Have owl class called Person with properties hasAge and hasName:

Person's Properties

Creating Queries

  • Creating a query to get information out of my ontology:

Result of running queries

Running SWRL

  • Who is a driver?:
Person(?p) ∧ hasAge(?p, ?age) ∧ swrlb:greaterThanOrEqual(?age, 18) ∧ hasCar(?p, ?car) →  isDriver(?p, true)  

Creating Properties

hasCar

isDriver

Applied Properties

  • Before Jess Reasoning:

Person's Properties

Creating Rules

Rules

  • After Jess Reasoning:

Result of running rules