Policies and Semantic Web Rules in Practise

= Test yourself, answer these questions =


 * Try to understand the examples: See "References".
 * Try to implement a counter: See "Adding amounts".

= Lecture notes =

Lecture notes 2014

 * Notes: [[Media:UNIK4710-L9-v14.pdf]]
 * Video: : mms://lux.unik.no/UNIK4710-JN/UNIK-20140328.wmv

Lecture notes 2013

 * Notes: [[Media:UNIK4710-L9-v13.pdf]]
 * Video: : mms://lux.unik.no/UNIK4710-JN/UNIK-20130315.wmv

Lecture notes 2012

 * Notes: [[Media:UNIK4710-L9-v12.pdf]]
 * Video: mms://lux.unik.no/UNIK4710-JN/2012/UNIK-20120323.wmv

= Presentations =

Presentations 2013

 * Protege 3.x vs Protege 4.x by Martin - see presentation later down (run presentation from this page)
 * SWRL in Protege 4.x by Philip: See http://goo.gl/xxxxx
 * Properties & internal reasoning in Protege by Jose: [[Media:Properties_Jose.pdf]]
 * Protege 3.x vs 4.x by Martin: [[Media:protege3_vs_4.pdf]]

Good presentation
 * http://protege.stanford.edu/conference/2006/submissions/slides/7.2wang_protege2006.pdf

= Other Info=


 * title: Running an example: Rules for measures
 * author: Josef Noll
 * subfooter: UNIK4710/UNIK9710

= ⌘ Ontology =


 * Ontology - Protege: [[Media:Salary-Query_example-owl.zip]]

⌘ Rules for measures
Person(?p) ^ hasMinSalary(?p, ?s) ^ hasAmount(?s, ?a) ^ swrlb:greaterThan(?a, 10000) -> query:select(?p)
 * Have owl class called Salary with properties hasCurrency and hasAmount,

Person -> Instance: Arne -> hasMinSalary -> has value (15000) Person(?x) ^ hasMinSalary(?x,?p) ^ hasAmount(?p,?a) ^ swrlb:greaterThan(?a,90) -> sqwrl:slect(?x,?a)
 * Creating a query to get information out of my ontology:

⌘ Example
Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p)

Can be easily turned in to a SQWRL query by replacing its consequent:

Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> sqwrl:select(?p, ?age)

Another alternative is to simply add a sqwrl:select clause at the end of a rule:

Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p) ^ sqwrl:select(?p, ?age)

⌘ Adding amounts
how do I formulate that
 * Person listens to a song -> count+1 (of that person listening to the song)


 * Info SWRLBuiltInBridge: http://protege.cim3.net/cgi-bin/wiki.pl?SWRLBuiltInBridge#nid88T

=⌘ Protége 3.x versus 4.x = by Martin

Two different modeling paradimgs: What we want to use depends on the need of our ontology
 * Protege 3.x using OWL 1.0
 * Protege 4.x using Frames

⌘ Similarities
Same structure:
 * Classes (collection of instances)
 * Properties (describes attributes of classes and relationships)
 * Individuals

The difference lies within the semantics….

⌘ Differences
OWL 1.0 (Protege 3.x)
 * Objects with same name can be the same thing
 * Open World Assumption (everything is ALLOWED until otherwise specified)
 * Can contain instances of all kinds of interpretations
 * Statements about classes can be both must and necessary
 * Different reasoner
 * SWRL Query language

Frames, OWL 2.0 (Protege 4.x)
 * Objects with same name are assumed to be different
 * Closed World Assumption (everything is PROHIBITED unitil otherwise specified)
 * Can only contain instances which are explicitly specified
 * Statements about classes goes for all children (only must)
 * Logical query language
 * More property characteristics

⌘ Strengths of OWL 1.0/Protége 3.x

 * Allowing inferred subclasses and type information
 * Reducing number of facts we need to know before making complex expression (more freedom)
 * Apply standard set of operations on classes
 * Transitive properties

⌘ Strenghts of OWL 2.0/Protége 4.x

 * Supports metamodeling
 * Classes may be used as property values
 * Default reasoning (defaults are used to fill partial knowledge)
 * User defined data types