OO jDREW Examples with RDF
Schema

****** type definition ****** <?xml version="1.0"?> <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://example.org/schemas/vehicles">
<rdf:Description rdf:ID="Vehicle"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> </rdf:Description>
<rdf:Description rdf:ID="PassengerVehicle"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Vehicle"/> </rdf:Description>
<rdf:Description rdf:ID="Van"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Vehicle"/> </rdf:Description>
<rdf:Description rdf:ID="Car"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#PassengerVehicle"/> </rdf:Description>
<rdf:Description rdf:ID="MiniVan"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Van"/> <rdfs:subClassOf rdf:resource="#PassengerVehicle"/> </rdf:Description>
<rdf:Description rdf:ID="Sedan"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Car"/> </rdf:Description>
<rdf:Description rdf:ID="ToyotaCorolla"> <rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/> <rdfs:subClassOf rdf:resource="#Sedan"/> </rdf:Description>
</rdf:RDF>
****** knowledge base ******
<Assert> <And>
<Implies closure="universal"> <And> <Atom> <Rel>premium</Rel> <Var>customer</Var> </Atom> <Atom> <Rel>regular</Rel> <Var>product</Var> </Atom> </And> <Atom> <Rel>discount</Rel> <Var>customer</Var> <Var>product</Var> <Ind>percent5</Ind> </Atom> </Implies>
<Atom closure="universal"> <Rel>base_price</Rel> <slot> <Ind>customer</Ind> <Plex> <slot><Ind>sex</Ind><Ind>male</Ind></slot> <resl><Var /></resl> </Plex> </slot> <slot><Ind>vehicle</Ind><Var type="Car" /></slot> <slot><Ind>price</Ind><Ind type="Integer">650</Ind></slot> </Atom>
<Atom closure="universal"> <Rel>base_price</Rel> <slot> <Ind>customer</Ind> <Plex> <slot><Ind>sex</Ind><Ind>male</Ind></slot> <resl><Var /></resl> </Plex> </slot> <slot><Ind>vehicle</Ind><Var type="Van" /></slot> <slot><Ind>price</Ind><Ind type="Integer">725</Ind></slot> </Atom>
</And> </Assert>
****** query ******
base_price(customer->[sex->male; name->"John Doe"; age->28]; vehicle->vehicle:ToyotaCorolla; price->?money:Integer).

|