RE: [DIG-users] Dig 1.1 problem (TELLS)
Brought to you by:
dturi
From: LECUE F. RD-TECH-R. <fre...@fr...> - 2006-05-15 16:02:09
|
Hi all, according to the Api of DIG 1.1, there is not the asks form of = "Disjoint". How can I simulate the disjoint asks like: <disjoint id=3D"q3a"> <catom name=3D"Ticket"/> <catom name=3D"Flight"/> </disjoint>=20 With the previous consideration. Thank you Waiting to hear from you. Freddy -----Message d'origine----- De : Daniele Turi [mailto:dt...@cs...]=20 Envoy=E9 : lundi 15 mai 2006 11:42 =C0 : LECUE FREDDY RD-TECH-REN Cc : dig...@li... Objet : Re: [DIG-users] Dig 1.1 problem (TELLS) LECUE FREDDY RD-TECH-REN wrote: > Dear all, > > I have a problem to implement a Knowledge base for a reasoner.=20 > Actually I would like to load a Knowledge base with an empty=20 > "tells.xml" document. > > So how load the following concept: > > <impliesc> > <catom name=3D"Ticket"/> > <and> > <all> > <ratom name=3D"from"/> > <catom name=3D"Location"/> > </all> > <all> > <ratom name=3D"when"/> > <catom name=3D"Date"/> > </all> > <all> > <ratom name=3D"with"/> > <catom name=3D"TransportationMean"/> > </all> > <all> > <ratom name=3D"cost"/> > <catom name=3D"Price"/> > </all> > </and> > </impliesc> > > According to the TellsDocument class. I tried : > > /****/ > Concepts a =3D Concepts.Factory.newInstance(); > Named a1 =3D c.addNewCatom(); > a1.setName("Ticket"); > > Concepts b =3D Concepts.Factory.newInstance(); > Named b1 =3D c.addNewCatom(); > b1.setName("Ticket"); > b.addNewAll().addNewRatom().setName("from"); > b.addNewAll().addNewCatom().setName("Location"); > =20 > Concepts d =3D Concepts.Factory.newInstance(); > Named d2 =3D d.addNewCatom(); > d2.setName("B"); > d.addNewSome().addNewRatom().setName("R"); > d.addNewSome().addNewCatom().setName("F"); > =20 > Concepts[] cx =3D {e,c,d}; > =20 > tells.getTells().addNewImpliesc().setAndArray(cx); > /*****/ > > But it doesn't work. > Do you have an idea how to implement the example I propose with=20 > "tells.getTells()" > > Thank you > Waiting to hear from you. > Freddy > You need to use addNewTells() instead of getTells(): TellsDocument tells =3D TellsDocument.Factory.newInstance(); Concepts a =3D Concepts.Factory.newInstance(); Named a1 =3D a.addNewCatom(); a1.setName("Ticket"); Concepts b =3D Concepts.Factory.newInstance(); Named b1 =3D b.addNewCatom(); b1.setName("Ticket"); b.addNewAll().addNewRatom().setName("from"); b.addNewAll().addNewCatom().setName("Location"); Concepts d =3D Concepts.Factory.newInstance(); Named d2 =3D d.addNewCatom(); d2.setName("B"); d.addNewSome().addNewRatom().setName("R"); d.addNewSome().addNewCatom().setName("F"); Concepts[] cx =3D { a, b, d }; tells.addNewTells().addNewImpliesc().setAndArray(cx); System.out.println(tells); -- Dr Daniele Turi School of Computer Science The University of Manchester ESNW 1.17 Kilburn Building, Oxford Road Manchester, M13 9PL, UK. Tel +44 (0) 161 275 0675 Fax 6204 http://www.cs.man.ac.uk/~dturi |