Mai Văn Trí b19dccn688

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 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