Lab: OWL-DL: Difference between revisions

From info216
No edit summary
Line 42: Line 42:
Continue extending the InvestigationOntology from the previous exercise.  
Continue extending the InvestigationOntology from the previous exercise.  


'''Task.''' Add individuals to represent that:
'''Task.''' Use the ''Individuals by class'' tab and create the following instances of ''owl:Thing'' (for the purpose of the exercise, do not use more specific types!):
* Robert Mueller lead the Mueller Investigation.
* John L Smith (alias Jack Smith)
* Paul Manafort was indicted.
* Investigation of role in the US Capitol Attack
* Elizabeth Prelogar was an investigator.
* Investigation of Trump's handling of grade documents


'''Task.''' Start the reasoner again. Does it add more axioms/triples (marked in yellow) to the ontology?
Create ''Object property assertions'' to state that:
* John L Smith is investigating (but not leading) the Investigation of role in the US Capitol Attack
* John L Smith is investigating (but not leading) the Investigation of Trump's handling of grade documents


'''Task.''' Can you do a change that makes your ontology inconsistent? (Save often, so you always have a consistent version to revert to :-))
'''Task.''' Start the reasoner again. Does it add more axioms/triples (marked in yellow) to the ontology?  


''Tip:'' You can declare two classes as ''owl:disjointWith'' one another and set both classes as the ''rdf:type'' of some individual.
'''Task''' With the reasoner still running, use ''File -> Export inferred axioms as ontology...'' to save the reasoning results to a new file. Chose a base URI and file name for the new ontology.  


'''Task.'''
(Note that everything from the old ontology is not exported by default. If something is missing, you can try to export again or use ''Tools -> Merge'' to combine the old (handmade) and new (inferred by HermiT) ontologies.)
Make sure that your ontology contains
* a property for stating that a person is ''involved in'' an investigation and
* a subproperty for stating that a person is ''leading'' an investigation.


Create instances for Robert Mueller and for the Mueller Investigation. Assert that Robert Mueller is leading the Mueller Investigation, but not that he is involved in it.
'''Task.''' Can you do a change that makes your ontology inconsistent? (Save often, so you always have a consistent version to revert to :-))


Go to the ''Reasoner'' menu and choose the ''HermiT'' reasoner. Use ''Reasoner -> Start reasoner''. Afterwards, check that Robert Mueller is now also leading the Mueller Investigation.
''Tip:'' You can declare two classes as ''owl:disjointWith'' one another and set both classes as the ''rdf:type'' of some individual.


'''Task.'''  
'''Task.'''  
Line 66: Line 65:
* classes for representing investigators and investigation leaders
* classes for representing investigators and investigation leaders


Add an axiom to the investigation leader class to make sure that every investigator that is leading and investigation is an investigation leader. If you have asserted that Robert Mueller is an investigation leader, remove the assertion. Re-run the HermiT reasoner, and check that Robert Mueller is now an investigation leader,
Add an axiom to the investigation leader class to make sure that every investigator that is leading and investigation is an investigation leader. Re-run the HermiT reasoner, and check that John L Smith is now an investigation leader,


'''Task.'''  
'''Task.'''  

Revision as of 10:03, 11 April 2023

Topics

  • OWL ontology editing in Protégé.
  • Manchester-OWL syntax
  • HermiT reasoning.

Useful materials

Readings:

Protégé:

Vocabularies and terms (from S09 and same as previous week) - this is for reference: you will not need them all :-):

Classes and methods

RDF:

  • type

RDFS:

  • subClassOf, subPropertyOf, domain, range

Basic OWL:

  • sameAs, equivalentClass, equivalentProperty, differentFrom, disjointWith, inverseOf
  • ReflexiveProperty, IrreflexiveProperty, SymmetricProperty, AsymmetricProperty, TransitiveProperty, FunctionalProperty, InverseFunctionalProperty

Complex OWL:

  • oneOf, unionOf, intersectionOf. complementOf
  • Restriction, onProperty
  • someValuesFrom, allValuesFrom, hasValue
  • cardinality, minCardinality, maxCardinality
  • qualifiedCardinality, minQualifiedCardinality, maxQualifiedCardinality, onClass

Tasks

Continue extending the InvestigationOntology from the previous exercise.

Task. Use the Individuals by class tab and create the following instances of owl:Thing (for the purpose of the exercise, do not use more specific types!):

  • John L Smith (alias Jack Smith)
  • Investigation of role in the US Capitol Attack
  • Investigation of Trump's handling of grade documents

Create Object property assertions to state that:

  • John L Smith is investigating (but not leading) the Investigation of role in the US Capitol Attack
  • John L Smith is investigating (but not leading) the Investigation of Trump's handling of grade documents

Task. Start the reasoner again. Does it add more axioms/triples (marked in yellow) to the ontology?

Task With the reasoner still running, use File -> Export inferred axioms as ontology... to save the reasoning results to a new file. Chose a base URI and file name for the new ontology.

(Note that everything from the old ontology is not exported by default. If something is missing, you can try to export again or use Tools -> Merge to combine the old (handmade) and new (inferred by HermiT) ontologies.)

Task. Can you do a change that makes your ontology inconsistent? (Save often, so you always have a consistent version to revert to :-))

Tip: You can declare two classes as owl:disjointWith one another and set both classes as the rdf:type of some individual.

Task. Make sure that your ontology also contains

  • classes for representing investigators and investigation leaders

Add an axiom to the investigation leader class to make sure that every investigator that is leading and investigation is an investigation leader. Re-run the HermiT reasoner, and check that John L Smith is now an investigation leader,

Task. Use Manchester-OWL syntax to define the class:

  • InvestigationTeam, which is a foaf:Group with at least one members, so that all its members are Investigators.

If you have more time

TBD.