untitled

(ff) #1

386 17 Answers to Selected Exercises



  1. molecule_typeThis has six possible values so it is necessary to intro-
    duce an enumerated class for the values of this property.


The OWL ontology looks like the following:

<owl:Class rdf:ID="bio_sequence"/>
<owl:ObjectProperty rdf:ID="sequence_id">
<rdfs:domain rdf:about="#bio_sequence"/>
</owl:ObjectProperty>
<owl:DatatypeProperty rdf:ID="organism_name">
<rdfs:domain rdf:about="#bio_sequence"/>
<rdfs:range rdf:about=
"http://www.w3.org/2000/10/XMLSchema#string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="organism_name">
<rdfs:domain rdf:about="#bio_sequence"/>
<rdfs:range rdf:about=
"http://www.w3.org/2000/10/XMLSchema#string"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:ID="seq_length">
<rdfs:domain rdf:about="#bio_sequence"/>
<rdfs:range rdf:about=
"http://www.w3.org/2000/10/XMLSchema#nonNegativeInteger"/>
</owl:DatatypeProperty>
<owl:ObjectProperty rdf:ID="molecule_type">
<rdfs:domain rdf:about="#bio_sequence"/>
<rdfs:range rdf:about="#MoleculeTypes"/>
</owl:ObjectProperty>
<owl:Class rdf:ID="MoleculeTypes">
<owl:oneOf parseType="Collection">
<owl:MoleculeTypes rdf:ID="DNA"/>
<owl:MoleculeTypes rdf:ID="mDNA"/>
<owl:MoleculeTypes rdf:ID="rDNA"/>
<owl:MoleculeTypes rdf:ID="tDNA"/>
<owl:MoleculeTypes rdf:ID="cDNA"/>
<owl:MoleculeTypes rdf:ID="AA"/>
</owl:oneOf>
</owl:Class>
ANSWER TO
EXERCISE8.1
To solve this exercise extract all interview elements that have attributes with
the desired characteristics. Dates always start with the year so the following
query gives the desired results:

document("healthstudy.xml")
//Interview[starts-with(@Date,"2000") and @BMI>30]
Free download pdf