Thread: R: [DIG-users] TellsDocument
Brought to you by:
dturi
From: Luigi I. <ia...@di...> - 2004-11-18 14:46:45
|
Wow! Then I suppose that it is the same for impliesc ConceptPair, isn't it? So how can I distinguish the subsumed from the subsumer? Thanks again, Luigi -----Messaggio originale----- Da: Daniele Turi [mailto:dt...@cs...]=20 Inviato: gioved=EC 18 novembre 2004 15.23 A: Luigi Iannone Cc: dig...@li... Oggetto: Re: [DIG-users] TellsDocument Luigi Iannone wrote: >Hi all, > >in my code I try to analyze a TellsDocument object I obtained after = parsing >a Jena DIGAdapter.translateKbToDig() result. > >As a first issue I obtained an exception on the namespace that I easily >worked around. The exception is=20 > >org.apache.xmlbeans.XmlException: error: The document is not a >tells@http://dl.kr.org/dig/2003/02/lang: document element namespace mismatch >expected "http://dl.kr.org/dig/2003/02/lang" got "http://dl.kr.org/dig/lang" >=09 > The first is the namespace for DIG 1.0, the second for DIG 1.1. > >As a second issue when analyzing the TellsDocument I split it in single >tells among which, for instance, I identify the equalc with >.getEqualcArray() method. This method returns an array of ConceptPair >objects. >Throughout the Javadoc I couldn't find a method for taking the first concept >in the pair or the second one. > >Can you help me? > > =20 > I'm afraid there is no such method: you will have to go through all possibilities :-( Daniele --=20 Dr Daniele Turi Information Management Group, School of Computer Science The University of Manchester 2.100 Kilburn Building, Oxford Road, Manchester, M13 9PL, UK. Tel +44 (0) 161 275 6145 Fax 6211 http://www.cs.man.ac.uk/~dturi |
From: Daniele T. <dt...@cs...> - 2004-11-18 14:58:24
|
Luigi Iannone wrote: >Wow! >Then I suppose that it is the same for impliesc ConceptPair, isn't it? > > Yes. >So how can I distinguish the subsumed from the subsumer? > > I agree it is very bad. I will have a look again at the XMLBeans documentation and see if I can modify the schema to prevent this. But I tried at the time to no avail. For instance, in org.kr.dl.dig.reasoner.v1_1.impl.TReasoner#subsumes(Concept, Concept, URI) I hard coded the "ask" exactly for that reason. If you have any idea how to fix the schema please let me know. Daniele > >-----Messaggio originale----- >Da: Daniele Turi [mailto:dt...@cs...] >Inviato: giovedì 18 novembre 2004 15.23 >A: Luigi Iannone >Cc: dig...@li... >Oggetto: Re: [DIG-users] TellsDocument > >Luigi Iannone wrote: > > > >>Hi all, >> >>in my code I try to analyze a TellsDocument object I obtained after parsing >>a Jena DIGAdapter.translateKbToDig() result. >> >>As a first issue I obtained an exception on the namespace that I easily >>worked around. The exception is >> >>org.apache.xmlbeans.XmlException: error: The document is not a >>tells@http://dl.kr.org/dig/2003/02/lang: document element namespace >> >> >mismatch > > >>expected "http://dl.kr.org/dig/2003/02/lang" got >> >> >"http://dl.kr.org/dig/lang" > > >> >> >> >> > >The first is the namespace for DIG 1.0, the second for DIG 1.1. > > > >>As a second issue when analyzing the TellsDocument I split it in single >>tells among which, for instance, I identify the equalc with >>.getEqualcArray() method. This method returns an array of ConceptPair >>objects. >>Throughout the Javadoc I couldn't find a method for taking the first >> >> >concept > > >>in the pair or the second one. >> >>Can you help me? >> >> >> >> >> > > >I'm afraid there is no such method: you will have to go through >all possibilities :-( > > Daniele > > > -- Dr Daniele Turi Information Management Group, School of Computer Science The University of Manchester 2.100 Kilburn Building, Oxford Road, Manchester, M13 9PL, UK. Tel +44 (0) 161 275 6145 Fax 6211 http://www.cs.man.ac.uk/~dturi |
From: Luigi I. <ia...@di...> - 2004-11-19 09:21:48
|
Hi again, do you know how to get the number of the cardinality restriction in an instance of NumRoleConceptPair as it is not clear either in the Javadoc = or the xsd schema file Thanks, Luigi -----Messaggio originale-----=20 Da: Daniele Turi [mailto:dt...@cs...]=20 Inviato: gioved=EC 18 novembre 2004 15.58 A: Luigi Iannone Cc: dig...@li... Oggetto: Re: R: [DIG-users] TellsDocument Luigi Iannone wrote: >Wow! >Then I suppose that it is the same for impliesc ConceptPair, isn't it? > =20 > Yes. >So how can I distinguish the subsumed from the subsumer? > =20 > I agree it is very bad. I will have a look again at the XMLBeans=20 documentation and see if I can modify the schema to prevent this. But I tried at the = time to no avail. For instance, in org.kr.dl.dig.reasoner.v1_1.impl.TReasoner#subsumes(Concept, Concept, = URI) I hard coded the "ask" exactly for that reason. If you have any idea how to fix the schema please let me know. Daniele > >-----Messaggio originale----- >Da: Daniele Turi [mailto:dt...@cs...]=20 >Inviato: gioved=EC 18 novembre 2004 15.23 >A: Luigi Iannone >Cc: dig...@li... >Oggetto: Re: [DIG-users] TellsDocument > >Luigi Iannone wrote: > > =20 > >>Hi all, >> >>in my code I try to analyze a TellsDocument object I obtained after parsing >>a Jena DIGAdapter.translateKbToDig() result. >> >>As a first issue I obtained an exception on the namespace that I = easily >>worked around. The exception is=20 >> >>org.apache.xmlbeans.XmlException: error: The document is not a >>tells@http://dl.kr.org/dig/2003/02/lang: document element namespace >> =20 >> >mismatch > =20 > >>expected "http://dl.kr.org/dig/2003/02/lang" got >> =20 >> >"http://dl.kr.org/dig/lang" > =20 > >>=09 >> >> =20 >> > >The first is the namespace for DIG 1.0, the second for DIG 1.1. > > =20 > >>As a second issue when analyzing the TellsDocument I split it in = single >>tells among which, for instance, I identify the equalc with >>.getEqualcArray() method. This method returns an array of ConceptPair >>objects. >>Throughout the Javadoc I couldn't find a method for taking the first >> =20 >> >concept > =20 > >>in the pair or the second one. >> >>Can you help me? >> >>=20 >> >> =20 >> > > >I'm afraid there is no such method: you will have to go through >all possibilities :-( > > Daniele > > =20 > --=20 Dr Daniele Turi Information Management Group, School of Computer Science The University of Manchester 2.100 Kilburn Building, Oxford Road, Manchester, M13 9PL, UK. Tel +44 (0) 161 275 6145 Fax 6211 http://www.cs.man.ac.uk/~dturi |
From: Daniele T. <dt...@cs...> - 2004-11-19 12:51:23
|
Luigi Iannone wrote: >Hi again, > >do you know how to get the number of the cardinality restriction in an >instance of NumRoleConceptPair as it is not clear either in the Javadoc or >the xsd schema file > > The interface NumRoleConceptPair has a getNum() method which should do the job. Daniele -- Dr Daniele Turi Information Management Group, School of Computer Science The University of Manchester 2.100 Kilburn Building, Oxford Road, Manchester, M13 9PL, UK. Tel +44 (0) 161 275 6145 Fax 6211 http://www.cs.man.ac.uk/~dturi |
From: Luigi I. <ia...@di...> - 2004-11-19 17:16:26
Attachments:
dummyTell.txt
|
Hi again, I have the following strange situation now. If I run the following code public class TestBean { public static void main(String[] args) { try { TellsDocument tells =3D TellsDocument.Factory.parse(new File("dummyTell.txt")); =09 System.out.println(tells.getTells().getEqualcArray().length); Document doc =3D DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File("dummyTell.txt")); TellsDocument newTells =3D TellsDocument.Factory.parse(doc); =09 System.out.println(newTells.getTells().getEqualcArray().length); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (FactoryConfigurationError e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } I obtain the following output for the file attached (dummyTell.txt) 17 org.apache.xmlbeans.XmlException: error: The document is not a tells@http://dl.kr.org/dig/2003/02/lang: document element namespace = mismatch expected "http://dl.kr.org/dig/2003/02/lang" got "" at org.apache.xmlbeans.impl.store.Root.verifyDocumentType(Root.java:501) at org.apache.xmlbeans.impl.store.Root.autoTypedDocument(Root.java:417) at org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1817) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoad= erB ase.java:342) at org.kr.dl.dig.v1_1.TellsDocument$Factory.parse(TellsDocument.java:126) at TestBean.main(TestBean.java:32) In practice when I parse from file everything goes right (or seems) as = it prints out the number of equalsc. When I parse from Document it raises = an exception. Can you help me? Thanks, Luigi -----Messaggio originale----- Da: dig...@li... [mailto:dig...@li...] Per conto di Daniele Turi Inviato: venerd=EC 19 novembre 2004 13.51 A: Luigi Iannone Cc: dig...@li... Oggetto: Re: R: R: [DIG-users] TellsDocument Luigi Iannone wrote: >Hi again, > >do you know how to get the number of the cardinality restriction in an >instance of NumRoleConceptPair as it is not clear either in the Javadoc = or >the xsd schema file > =20 > The interface NumRoleConceptPair has a getNum() method which should do the job. Daniele --=20 Dr Daniele Turi Information Management Group, School of Computer Science The University of Manchester 2.100 Kilburn Building, Oxford Road, Manchester, M13 9PL, UK. Tel +44 (0) 161 275 6145 Fax 6211 http://www.cs.man.ac.uk/~dturi ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ DIG-users mailing list DIG...@li... https://lists.sourceforge.net/lists/listinfo/dig-users |