0% found this document useful (0 votes)
36 views

Mai Văn Trí b19dccn688

The document describes an RDF schema with classes like Person, Student, Teacher and Course. It defines properties like has_name, has_students, and has_teacher. Examples of instances are provided, including a Student named Mai Van Tri and a Course in "Dich Vu" with that student and a teacher named Nguyen Trong Khach. The document also provides examples using OWL vocabulary to define classes like Student and Teacher with properties like name and teachings relationships.

Uploaded by

Trí Mai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Mai Văn Trí b19dccn688

The document describes an RDF schema with classes like Person, Student, Teacher and Course. It defines properties like has_name, has_students, and has_teacher. Examples of instances are provided, including a Student named Mai Van Tri and a Course in "Dich Vu" with that student and a teacher named Nguyen Trong Khach. The document also provides examples using OWL vocabulary to define classes like Student and Teacher with properties like name and teachings relationships.

Uploaded by

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

Bài 1:

+Lược đồ RDF:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.ptit.edu.vn/profile">

<rdfs:Class rdf:ID="#Person" />


<rdfs:Class rdf:ID="#Student">
<rdfs:subClassOf rdfs:Resource="#Person"/>
</rdfs:Class>
<rdfs:Class rdf:ID="#Teacher">
<rdfs:subClassOf rdfs:Resource="#Person"/>
</rdfs:Class>
<rdfs:Class rdf:ID="#Course"/>

<rdf:Property rdf:ID="has_name">
<rdfs:domain rdfs:Resource="#Person" />
<rdfs:domain rdfs:Resource="#Course" />
<rdfs:range rdfs:Resource="#Literal" />
</rdf:Property>

<rdf:Property rdf:ID="has_students">
<rdfs:domain rdfs:Resource="#Course" />
<rdfs:range rdfs:Resource="#Student" />
</rdf:Property>

<rdf:Property rdf:ID="has_teacher">
<rdfs:domain rdfs:Resource="#Course" />
<rdfs:range rdfs:Resource="#Teacher" />
</rdf:Property>
</rdf:RDF>

+Ví dụ:
<?xml version="1.0" encoding="UTF-8"?>
<Person rdf:ID="nguoi"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.ptit.edu.vn/profile#"
xml:base="http://www.ptit.edu.vn/person#">
<has_name>Con Nguoi</has_name>
</Person>
<Student rdf:ID="trimai"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.ptit.edu.vn/profile#"
xml:base="http://www.ptit.edu.vn/student#">
<has_name>Mai Van Tri</has_name>
</Student>
<Teacher rdf:ID="khanh"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.ptit.edu.vn/profile#"
xml:base="http://www.ptit.edu.vn/teacher#">
<has_name>Nguyen Trong Khach</has_name>
</Teacher>
<Course rdf:ID="dichvu"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.ptit.edu.vn/profile#"
xml:base="http://www.ptit.edu.vn/course#">
<has_name>Dich Vu</has_name>
<has_students rdf:resource="http://www.ptit.edu.vn/student#Loud"/>
<has_teacher rdf:resource="http://www.ptit.edu.vn/teacher#Mariah"/>
</Course>

Bài 2:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:owl ="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.ptit.edu.vn/profile"
xmlns:xsd ="http://www.w3.org/2001/XMLSchema#">

<owl:Class rdf:ID="Sinhvien">
<rdfs:label>Sinhvien</rdfs:label>
</owl:Class>

<owl:Class rdf:ID="Giaovien">
<rdfs:label>Giaovien</rdfs:label>
</owl:Class>
<owl:DatatypeProperty rdf:ID="ten">
<rdfs:domain rdfs:Resource="#Sinhvien" />
<rdfs:domain rdfs:Resource="#Giaovien" />
<rdfs:range rdfs:Resource="&xsd;string" />
</owl:DatatypeProperty>

<owl:ObjectProperty rdf:ID="day">
<rdfs:domain rdfs:Resource="#Giaovien" />
<rdfs:range rdfs:Resource="#Sinhvien" />
</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="duoc_day_boi">
<rdfs:domain rdfs:Resource="#Sinhvien" />
<rdfs:domain rdfs:Resource="#Giaovien" />
</owl:ObjectProperty>
</rdf:RDF>

<?xml version="1.0" encoding="UTF-8"?>


<Sinhvien rdf:ID="A"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.ptit.edu.vn/profile#"
xml:base="http://www.ptit.edu.vn/sinhVien#">
<ten>Nguyen Van A</ten>
<duoc-day-boi rdf:resource="http://www.ptit.edu.vn/giaoVien#B"/>
</Sinhvien>
<Giaovien rdf:ID="B"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.ptit.edu.vn/profile#"
xml:base="http://www.ptit.edu.vn/giaoVien#">
<ten>Nguyen Van B</ten>
<day rdf:resource="http://www.ptit.edu.vn/sinhVien#A"/>
</Giaovien>

Bài 3:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.ptit.edu.vn/profile"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

<owl:Class rdf:ID="Customer">
<rdfs:label>Customer</rdfs:label>
</owl:Class>

<owl:Class rdf:ID="Shop">
<rdfs:label>Shop</rdfs:label>
</owl:Class>

<owl:Class rdf:ID="BigShop">
<rdfs:label>BigShop</rdfs:label>
<owl:equivalentClass rdf:resource="#Shop"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#sells" />
<owl:minCardinality rdf:datatype="xsd;nonNegativeInteger">100</owl:minCardinality>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>

<owl:Class rdf:ID="Product">
<rdfs:label>Product</rdfs:label>
<owl:disjointWith rdf:resource="#Customer"/>
</owl:Class>

<owl:Class rdf:ID="PurchaseAndSale">
<rdfs:label>PurchaseAndSale</rdfs:label>
<owl:equivalentClass rdf:resource="#Shop"/>
<owl:equivalentClass rdf:resource="#Customer"/>
</owl:Class>

<owl:DatatypeProperty rdf:ID="name">
<rdfs:domain rdfs:Resource="#Customer" />
<rdfs:domain rdfs:Resource="#Shop" />
<rdfs:range rdfs:Resource="xsd:string" />
<owl:equivalentProperty rdf:resource="foaf:name" />
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="email">
<rdfs:domain rdfs:Resource="#Customer" />
<rdfs:domain rdfs:Resource="#Shop" />
<rdfs:range rdfs:Resource="xsd:string" />
<owl:equivalentProperty rdf:resource="foaf:mbox" />
</owl:DatatypeProperty>

<owl:DatatypeProperty rdf:ID="orderNumber">
<rdfs:domain rdfs:Resource="#Product" />
<rdfs:range rdfs:Resource="xsd:int" />
</owl:DatatypeProperty>

<owl:ObjectProperty rdf:ID="sells">
<rdfs:domain rdfs:Resource="#Shop" />
<rdfs:range rdfs:Resource="#Product" />
</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="soldBy">
<rdfs:domain rdfs:Resource="#Product" />
<rdfs:range rdfs:Resource="#Shop" />
</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="duoc_day_boi">
<rdfs:domain rdfs:Resource="#Sinhvien" />
<rdfs:domain rdfs:Resource="#Giaovien" />
</owl:ObjectProperty>
</rdf:RDF>

You might also like