Take RDFS entailment rule rdfs2 for example (see http://www.w3.org/TR/rdf-mt/#RDFSRules for details). One can use the following code snippet to materialize the hidden relationships.
String szConstruct =
" PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"
+ " PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "
+ " CONSTRUCT { ?x rdf:type ?c } "
+ " WHERE { ?x ?p ?y . ?p rdfs:domain ?c } " ;
After adding the above code snippet into the ExampleOntModel source code (after the triples insertion), the following can be found from the output.
Rule execution results <ModelCom {http://sub/a @rdf:type http://C} | >