0% found this document useful (0 votes)
64 views15 pages

Knowledge Graph Protege

Knowledge Graph Protege tutorial , owl/xml , turtle

Uploaded by

soheib yahoui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views15 pages

Knowledge Graph Protege

Knowledge Graph Protege tutorial , owl/xml , turtle

Uploaded by

soheib yahoui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

YAHOUI Soheib

Knowledge graph
using protege
Agenda
Example: The “AfricanWildlife” ontology 3
Creation of classes , subclasses and properties 4
Restrictions on properties and classes 5
Creating class instances 10
Run a Sparql queries , Reasoning , and
visualization of the graph 13
3
3 “AfricanWildlife” ontology class hierarchy
3
3 Creation of classes , subclasses and properties

<owl:Class rdf:ID="Animal"/>

<owl:Class rdf:ID="Herbivore">
<rdfs:subClassOf rdf:resource="#Animal"/>
</owl:Class>

<owl:Class rdf:ID="Carnivore">
<rdfs:subClassOf rdf:resource="#Animal"/>
</owl:Class>

<owl:Class rdf:ID="Lion">
<rdfs:subClassOf rdf:resource="#Carnivore"/>
</owl:Class>
3
3 Creation of classes , subclasses and properties

<owl:Class rdf:ID="Lion">
<rdfs:subClassOf rdf:resource="#Carnivore"/>
</owl:Class>

<owl:Class rdf:ID="Giraffe">
<rdfs:subClassOf rdf:resource="#Herbivore"/>
</owl:Class>

<owl:Class rdf:ID="Plant"/>

<owl:Class rdf:ID="Tree">
<rdfs:subClassOf rdf:resource="#Plant"/>
</owl:Class>

<owl:Class rdf:ID="Branch"/>

<owl:Class rdf:ID="Leaf"/>
3
3 Creation of classes , subclasses and properties

Entities > classes >


add subclasses >
write the hierarchy .
3
7 Creation of classes , subclasses and properties

<owl:Class rdf:ID="Plant">
<rdfs:comment>Plants
are disjoints from animals
</rdfs:comment>
<owl:disjointWith
rdf:resource="#animals"/>
</owl:Class>
3
3 intersectionOf
<owl:Class rdf:ID="Omnivore">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf
rdf:parseType="Collection">
<owl:Class rdf:about="#Herbivore"/>
<owl:Class rdf:about="#Carnivore"/>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
3
3 Creation of classes , subclasses and properties

<owl:ObjectProperty rdf:ID="eats">
<rdfs:domain rdf:resource="#Animal"/>
</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="eaten-by">
<owl:inverseOf rdf:resource="#eats"/>
<rdf:type rdf:resource=
"&owl;#ReflexiveProperty"/>
</owl:ObjectProperty>
3 properties
3
5 Tools

Window > Tabs > SPARQL query


+ OntoGraph.
3
5 Visualization of the graph

Window > Tabs >


OntoGraph
3
13 Runing a Sparql Query
PREFIX rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-
ns#>
PREFIX owl:
<http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-
schema#>
PREFIX xsd:
<http://www.w3.org/2001/XMLSchema#>
PREFIX local:
<http://www.semanticweb.org/lenovo/ontologie
s/2025/0/untitled-ontology-3#>

SELECT ?subject
WHERE { ?subject rdf:type local:lion. }
3
14 Reasoner
Reasoner > Hermit 1,4 >
start reasoner

We add a new triplet “a_lion eats a_giraffe “


we inferred
“a_Giraffe
Is eaten by
a_Lion “
Thank
you
YAHOUI Soheib
[email protected]
https://github.com/yahoui2001/
knowledge-graph/tree/main

You might also like