Lab: OWL 2: Difference between revisions

From info216
(Created page with "==Topics== * Basic OWL ontology editing in Protégé. * WebVOWL visualisation. ==Useful materials== Readings: * [https://protege.stanford.edu/ Protégé page] use either ''We...")
 
No edit summary
Line 5: Line 5:
==Useful materials==
==Useful materials==
Readings:
Readings:
* [https://protege.stanford.edu/ Protégé page] use either ''Webprotégé'' (simplest) or the ''download'' (more powerful) version
* [https://protegeproject.github.io/protege/ Protégé 5 Documentation]
* [https://www.w3.org/TR/owl-ref/ OWL Documentation]  
  * [https://protegeproject.github.io/protege/installation/ Installation]
  * [https://protegeproject.github.io/protege/getting-started/ Getting Started]
  * (An online version, [https://protege.stanford.edu/products.php#web-protege Webprotégé], is also available, but we recommend that you download the Desktop version and run it locally.)
* [https://www.w3.org/TR/owl-ref/ OWL Documentation] (from S08)


Vocabularies and terms:
Vocabularies and terms (from S09):
* FOAF
* [http://xmlns.com/foaf/spec/ Friend of a Friend (FOAF)] (if necessary follow the link to the 2004 version)
* Geo
* [http://motools.sourceforge.net/event/event.html Event Ontology (event)]
* Event
* [http://www.w3.org/TR/owl-time/ Time ontology in OWL (time, OWL-time)]
* OWL-Time
* [https://www.w3.org/2003/01/geo/ geo: World Geodetic Standard (WGS) 84]
* DC
* [http://dublincore.org/ Dublin Core (DC)]
* SIOC
* [http://www.w3.org/2004/02/skos/ SKOS - Simple Knowledge Organization System Home Page]
* SKOS
* [http://rdfs.org/sioc/spec/ Semantic Interlinked Online Communities (SIOC)]


==Tasks==
==Tasks==
In this exercise, you can continue with the ontology you create in [Lab: OWL 1 | the OWL 1 lab] or use the (very incomplete) one below.  
'''Task.''' Follow the [https://protegeproject.github.io/protege/installation/ Protégé 5 Installation instructions] to download and install Protégé Desktop.


''Tip:'' When you save OWL files as XML, the extension ''.owl-xml'' can be used.
'''Task.''' Go through the [https://protegeproject.github.io/protege/installation/ Protégé 5 Getting Started advice] to learn the basics of Protégé Desktop.  


===Preparations===
'''Task.''' Create a new Investigation Ontology that can be used to represent the Mueller Investigation, as well as other public investigations. Use the experience from earlier exercises. For example, the ontology can include these top-level classes:
'''Task: the Webprotégé (simplest) alternative'''
* Investigation
Inspect your ontology with [https://webprotege.stanford.edu/ Webprotégé].
* Person
* Register as a new user and log in.
Subclasses of Person can be
* ''Create a new project'' and use ''Create from existing sources'' to upload your OWL/XML file.  
* Investigator
* InvestigatedPerson
A subclass of Investigator can be InvestigationLeader.


'''Task: the download (more powerful alternative'''
'''Task.''' Connect your classes to at least one class from a well-known ontology, for example foaf:Person. There are three ways you can do this do this:
* [https://protege.stanford.edu/products.php Download Protégé] for free and run it on your local machine. The stand-alone version is even more powerful with lots of plug-ins.
# use foaf:Person instead of "your own" Person class;
* Go to ''File -> Open'' and load your OWL/XML file.
# make "your own" Person class an rdfs:subClassOf foaf:Person; or
# make "your own" Person class owl:equivalentClass to foaf:Person.
Alternative 2 is most common but all are ok.


'''Task.'''
'''Task.''' Create or import data properties for
Most likely, your ontology is still quite disconnected.  
* investigation title and description;
* Add ''rdfs:subClassOf'', ''rdfs:domain'', and ''rdfs:range'' triples to turn it into a more connected graph that represents the domain. <!-- Calculate owlrl closures to see the effects of your triples as you add them. -->
* person names; and
* Now and later, save your ontology often to a local XML file, and visualise it using [http://vowl.visualdataweb.org/webvowl.html WebVOWL]. The purpose of WebVOWL is to visualise classes and their properties, so the individuals may not show. (If the current version linked on the WebVOWL page has stopped, there is also a link to a more stable older backup version.)
* investigation start and end times.
 
'''Task.'''  
* Create or import object properties for stating that a person is ''involved in'' an investigation.
* Create subproperties of ''involved in'' for stating that a person can be ''indicted in'', ''investigating'', or ''leading'' an investigation.


'''Task.'''
'''Task.'''
Continue to extend your ontology by adding concepts from standard ontologies such as:
* FOAF, Event Ontology, SKOS, DC, OWL-Time, etc.
===Triples you can use to get started===
<syntaxhighlight>
@prefix ex: <http://example/org#> .
ex:Mueller_Investigation ex:involved ex:George_Papadopoulos,
        ex:Michael_Cohen,
        ex:Michael_Flynn,
        ex:Paul_Manafort,
        ex:Rick_Gates,
        ex:Roger_Stone ;
    ex:leadBy ex:Robert_Mueller .
ex:Michael_Cohen ex:attorneyFor ex:Donald_Trump ;
    ex:pleadedGuilty ex:Michael_Cohens_Lying .
ex:Michael_Cohens_Lying a ex:Lying ;
    ex:wasLyingAbout ex:Trump_RealEstateDeal ;
    ex:wasLyingTo ex:Congress .
ex:Michael_Flynn ex:adviserTo ex:Donald_Trump ;
    ex:negotiatedAgreement ex:PleaAgreement ;
    ex:pleadedGuilty ex:Michael_Flynns_Lying .
ex:Michael_Flynns_Lying a ex:Lying ;
    ex:wasLyingTo ex:FBI .
ex:Paul_Manafort ex:campaignManager ex:Donald_Trump ;
    ex:chargedWith ex:ForeignLobbying,
        ex:MoneyLaundering,
        ex:TaxEvasion ;
    ex:convictedFor ex:BankAndTaxFraud ;
    ex:hasBusinessPartner ex:Rick_Gates ;
    ex:negotiatedAgreement ex:PleaAgreement ;
    ex:pleadedGuilty ex:Conspiracy ;
    ex:sentencedTo ex:Prison .
ex:Rick_Gates_Lying a ex:Lying ;
    ex:wasLyingTo ex:FBI .


ex:Rick_Gates ex:chargedWith ex:ForeignLobbying,
        ex:MoneyLaundering,
        ex:TaxEvasion ;
    ex:pleadedGuilty ex:Conspiracy,
        ex:Rick_Gates_Lying .
</syntaxhighlight>


==If you have more time==
==If you have more time==
TBD
You can add a lot more classes (types) and relations (object properties) to your ontology. For example:
* InvestigationTeam, which has all the Investigators as members

Revision as of 15:45, 21 March 2023

Topics

  • Basic OWL ontology editing in Protégé.
  • WebVOWL visualisation.

Useful materials

Readings:

 * Installation
 * Getting Started
 * (An online version, Webprotégé, is also available, but we recommend that you download the Desktop version and run it locally.)

Vocabularies and terms (from S09):

Tasks

Task. Follow the Protégé 5 Installation instructions to download and install Protégé Desktop.

Task. Go through the Protégé 5 Getting Started advice to learn the basics of Protégé Desktop.

Task. Create a new Investigation Ontology that can be used to represent the Mueller Investigation, as well as other public investigations. Use the experience from earlier exercises. For example, the ontology can include these top-level classes:

  • Investigation
  • Person

Subclasses of Person can be

  • Investigator
  • InvestigatedPerson

A subclass of Investigator can be InvestigationLeader.

Task. Connect your classes to at least one class from a well-known ontology, for example foaf:Person. There are three ways you can do this do this:

  1. use foaf:Person instead of "your own" Person class;
  2. make "your own" Person class an rdfs:subClassOf foaf:Person; or
  3. make "your own" Person class owl:equivalentClass to foaf:Person.

Alternative 2 is most common but all are ok.

Task. Create or import data properties for

  • investigation title and description;
  • person names; and
  • investigation start and end times.

Task.

  • Create or import object properties for stating that a person is involved in an investigation.
  • Create subproperties of involved in for stating that a person can be indicted in, investigating, or leading an investigation.

Task.


If you have more time

You can add a lot more classes (types) and relations (object properties) to your ontology. For example:

  • InvestigationTeam, which has all the Investigators as members