1) The document discusses ontology use for querying and rule-based reasoning as well as limitations of ontology languages.
2) It provides examples of using SPARQL to query ontologies and define rules in N3 logic.
3) Biomedical ontologies like MeSH, Gene Ontology, and the Foundational Model of Anatomy are discussed as being used for tasks like literature searching, data annotation, and representing encyclopedic knowledge.
4. Limitations of ontology
languages
• All formal languages are bounded
• What you can say depends on which
grammatical constructs are allowed by design
• What you can say is called expressivity
• Design factors include
– Necessity for use cases
– Human comprehension of the language
– Computational complexity
– Correspondence to formal frameworks
– Interoperability with other languages
– And many more…
4
5. Limitations of ontology
languages
• UML Class diagrams, OWL, etc.
can describe static knowledge
• Some reasoning is possible in these languages
– Subsumption, class membership
– Transitivity, connectivity
• Some reasoning falls outside of their scope
– Arithmetic
– Probabilistic reasoning
– Rich logical statements (First Order Logic, etc.)
5
6. Examples
• Property chain (can be modelled in OWL2)
– Given childOf and brotherOf, define the class Uncle
– Example definition
IF X childOf Y AND Y brotherOf U
THEN U in Uncle
• Individual comparison
– Given hasBoss and hasWife, define the class of people
whose boss is not their wife
– Example definition
IF X hasBoss Y AND X hasWife Z AND Y ≠ Z
THEN X in NoBossWife
6
7. Examples
• Arithmetic
– Given height and width, define the class of people
that are wider than tall (BodyBuilder)
– Example definition:
IF X height H AND X width W AND W > H
THEN X in BodyBuilder
• Ordering
– Given hasPrice and the class Basket, define that the
cheapest purchase is a FreeItem
– How do you sort at all?
7
8. Queries
• Ontology query languages exist to
– Verify facts on a knowledge base
– Retrieve matching statements
– Build new statements
• Basic constructs of OWL ontology queries
– URIs and values in triples
– Variables
– URI and value constraints
– and more depending on the language…
• Standard query language for OWL: SPAQL
8
9. SPARQL
• SELECT
– Returns all, or a subset of, the variables bound in a query
pattern match.
• CONSTRUCT
– Returns an RDF graph constructed by substituting
variables in a set of triple templates.
• ASK
– Returns a Boolean indicating whether a query pattern
matches or not.
• DESCRIBE
– Returns an RDF graph that describes the resources found.
9
10. Finding uncles with SELECT
SELECT ?u
FROM
{
?x :childOf ?y.
?u :brotherOf ?y
}
10
15. Bodybuilders in SPARQL
• Make a SPARQL CONSTRUCT query to classify
bodybuilders
IF X height H AND X width W AND W > H
THEN X in BodyBuilder
• Hint: You have to use inside the WHERE clause
CONSTRUCT { … } WHERE { … FILTER ( … ) }
15
16. Queries versus Ontologies
• Ontologies exist, but queries have to be fired
• SPARQL queries can not return variables.
• SPARQL queries close the world, but can not
check if something is not true, except on data
values
• Answers of queries are not part of the ontology,
even for CONSTRUCT queries
• You can make the answers part by
– Adding the answers to your ontology
– Using rules…
16
17. Rules
• Four types of rules
– Derivation or deduction rules
“If A is true, then B is also true.”
– Transformation rules
“If you find A, then produce B.”
– Integrity constraints
“A is always true, or fail.”
– Reaction or Event-Condition-Action rules
“When A: If A > B then do C.”
• Not every rule language supports all types of rules
• Examples of rule languages:
Prolog, CLIPS (Jess), SWRL, N3 Rules
17
18. Example rules in N3
• Uncles in N3
{ ?x :childOf ?y. ?u :brotherOf ?y }
=> { ?u :uncleOf ?x }
• Non-bossy wife in N3
{ ?x :hasBoss ?b. ?x :hasWife ?w. ?b log:notEqualTo ?w }
=> { ?x a :NoBossWife }.
• BodyBuilders in N3
{ ?x :height ?h. ?x :width ?w. ?w math:greaterThan ?h }
=> { ?x a :BodyBuilder }.
18
19. OWL in N3
• The consequences of N3 rules are part of the
ontology
• Can you write (parts of) OWL in N3?
• Yes, for example:
{?p rdf:type owl:TransitiveProperty. ?x ?p ?o. ?s ?p ?x}
=> {?s ?p ?o}.
• Another example, instances of disjoint classes:
{?a owl:disjointWith ?b. ?x a ?a. ?y a ?b }
=> {?x owl:differentFrom ?y}.
19
21. Sample applications in
biomedicine
• Based on paper & presentation by Nigam Shah
& Barry Smith, Ontologies for biomedicine –
how to make and use them
http://www.bioontology.org/wiki/index.php/Ontolo
21
22. Use patterns for ontologies
• Reference for naming things
• Representation of encyclopedic knowledge
• Specification of information models
• Specification of data exchange formats
• Representation of semantics of data for
information integration
• Computer reasoning with data
22