thank you, I can solve the problem.
an other problem:
I have the following classes: woman, man
Date of marriage is dataProperty woman
john is an instance of human
pretty is an instance of  woman
emna is an instance of woman
john marie pretty in 1998
john marie emna in 1990
  how I can add this information?
my code:
OntModel m=
ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM_RULE_INF);
    String ns ="http://www.w3.org/2002/07/owl#";;
    String base="http://www.w3.org/2002/07/owl";;
    //create class
    OntClass f = m.createClass(ns+ "femme" );
    OntClass h = m.createClass(ns+ "homme" );

    // create individual
    Individual h1 = m.createIndividual( ns+"john", h );//ns
    Individual f1 = m.createIndividual( ns + "pretty", f );
    Individual f2 = m.createIndividual( ns + "emna", f );
    //create ObjectProperty
    ObjectProperty ma = m.createObjectProperty(ns + "marier" );
    ma.addDomain(h);ma.addRange(f);
    //create DataProperty
    DatatypeProperty datemariage =
m.createDatatypeProperty(ns+"marriagedate");
    datemariage.addDomain(h);
    //add they information: john marie pretty in 1998 and
         //john marie emna in 1990
    h1.addProperty(ma,f1);
    h1.addProperty(datemariage,"1990");

    FileOutputStream writer =new
FileOutputStream("G:\\thése\\Rech12\\ENCD\\pizza\\context.owl");
        m.write(writer, "RDF/XML");
please help me

Reply via email to