// RDF Schema Example // namespace declarations // rdf := "http://www.w3.org/1999/02/22-rdf-syntax-ns#". // rdfs := "http://www.w3.org/TR/1999/PR-rdf-schema-19990303#". // definition of RDF Schema semantics FORALL Mdl @rdfschema(Mdl) { FORALL O,P,V O[P->V] <- O[P->V]@Mdl. FORALL O,P,V O[P->V] <- EXISTS S (S[rdfs:subPropertyOf->P] AND O[S->V]). FORALL O,P,V O[rdfs:subClassOf->V] <- EXISTS W (O[rdfs:subClassOf->W] AND W[rdfs:subClassOf->V]). FORALL O,P,V O[rdfs:subPropertyOf->V] <- EXISTS W (O[rdfs:subPropertyOf->W] AND W[rdfs:subPropertyOf->V]). FORALL O,T O[rdf:type->T] <- EXISTS S (S[rdfs:subClassOf->T] AND O[rdf:type->S]). } // RDFS cars example @cars { // xyz := "http://www.w3.org/2000/03/example/vehicles#". xyz:MotorVehicle[rdfs:subClassOf -> rdfs:Resource]. xyz:PassengerVehicle[rdfs:subClassOf -> xyz:MotorVehicle]. xyz:Truck[rdfs:subClassOf -> xyz:MotorVehicle]. xyz:Van[rdfs:subClassOf -> xyz:MotorVehicle]. xyz:MiniVan[ rdfs:subClassOf -> xyz:Van; rdfs:subClassOf -> xyz:PassengerVehicle]. } // query FORALL X,Y <- X[rdfs:subClassOf->Y]@rdfschema(cars).