Lab: OWL-DL

From info216
Revision as of 11:12, 12 April 2023 by Sinoa (talk | contribs) (→‎If you have more time)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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. Stop the reasoner if it is running, and add individuals to represent that:

  • Robert Mueller lead the Mueller Investigation.
  • Paul Manafort was indicted.
  • Elizabeth Prelogar was an investigator.

Task. Start the reasoner again. Have any axioms/triples been added to the ontology?

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. Revert the ontology back to a consistent state. 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 Trump's role in the US Capitol Attack
  • Investigation of Trump's handling of graded 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 (or synchronise it if it is already running). 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.
  • Compare the original (handmade) and new (inferred) ontologies. What has been added? Is something missing?

(Note that everything from the old ontology is not exported by default. You will have to check off boxes to select what to export. 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.

  • Create a new subproperty of leading to represent investigations that are lead by a special prosecutor. Leave the domain and range open.
  • Create a new subclass of investigation to represent special counsel investigations.
  • Add an axiom to the investigation class to make sure that every investigation that is lead though special prosecutor is a special counsel investigation. Tip: In the Entities -> Classes -> SpecialCounselInvestigation panel, click Equivalent To (+) and use the Class expression editor to enter the appropriate Manchester-OWL expression.
  • Change the object property assertions for John L Smith, so he is a special prosecutor and not just investigating
  • Restart or synchronise the HermiT reasoner, and check that the two investigations lead by John L Smith are now special counsel investigations.

If you have more time

Task: Assume you want to make your ontology public in the LOD cloud.

  • What would be an appropriate rdfs:domain for the dc:title property in your ontology?
  • What would be the consequence of publishing and ontology with the assertion/triple: (dc:title, rdfs:domain, :Investigation )?
  • What would be an appropriate rdfs:domain for the foaf:name property in your ontology? (Tip: you might want to check what the FOAF vocabulary defines: xmlns.com/foaf/0.1/ .)