0% found this document useful (0 votes)
231 views6 pages

RDF/RDFS Exercises and Solutions

1. The document presents exercises on representing knowledge in RDF and RDFS. 2. It includes exercises on translating graphs to RDF/XML, representing RDF documents graphically, modeling statements as RDF graphs, and inferring new knowledge from an RDFS ontology. 3. The solution provides RDF/XML representations, graphical depictions of RDF graphs, modeled statements, and inferred information.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
231 views6 pages

RDF/RDFS Exercises and Solutions

1. The document presents exercises on representing knowledge in RDF and RDFS. 2. It includes exercises on translating graphs to RDF/XML, representing RDF documents graphically, modeling statements as RDF graphs, and inferring new knowledge from an RDFS ontology. 3. The solution provides RDF/XML representations, graphical depictions of RDF graphs, modeled statements, and inferred information.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

M1SIC Web Sémantique 2019-2020

TD N1 : RDF/RDFS

Exercice 1 :
Traduire le graphe suivant en format RDF/XML

ex : entreprise
rdf :Statement Rdf :object
Ex : travailleA
Rdf :type

Rdf :subject
Ex : Mohamed

Rdf :predicate

Ex : travailleA

Exercice 2:
Donnez une représentation graphique du document RDF suivant :
<?XML version="1.0"?>
<rdf:RDF XMLns:rdf="[Link]
XMLns:dc= [Link]
XMLns:ex= "[Link]
<rdf:Description rdf:about=" [Link]
<dc:creator rdf:nodeID=”80145”/>
</rdf:Description>
<rdf:Description rdf:about=" [Link]
<ex:LastUpdate> 11-02-2010 </ex:LastUpdate>
</rdf:Description>
<rdf:Description rdf:nodeID=”80145”>
<ex:name> Mohammed </ex:name>
<ex:e-mail> Moh@[Link] </ex:e-mail>
<ex:webSite rdf:resource=”[Link]
</rdf:Description>
<rdf:Description rdf:about="[Link]
<ex:students>
<rdf:Bag>
<rdf:li rdf:resource="[Link]
<rdf:li rdf:nodeID=”80145”/>
<rdf:li rdf:resource="[Link]
<rdf:li rdf:resource="[Link]
</rdf:Bag>
</ex:students>
</rdf:Description>
</rdf:RDF>

Exercice 3 :
Représentez la phrase suivante en graphe RDF :
« Mohammed croit que Ibrahim veut le voir »
Exercice 4
On souhaite modéliser les connaissances suivantes en RDF :
 Mohamed possède une voiture d’un modèle « Clio » , d’année « 2012 »
 Mohamed connaît Omar.
 Omar a 23 ans.
 Mohamed et Omar sont des étudiants.
 Les étudiants sont des adultes.
Questions :
1. Donnez la représentation sous forme de triplet(s) de chacune de ces phrases.
2. Donnez la représentation graphique de ce graphe RDF.
Vous utiliserez un espace de nommage qui contiendra tous vos concepts et toutes vos
relations.

Exercice 5
Soit le paragraphe suivant:
La FIFA ([Link] est une fédération internationale qui s’occupe du
football (un sport), elle organise chaque année un événement pour choisir le meilleur
joueur du monde.
L’événement de l’année 2019 implique trois concurrents (joueurs) :
• Le joueur 1 à pour nom «Lionel Messi» et joue pour l’équipe «Fc Barcelone».
• Le joueur 2 à pour nom «Cristiano Ronaldo », et joue pour l’équipe
«Juventus».
• Le joueur 3 à pour nom «Virgil van Dijk » et joue pour l’équipe «Liverpool
FC » .
Le résultat de cet événement est selon l’ordre suivant: «Lionel Messi», «Virgil van
Dijk », « Cristiano Ronaldo ».

1- Quelles sont les classes, les propriétés et les instances?


2- Donnez la signature de chaque propriété.
3- Donnez le graphe RDF correspondant (utilisez l’espace de nom fifa :
[Link] #).

Exercice 6
donnez les inférences possibles
1.
c:creator rdfs:domain c:Person
i:Man241 c:creator i:Image262
2.
c:author rdfs:subPropertyOf c:creator
c:author rdfs:range c:Document
i:Woman297 c:author i:Book812
3.
c:aSoutenu rdfs:domain c:Docteur
c:aSoutenu rdfs:range c:These
i:Woman297 c:aSoutenu i:t127
4.
c:nbDeRoues rdfs:domain c:Vehicule
i:Man241 c:nbDeRoues "4"^^xsd:integer
M1SIC Web Sémantique 2019-2020
Solution TD N1 : RDF/RDFS

Solution exercice 01 :

<?XML version="1.0"?>
<rdf:RDF XMLns:rdf="[Link]
XMLns:ex= "[Link]

<rdf:Description rdf:about="[Link]
<ex :travailleA rdf:resource=”[Link] #Entreprise”/>
</rdf:Description>
<rdf:Statement>
<rdf:Subject rdf:about="[Link]
<rdf:Predicate rdf:resource=”[Link] #T ravailleA”>
<rdf:Object rdf:resource=”[Link] #Entreprise”>
</rdf:Statement>

Solution Exercice 02:

[Link]
[Link]

dc :creator Ex : webSite Ex : lastUpdate

Ex : e-mail 11-02-2010
ex :name
Mohamed@[Link]
Mohamed

Rdf : _2
[Link]

ex :students
rdf : Bag
Rdf : _1
Ahmed Rdf :type

Rdf : _3 Fatima
Solution Exercice 03 :
Solution exercice 05 :
1. Les classes :

Fédération, sport, événement, joueur, équipe.


2. Les propriétés

Occupe (fédération , sport), joue( joueur, equipe), organise(fédération, événement),


but_evenement (evénement, xsd :String), nom(joueur, xsd :String),
a_concurent(événement, liste de joueurs) , résultat(evénement, liste ordonnée de
joueurs), date_evénement(Evénement, xsd :date).
3. Les instances
 FIFA ([Link] ) instance de « fédération ».
 Messi ([Link] instance de « joueur ».
 Van Dijk ([Link] [Link] ) instance de « joueur ».
 Ronaldo ([Link] [Link]) instance de « joueur ».
 Evénement 2019 ([Link] instance
d’ « Evénement ».
 Fc Barcelon ([Link] ) instance d’ « équipe ».
 Juventus ([Link] ) instance d’ « équipe ».
 Liverpool ([Link] ) instance d’ « équipe ».
 Football ([Link] Instance de «Sport »
[Link]
Fifa:Sport fifa:soccupe rdf:type
fifa:organise
rdf:type
Fifa:football Fifa:féderation
rdf:type
fifa:event2019 fifa:date
Fifa:Evenement
fifa:resultat fifa:bute 2019^^xsd:date

Rdf :type
fifa:concurent Choisir le meilleur joueur du
rdf : seq
monde
Rdf : _2
Rdf :type

Rdf : _1
Rdf : _3 rdf : Bag
Rdf : li
Rdf : li

Rdf : li
fifa :Van Dijk fifa :Ronaldo
fifa:Messi
fifa :joue-pour fifa :joue-pour

Rdf :type fifa :joue-pour


Fifa:Barça
Rdf :type
Rdf :type
Fifa:Juventus
Rdf :type Fifa:Liverpool
Fifa:joueur

Rdf :type

Fifa:equipe

Solution exercise 06 :
1.
c:creator rdfs:domain c:Person
i:Man241 c:creator i:Image262
sol : i:Man241 rdf:type c:Person
2.
c:author rdfs:subPropertyOf c:creator
c:author rdfs:range c:Document
i:Woman297 c:author i:Book812
sol : i:Book812 rdf:type c:Document
      i:Woman297 c:creator i:Book812
      i:Woman297 rdf:type c:Person
3.
c:aSoutenu rdfs:domain c:Docteur
c:aSoutenu rdfs:range c:These
i:Woman297 c:aSoutenu i:t127
sol : i:Woman297 rdf:type c:Docteur
      i:t127 rdf:type c:These
4.
c:nbDeRoues rdfs:domain c:Vehicule
i:Man241 c:nbDeRoues "4"^^xsd:integer
sol : i:Man241 rdf:type c:Vehicule

Common questions

Powered by AI

In RDF modeling, representing an individual's multiple affiliations or roles requires using different `rdf:Description` elements linked by shared identifiers (e.g., nodeID). For example, an individual can be a `rdf:type` of both `c:Student` and `c:VehicleOwner`, each with respective properties like `rdf:registeredIn` for educational entities and `rdf:ownsModel` for vehicle information. This multi-faceted representation leverages RDF’s flexibility.

`rdf:Bag` is used in RDF to represent an unordered collection of elements, which is significant when the order of elements is not important. In exercises, `rdf:Bag` provides a mechanism to list members without implying hierarchy or sequence, such as listing students in a course. It allows for flexibility and extensibility in data modeling, as additional items can be added without affecting the existing structure.

The key components required to translate a graph into RDF/XML format include defining namespaces using `XMLns`, specifying `rdf:Description` elements for each node in the graph, using `rdf:about` or `rdf:nodeID` attributes for subject identification, and delineating `rdf:Predicate` and `rdf:Object` relationships. These components enable encoding triples in RDF/XML.

RDF properties are pivotal in encoding information about individual attributes as they delineate relationships and characteristics within a dataset. For instance, `ex:name` associates a literal with a subject to describe identity, like linking "Mohammed" to a node. Other properties, like `ex:e-mail` and `ex:webSite`, convey contact details and online presence, enhancing semantic clarity and data connectivity.

In RDF, the outcomes of events, such as choosing the best player by FIFA, can be represented by using properties like `fifa:result` attached to the event instances. The `fifa:result` might include an ordered RDF collection (using `rdf:Seq`) to represent the ranked positions of players, with each player being a resource identified by IRIs. Relationships like `fifa:organise` link FIFA's role to the event outcome.

In RDF, hierarchical data concepts are articulated using `rdfs:domain` and `rdfs:range` to specify classes applicable to property subjects and objects. For example, `c:creator` with a domain of `c:Person` restricts it to individuals, while its range `c:Document` confines its objects to documents. This mechanism facilitates precise semantic relationships and infers class memberships, supporting structured, queryable data sets.

In an RDF graph, relationships between individuals and events can be represented using `rdf:Description` elements where the subject is identified using `rdf:about` or `rdf:nodeID`. The relationships are depicted using properties such as `fifa:organise` for events and `fifa:participate` for individual involvement. Instances of events and individuals are connected using these properties to reflect roles and relationships effectively.

Namespaces in RDF/XML are crucial for disambiguating terms and providing semantic context by linking terms to universal URIs. They enable clear identification of properties and classes from different schemas, preventing naming conflicts. By defining namespaces using `XMLns`, one can manage interdisciplinary data models, ensuring robust data integration and interoperability.

The RDF model implies class hierarchies such as `c:Person` encompassing both `c:creator` and `c:author`, indicating that an individual serving in these roles participates in intellectual or documentary creation processes. Similarly, `c:Docteur` is a subclass involved in the dissertation or `c:These`, reflecting academic achievement. These hierarchies enable structured representation of roles within an academic context.

RDF can represent hierarchical affinities among professions by utilizing classes and properties to mirror organizational structures. For instance, professions can inherit attributes from a superclass `c:Professional`, with specific subclasses like `c:Docteur` and `c:Author` inheriting relevant properties. Hierarchical attributes such as `c:employedAt` can further define relationships with organizations, enabling complex, nuanced ontology modeling.

M1SIC Web Sémantique
Exercice 4
On souhaite modéliser les connaissances suivantes en RDF :

Mohamed possède  une voiture d’un modèle « Clio » ,
M1SIC Web Sémantique
Solution  exercice 05
 
   :
1.Les classes : 
Fédération, sport, événement, joueur, équipe. 
2.Les propriétés 
Occupe (fédéra
Fifa:joueur
http://www.fifa.org
Fifa:féderation
fifa:event2019
Fifa:Evenement
Fifa:football
Fifa:Sport
fifa :Ronaldo
rdf : Ba
      i:t127 rdf:type c:These
4.
c:nbDeRoues rdfs:domain c:Vehicule
i:Man241 c:nbDeRoues "4"^^xsd:integer
sol : i:Man241 rdf:

You might also like