SlideShare a Scribd company logo
1 of 29
+

Rules

Mariano Rodriguez-Muro,
Free University of Bozen-Bolzano
+

Disclaimer


License


This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 License
(http://creativecommons.org/licenses/by-sa/3.0/)
+

Reading material


Chapter 7. Semantic Web Programming



Chapter 6. Foundations of Semantic Web.
+

What are rules


Means of representing knowledge



An ontology language



Can be seen as conditions statements:
if []
then []


if x is a Man and x hasChild y Father(x)
+

Why rules


Easy to understand



RDFS (and sometimes OWL) is not enough:

If a person x is the brother of somebody y, and there is z such that z is
the uncle of x, then z is the uncle of y too.
for all x,y,z, if hasBrother(x,y) & hasUncle(x,z) then hasUncle(y,z)
+
SWRL
+

7

SWRL


How can datalog and OWL be combined?



SWRL – Semantic Web Rule Language [swirl]

•

Proposal for a rule based Semantic Web Language (W3C member
submission)
http://www.w3.org/Submission/SWRL/

•

Idea: datalog rules referring to RDF classes/properties
Symbols in rules can be OWL identifiers or new symbols

•

Various further features and syntactic forms

•

Support in inference engines (very wide spread support)
+

SWRL Syntaxes



Two syntaxes:

1.

Abstract syntax based on “Extended Backus-Naur Form
notation
1. Directly translatable to a Human readable syntax (SPARQL
lie)

2.

XML Concrete Syntax
1. Parsable by existing OWL/RDF/XML parsers
2. Suitable as a exchange language for the semantic web
+

Abstract Syntax
+

Abstract Syntax Example

For the rule:

The corresponding abstract syntax:
+

Example 1

A very common use for rules is to move
property values from one individual to a
related individual
Express the fact that the style of an art
object is the same as the style of the
creator.

Artist(?x) & artistStyle(?x,?y) & Style(?y) & creator(?z,?x) ⇒ style/period(?z,?y)

Implies(Antecedent(Artist(I-variable(x))
artistStyle(I-variable(x) I-variable(y))
Style(I-variable(y))
creator(I-variable(z) I-variable(x)))
Consequent(style/period(I-variable(z) I-variable(y))))
+

RDFS as rules


Provide a translation of all RDFS axiom as rules


subClassOf



subPropertyOf



domain



range
+

Beyond RDFS


Transitivity of a property P



Reflexivity of a property P



Inverse of a property P



Equivalence of properties/classes



Sufficient conditions for class membership
+

Built ins


One of the main motivations for SWRL rules



Provide means to manipulate data


Comparisons



Mathematical transformations



List operators



Modifiers for strings, dates and times



Boolean and URI checks



URI construction
+

Built-ins examples
hasAddress(?creditCardMachine, ?ccAddress) ^
hasAddress(?customer, ?custAddress) ^
hasState(?ccAddress, ?ccState) ^
hasState(?custAddress, ?custState) ^
swrlb:equal(?custState, ?ccState) ^
hasBirthday(?customer, ?bDate) ^
swrlb:subtractYearMonthDurations(?diff, ?today, ?bDate) ^
swrlb:greaterThanOrEqual(?diff, "P18Y0M")
→ LegalCigaretteBuyer(?customer)
+

Built-ins examples
foaf:Person(?person) ^
foaf:gender(?person, "female") ^
foaf:name(?person, ?name)
→ swrlb:stringConcat(?s, "Dear Ms. ", ?name, ":") ^
hasFormalGreeting(?person, ?s)
+

Empty antecedents/consequent


Empty antecedent indicate the
consequent is ALWAYS true



State class/property
disjointness



Empty consequents indicate the
antecedent is a contradiction



State a FK-like constraint



State number-restriction
constraints



Allow to define FACTs and
CONSTRAINTS
+

XML Concrete Syntax
•

Based on OWL XML Presentation Syntax and RuleML

•

The SWRL XML syntax uses the OWL XML Ontology root
element and some of its subelements:
•

VersionInfo

•

PriorVersion

•

BackwardCompatibleWith

•

IncompatibleWith

•

Imports

•

Annotation

•

Class

•

EnumeratedClass

•SubClassOf
•EquivalentClasses
•DisjointClasses
•DatatypeProperty
•ObjectProperty
•SubPropertyOf
•EquivalentProperties
•Individual
•SameIndividual
•DifferentIndividuals
+

XML Elements (1)
•

VAR

•

IMP
+

XML Element (2)
•

Rlab

•

Body

•

Head
+

XML Elements (cont)
•

classAtom
+

XML Elements (cont)
•

datarangeAtom
+

XML Elements (cont)
•

individualPropertyAxiom
+

XML Elements (cont)
•

datavaluedPropertyAxiom
+

XML Elements (cont)
•

sameIndividualAtom
+

XML Elements (cont)
•

differentIndividualsAtom
+

XML Elements (cont)
•

builtInAtom



Built in atoms include: Comparison, Mathematical transformations, List operators, Modifiers for strings, dates and times,
Boolean and URI checks, URI constructions
+

When RDFS/Rules
RDFS/OWL


Expressivity for RDFS/OWL
is enough



Use is knowledge sharing



Application requires high
performance/uses
specialized reasoner



Application requires standard
behavior

Rules


Expressivity only captures by
rules



Use is application behavior



Application requires complex
reasoning



Application relies on a particular
inference engine only
+

Conclusion


Rules are a VERY expressive (powerful) ontology language



Rules can capture most inferences provided by RDFS (part of OWL
too)



Rules shouldn’t be abused. Performance of rule based reasoning is
suboptimal w.r.t. RDFS/OWL specialized reasoning.



Rules can be a powerful mean to capture application behiavor.



Note, although SWRL is the defacto rule language for the semantic
web, there are new standards, i.e. RIF, that might take over in the
future (further information in FSW Chapter 6)

More Related Content

What's hot

Efficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF DatabasesEfficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF Databases
Alexandra Roatiș
 
SWT Lecture Session 9 - RDB2RDF direct mapping
SWT Lecture Session 9 - RDB2RDF direct mappingSWT Lecture Session 9 - RDB2RDF direct mapping
SWT Lecture Session 9 - RDB2RDF direct mapping
Mariano Rodriguez-Muro
 

What's hot (20)

Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
 
RDF briefing
RDF briefingRDF briefing
RDF briefing
 
Another RDF Encoding Form
Another RDF Encoding FormAnother RDF Encoding Form
Another RDF Encoding Form
 
Efficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF DatabasesEfficient Query Answering against Dynamic RDF Databases
Efficient Query Answering against Dynamic RDF Databases
 
Getting triples from records: the role of ISBD
Getting triples from records: the role of ISBDGetting triples from records: the role of ISBD
Getting triples from records: the role of ISBD
 
VALA Tech Camp 2017: Intro to Wikidata & SPARQL
VALA Tech Camp 2017: Intro to Wikidata & SPARQLVALA Tech Camp 2017: Intro to Wikidata & SPARQL
VALA Tech Camp 2017: Intro to Wikidata & SPARQL
 
Scaling the (evolving) web data –at low cost-
Scaling the (evolving) web data –at low cost-Scaling the (evolving) web data –at low cost-
Scaling the (evolving) web data –at low cost-
 
Triple Stores
Triple StoresTriple Stores
Triple Stores
 
Rdf
RdfRdf
Rdf
 
Introduction to RDF
Introduction to RDFIntroduction to RDF
Introduction to RDF
 
Efficient RDF Interchange (ERI) Format for RDF Data Streams
Efficient RDF Interchange (ERI) Format for RDF Data StreamsEfficient RDF Interchange (ERI) Format for RDF Data Streams
Efficient RDF Interchange (ERI) Format for RDF Data Streams
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphs
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
Debunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative FactsDebunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative Facts
 
RDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic RepositoriesRDF, SPARQL and Semantic Repositories
RDF, SPARQL and Semantic Repositories
 
An Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of Data
 
Web Data Management with RDF
Web Data Management with RDFWeb Data Management with RDF
Web Data Management with RDF
 
SWT Lecture Session 9 - RDB2RDF direct mapping
SWT Lecture Session 9 - RDB2RDF direct mappingSWT Lecture Session 9 - RDB2RDF direct mapping
SWT Lecture Session 9 - RDB2RDF direct mapping
 
SWT Lecture Session 10 R2RML Part 1
SWT Lecture Session 10 R2RML Part 1SWT Lecture Session 10 R2RML Part 1
SWT Lecture Session 10 R2RML Part 1
 
Ist16-04 An introduction to RDF
Ist16-04 An introduction to RDF Ist16-04 An introduction to RDF
Ist16-04 An introduction to RDF
 

Viewers also liked (7)

SWT Lab 2
SWT Lab 2SWT Lab 2
SWT Lab 2
 
2011.118 1233
2011.118 12332011.118 1233
2011.118 1233
 
SWT Lab 5
SWT Lab 5SWT Lab 5
SWT Lab 5
 
SWT Lab 3
SWT Lab 3SWT Lab 3
SWT Lab 3
 
SWT Lab 1
SWT Lab 1SWT Lab 1
SWT Lab 1
 
SWT Lecture Session 8 - Inference in jena
SWT Lecture Session 8 - Inference in jenaSWT Lecture Session 8 - Inference in jena
SWT Lecture Session 8 - Inference in jena
 
7 advanced uses of rdfs
7 advanced uses of rdfs7 advanced uses of rdfs
7 advanced uses of rdfs
 

Similar to SWT Lecture Session 8 - Rules

Web 3 Mark Greaves
Web 3 Mark GreavesWeb 3 Mark Greaves
Web 3 Mark Greaves
Mediabistro
 
Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...
Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...
Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...
Trey Grainger
 

Similar to SWT Lecture Session 8 - Rules (20)

Explanations in Dialogue Systems through Uncertain RDF Knowledge Bases
Explanations in Dialogue Systems through Uncertain RDF Knowledge BasesExplanations in Dialogue Systems through Uncertain RDF Knowledge Bases
Explanations in Dialogue Systems through Uncertain RDF Knowledge Bases
 
Linked Data Tutorial
Linked Data TutorialLinked Data Tutorial
Linked Data Tutorial
 
Vital AI: Big Data Modeling
Vital AI: Big Data ModelingVital AI: Big Data Modeling
Vital AI: Big Data Modeling
 
CSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web TutorialCSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web Tutorial
 
Semantic Web: introduction & overview
Semantic Web: introduction & overviewSemantic Web: introduction & overview
Semantic Web: introduction & overview
 
Gerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol Graph Databases
Gerry McNicol Graph Databases
 
The Empirical Turn in Knowledge Representation
The Empirical Turn in Knowledge RepresentationThe Empirical Turn in Knowledge Representation
The Empirical Turn in Knowledge Representation
 
Web 3 Mark Greaves
Web 3 Mark GreavesWeb 3 Mark Greaves
Web 3 Mark Greaves
 
Jpl presentation
Jpl presentationJpl presentation
Jpl presentation
 
Jpl presentation
Jpl presentationJpl presentation
Jpl presentation
 
Jpl presentation
Jpl presentationJpl presentation
Jpl presentation
 
RDFa Semantic Web
RDFa Semantic WebRDFa Semantic Web
RDFa Semantic Web
 
State of the Semantic Web
State of the Semantic WebState of the Semantic Web
State of the Semantic Web
 
Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...
Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...
Searching on Intent: Knowledge Graphs, Personalization, and Contextual Disamb...
 
Semantics in Financial Services -David Newman
Semantics in Financial Services -David NewmanSemantics in Financial Services -David Newman
Semantics in Financial Services -David Newman
 
Querying the Web of Data
Querying the Web of DataQuerying the Web of Data
Querying the Web of Data
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 
Information Extraction and Linked Data Cloud
Information Extraction and Linked Data CloudInformation Extraction and Linked Data Cloud
Information Extraction and Linked Data Cloud
 
Web Services Catalog
Web Services CatalogWeb Services Catalog
Web Services Catalog
 
What Are Links in Linked Open Data? A Characterization and Evaluation of Link...
What Are Links in Linked Open Data? A Characterization and Evaluation of Link...What Are Links in Linked Open Data? A Characterization and Evaluation of Link...
What Are Links in Linked Open Data? A Characterization and Evaluation of Link...
 

More from Mariano Rodriguez-Muro

SWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFSSWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFS
Mariano Rodriguez-Muro
 
SWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQLSWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQL
Mariano Rodriguez-Muro
 

More from Mariano Rodriguez-Muro (17)

SWT Lecture Session 11 - R2RML part 2
SWT Lecture Session 11 - R2RML part 2SWT Lecture Session 11 - R2RML part 2
SWT Lecture Session 11 - R2RML part 2
 
SWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFSSWT Lecture Session 7 - Advanced uses of RDFS
SWT Lecture Session 7 - Advanced uses of RDFS
 
SWT Lecture Session 5 - RDFS
SWT Lecture Session 5 - RDFSSWT Lecture Session 5 - RDFS
SWT Lecture Session 5 - RDFS
 
SWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQLSWT Lecture Session 4 - SW architectures and SPARQL
SWT Lecture Session 4 - SW architectures and SPARQL
 
SWT Lecture Session 4 - Sesame
SWT Lecture Session 4 - SesameSWT Lecture Session 4 - Sesame
SWT Lecture Session 4 - Sesame
 
4 sesame
4 sesame4 sesame
4 sesame
 
SWT Lecture Session 1 - Introduction
SWT Lecture Session 1 - IntroductionSWT Lecture Session 1 - Introduction
SWT Lecture Session 1 - Introduction
 
ontop: A tutorial
ontop: A tutorialontop: A tutorial
ontop: A tutorial
 
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
Stanford'12 Intro to Ontology Based Data Access for RDBMS through query rewri...
 
Introduction to query rewriting optimisation with dependencies
Introduction to query rewriting optimisation with dependenciesIntroduction to query rewriting optimisation with dependencies
Introduction to query rewriting optimisation with dependencies
 
OXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriringOXFORD'13 Optimising OWL 2 QL query rewriring
OXFORD'13 Optimising OWL 2 QL query rewriring
 
OWLED'12 Quest
OWLED'12 QuestOWLED'12 Quest
OWLED'12 Quest
 
ODBASE'08 dl-lite explanations
ODBASE'08 dl-lite explanationsODBASE'08 dl-lite explanations
ODBASE'08 dl-lite explanations
 
IMAS'08 obda plugin
IMAS'08 obda pluginIMAS'08 obda plugin
IMAS'08 obda plugin
 
DL'12 dl-lite explanations
DL'12 dl-lite explanationsDL'12 dl-lite explanations
DL'12 dl-lite explanations
 
DL'12 mastro at work
DL'12 mastro at workDL'12 mastro at work
DL'12 mastro at work
 
AMW'11 dependencies-sem index-t-mappings
AMW'11 dependencies-sem index-t-mappingsAMW'11 dependencies-sem index-t-mappings
AMW'11 dependencies-sem index-t-mappings
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 

SWT Lecture Session 8 - Rules

  • 2. + Disclaimer  License  This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License (http://creativecommons.org/licenses/by-sa/3.0/)
  • 3. + Reading material  Chapter 7. Semantic Web Programming  Chapter 6. Foundations of Semantic Web.
  • 4. + What are rules  Means of representing knowledge  An ontology language  Can be seen as conditions statements: if [] then []  if x is a Man and x hasChild y Father(x)
  • 5. + Why rules  Easy to understand  RDFS (and sometimes OWL) is not enough: If a person x is the brother of somebody y, and there is z such that z is the uncle of x, then z is the uncle of y too. for all x,y,z, if hasBrother(x,y) & hasUncle(x,z) then hasUncle(y,z)
  • 7. + 7 SWRL  How can datalog and OWL be combined?  SWRL – Semantic Web Rule Language [swirl] • Proposal for a rule based Semantic Web Language (W3C member submission) http://www.w3.org/Submission/SWRL/ • Idea: datalog rules referring to RDF classes/properties Symbols in rules can be OWL identifiers or new symbols • Various further features and syntactic forms • Support in inference engines (very wide spread support)
  • 8. + SWRL Syntaxes  Two syntaxes: 1. Abstract syntax based on “Extended Backus-Naur Form notation 1. Directly translatable to a Human readable syntax (SPARQL lie) 2. XML Concrete Syntax 1. Parsable by existing OWL/RDF/XML parsers 2. Suitable as a exchange language for the semantic web
  • 10. + Abstract Syntax Example For the rule: The corresponding abstract syntax:
  • 11. + Example 1 A very common use for rules is to move property values from one individual to a related individual Express the fact that the style of an art object is the same as the style of the creator. Artist(?x) & artistStyle(?x,?y) & Style(?y) & creator(?z,?x) ⇒ style/period(?z,?y) Implies(Antecedent(Artist(I-variable(x)) artistStyle(I-variable(x) I-variable(y)) Style(I-variable(y)) creator(I-variable(z) I-variable(x))) Consequent(style/period(I-variable(z) I-variable(y))))
  • 12. + RDFS as rules  Provide a translation of all RDFS axiom as rules  subClassOf  subPropertyOf  domain  range
  • 13. + Beyond RDFS  Transitivity of a property P  Reflexivity of a property P  Inverse of a property P  Equivalence of properties/classes  Sufficient conditions for class membership
  • 14. + Built ins  One of the main motivations for SWRL rules  Provide means to manipulate data  Comparisons  Mathematical transformations  List operators  Modifiers for strings, dates and times  Boolean and URI checks  URI construction
  • 15. + Built-ins examples hasAddress(?creditCardMachine, ?ccAddress) ^ hasAddress(?customer, ?custAddress) ^ hasState(?ccAddress, ?ccState) ^ hasState(?custAddress, ?custState) ^ swrlb:equal(?custState, ?ccState) ^ hasBirthday(?customer, ?bDate) ^ swrlb:subtractYearMonthDurations(?diff, ?today, ?bDate) ^ swrlb:greaterThanOrEqual(?diff, "P18Y0M") → LegalCigaretteBuyer(?customer)
  • 16. + Built-ins examples foaf:Person(?person) ^ foaf:gender(?person, "female") ^ foaf:name(?person, ?name) → swrlb:stringConcat(?s, "Dear Ms. ", ?name, ":") ^ hasFormalGreeting(?person, ?s)
  • 17. + Empty antecedents/consequent  Empty antecedent indicate the consequent is ALWAYS true  State class/property disjointness  Empty consequents indicate the antecedent is a contradiction  State a FK-like constraint  State number-restriction constraints  Allow to define FACTs and CONSTRAINTS
  • 18. + XML Concrete Syntax • Based on OWL XML Presentation Syntax and RuleML • The SWRL XML syntax uses the OWL XML Ontology root element and some of its subelements: • VersionInfo • PriorVersion • BackwardCompatibleWith • IncompatibleWith • Imports • Annotation • Class • EnumeratedClass •SubClassOf •EquivalentClasses •DisjointClasses •DatatypeProperty •ObjectProperty •SubPropertyOf •EquivalentProperties •Individual •SameIndividual •DifferentIndividuals
  • 27. + XML Elements (cont) • builtInAtom  Built in atoms include: Comparison, Mathematical transformations, List operators, Modifiers for strings, dates and times, Boolean and URI checks, URI constructions
  • 28. + When RDFS/Rules RDFS/OWL  Expressivity for RDFS/OWL is enough  Use is knowledge sharing  Application requires high performance/uses specialized reasoner  Application requires standard behavior Rules  Expressivity only captures by rules  Use is application behavior  Application requires complex reasoning  Application relies on a particular inference engine only
  • 29. + Conclusion  Rules are a VERY expressive (powerful) ontology language  Rules can capture most inferences provided by RDFS (part of OWL too)  Rules shouldn’t be abused. Performance of rule based reasoning is suboptimal w.r.t. RDFS/OWL specialized reasoning.  Rules can be a powerful mean to capture application behiavor.  Note, although SWRL is the defacto rule language for the semantic web, there are new standards, i.e. RIF, that might take over in the future (further information in FSW Chapter 6)

Editor's Notes

  1. soundness, completeness, termintion
  2. soundness, completeness, termintion
  3. soundness, completeness, termintion
  4. soundness, completeness, termintion