From naaman at truemeridian.com Wed Dec 1 05:14:00 2010 From: naaman at truemeridian.com (Naaman Musawwir) Date: Wed, 1 Dec 2010 15:14:00 +0500 Subject: [Kim-discussion] Help - Document Feature Schema In-Reply-To: <201011301713.36574.boyan.kukushev@ontotext.com> Message-ID: <59.03.04819.4D026FC4@cm-omr10> Thank you for your time and guidance. I installed a fresh instance of KIM and this feature addition works there. I'll track down why it is not working in my original instance. Regards, Naaman Musawwir. _____ From: Boyan Kukushev [mailto:boyan.kukushev at ontotext.com] Sent: Tuesday, November 30, 2010 8:14 PM To: kim-discussion at ontotext.com Cc: Naaman Musawwir; 'Philip Alexiev' Subject: Re: [Kim-discussion] Help - Document Feature Schema Hello, I tried your code - there were no exceptions for me and that makes things very strange. I am not able to see what could be null at this point - obviously, it is neither the initial KIM document, nor its feature map. Only possible (but quite improbable) reason could be that the primitive int value (2) you are trying to set as feature value is not auto-boxed to Integer. Try setting the value as an Integer object: kdocFromUrl.putFeature("LENSID", new Integer(2)); Also, information on the java distribution you are using may be helpful. Now on your base problem - adding custom feature to the document - well, IMO you have not restarted the KIM server after the property value change. KIM configuration files are not tracked for changes while the server is running - this might be the thing that have confused you. Stop and start the KIM server, then try adding the document again. Regards, Boyan On Tue November 30 2010 16:26:27 Naaman Musawwir wrote: > Here is output of KIM. > > > > Regards, > > Naaman Musawwir. > > _____ > > From: Philip Alexiev [mailto:philip.alexiev at ontotext.com] > Sent: Tuesday, November 30, 2010 7:03 PM > To: Naaman Musawwir > Cc: kim-discussion at ontotext.com > Subject: Re: [Kim-discussion] Help - Document Feature Schema > > > > Could you describe exactly how you are trying to add your custom feature to > the document ? Please also provide the output of the tools (and KIM) you > are using. Also you may set the log level to DEBUG for more verbose output. > In config/log.prop change: > log4j.rootLogger=INFO, aAll, cAll > to > log4j.rootLogger=DEBUG, aAll, cAll > > Philip > > On 11/30/2010 03:40 PM, Naaman Musawwir wrote: > > > Hello, > > > > The problem I am facing is while using option 1 where we need to add a > feature LENSID manually into the custom created documents. I fetched feature > schema that also did not include LENSID in the list. What am I missing if > just updating this list is sufficient? I followed the process below but that > gives a nullpointer exception when trying to add LENSID. > > > > We have implemented a GATE plug-in with a custom IE application that is > working fine. That adds NEAR_TOKENS feature automatically in the documents > according tour custom logic. This works fine when we add documents using > populator. > > > > Regards, > > Naaman Musawwir. > > From: Boyan Kukushev [mailto:boyan.kukushev at ontotext.com] > Sent: Tuesday, November 30, 2010 4:53 PM > To: kim-discussion at ontotext.com > Cc: Naaman Musawwir; 'Philip Alexiev @ Ontotext' > Subject: Re: [Kim-discussion] Help - Document Feature Schema > > > > Hello Naaman, > > Adding a custom feature to your documents is actually not a simple task to > do, > especially if you are trying to populate the documents using out populator > tool. > > 1) If you are using the Java API to annotate and store documents into the > KIM > server, the procedure is as follows: > > - update the com.ontotext.kim.KIMConstants.DOCUMENT_FEAT_LIST property > in > kim-home/config/document.repository.properties configuration file, adding > the > name of your custom property to the list of properties > - start the KIM server > - you have to use the following (or similar) code to annotate, add the > custom > property value and store the document into the server: > > // retrieve all necessary server APIs > KIMService service = GetService.from("localhost", 1099); > DocumentRepositoryAPI dr = service.getDocumentRepositoryAPI(); > SemanticAnnotationAPI sa = service.getSemanticAnnotationAPI(); > CorporaAPI ca = service.getCorporaAPI(); > > // use corpora API to retrieve object of KIMDocument type > // by invoking the most suitable method > KIMDocument doc = ca.createDocument(new URL("someurl"), "UTF-8"); > > // semantically annotate the content of the document > // read carefully the javadoc to understand what is happening > doc = sa.execute(doc); > > // add your feature to the document > // the features can be of any type > // String is recommended > Object myFeatureValue = ...; > doc.putFeature("MYFEATURE", myFeatureValue); > > // store the document > dr.addDocument(doc); > > For more detail on using KIM server APIs check our documentation at > http://ontotext.com/kim/doc/KimDocs-3.0-EN/DevelopersGuide.html and > http://nmwiki.ontotext.com/kim-javadoc/index.html > > 2) If you are using our populator tool, all this gets much more complex. As > long as all things that the code above does happen in the populator tool > JVM, > you can't modify any object there. In order to be able to set your custom > property, you have to add another step to the annotation process. That > process is controlled by a special file: > kim-home/context/default/resources/IE.gapp (by default!). > > This is the description of our GATE application; in short, GATE is a > platform > for text analysis and similar stuff, developed by our colleagues at the > University of Sheffield . See http://gate.ac.uk for more info. If you are > not > familiar with GATE, I'm afraid it will be much harder to achieve your goal. > > With a few words - you have to add a new GATE processing resource to the > GATE > application. That processing resource would actually do the job of setting > your custom property to the document. If you need more information, you can > always ask us, but it is really recommended that you know how to do things > with GATE. > > Hope this helps! > > Regards, > Boyan Kukushev, > KIM Platform developer, KIM team > > > On Thu November 25 2010 16:48:30 Naaman Musawwir wrote: > > Attached is the properties file. > > > > > > > > Regards, > > > > Naaman Musawwir. > > > > _____ > > > > From: Philip Alexiev @ Ontotext [mailto:philip.alexiev at ontotext.com] > > Sent: Thursday, November 25, 2010 7:07 PM > > To: Naaman Musawwir > > Cc: kim-discussion at ontotext.com > > Subject: Re: [Kim-discussion] Help - Document Feature Schema > > > > > > > > Hi Naaman > > > > > > > > Adding your custom feature to the list is sufficient. Please send your > > document.repository.properties if you still have problems with that. > > > > > > > > Greetings, > > > > Philip Alexiev > > > > Software Engineer, KIM Team > > > > > > > > On Nov 25, 2010, at 9:57 AM, Naaman Musawwir wrote: > > > > > > > > > > > > Hello, > > > > > > > > I want to add a few custom features to KIM documents. How should I do > that? > > I updated the propertycom.ontotext.kim.KIMConstants.DOCUMENT_FEAT_LIST in > > conf/document.repository.properties but even after that I get > the > > error that > > > > > > > > Features [CUSTOM_FEATURE] are not in the feature schema. Feature schema is > > currently: [SUBJECT, AUTHORS, SOURCE, LANGUAGE, DOCTYPE, KEYENTITIES, > > KEYPHRASES, TIMESTAMP, URL, TITLE] > > > > > > > > What to do more in this regard? > > > > > > > > Regards, > > > > Naaman Musawwir. > > > > > > > > _______________________________________________ > > Kim-discussion mailing list > > Kim-discussion at ontotext.com > > http://ontotext.com/mailman/listinfo/kim-discussion > > > > > > > > No virus found in this incoming message. > > Checked by AVG - www.avg.com > > Version: 9.0.872 / Virus Database: 271.1.1/3277 - Release Date: 11/25/10 > > 00:34:00 > > > > > > > > > > -- > Boyan Kukushev > Senior Software Engineer / Java Developer > Ontotext AD @ Sirma Group Corp. > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3288 - Release Date: 11/29/10 > > > > > > -- Boyan Kukushev Senior Software Engineer / Java Developer Ontotext AD @ Sirma Group Corp. _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3288 - Release Date: 11/29/10 -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.alexiev at ontotext.com Thu Dec 2 18:05:57 2010 From: philip.alexiev at ontotext.com (Philip Alexiev @ Ontotext) Date: Fri, 3 Dec 2010 01:05:57 +0200 Subject: [Kim-discussion] regarding adding own ontology in kim. In-Reply-To: References: Message-ID: <2020D44A-835A-445C-B101-78E935AD6C87@ontotext.com> Hello Shelly, Is this the documentation you are following: http://ontotext.com/kim/doc/KimDocs-3.0-EN/ExtendInformationExtraction.html Have you made the classes visible? The only way this may be done is to append visibility statements to the file KIM/context/default/kb/visibility.nt . Hth Philip Alexiev Software Engineer, KIM Team On Dec 2, 2010, at 2:49 PM, shelly mangla wrote: > hello sir.. > i am trying to add my ontology in KIM, but it is not showing any fruitfil result. > i used the pizza.owl file and made the subclass of entity of proton.owl. > also done changes in owlim.ttl. > i just now want that my classes should be displayed in ontology tab, but it is not giving any result. > please help me. i had followed the steps given in KIM doc > please help me... > > shelly From shelly.mangla at gmail.com Fri Dec 3 14:06:24 2010 From: shelly.mangla at gmail.com (shelly mangla) Date: Sat, 4 Dec 2010 00:36:24 +0530 Subject: [Kim-discussion] regarding adding own ontology in kim. In-Reply-To: <2020D44A-835A-445C-B101-78E935AD6C87@ontotext.com> References: <2020D44A-835A-445C-B101-78E935AD6C87@ontotext.com> Message-ID: Hello Alex Thanks for your help and quick response. I have following the steps from the given document (ExtendInformationExtraction.html). After following all steps, I am unable to get any result (on display and annotation). I am listing down my steps:- 1. Creation of ontology file using Protege (4.0). Attaching the owl file in attachment. a. Created Two Classes (Country and State). b. Created object properties between them. (hasState and isStateOf) c. Created Individual of Both Classes (India, USA, China) (Punjab, New York) etc. d. Object Properties Assertion between Individual. 2. Added the following entries in (owlim.ttl). Attaching the ttl file in attachment. a. kb/owl/new.owl; b. http://www.semanticweb.org/ontologies/2010/11/shelly#; 3. Added the following entries in visibility.nt (Attaching File) a. "" . b. "" . Please help me how to do it. If Possible, Please reply as soon as possible. Regards Shelly On Fri, Dec 3, 2010 at 4:35 AM, Philip Alexiev @ Ontotext < philip.alexiev at ontotext.com> wrote: > Hello Shelly, > > Is this the documentation you are following: > > http://ontotext.com/kim/doc/KimDocs-3.0-EN/ExtendInformationExtraction.html > > Have you made the classes visible? The only way this may be done is to > append visibility statements to the file > KIM/context/default/kb/visibility.nt . > > Hth > Philip Alexiev > Software Engineer, KIM Team > > On Dec 2, 2010, at 2:49 PM, shelly mangla wrote: > > > hello sir.. > > i am trying to add my ontology in KIM, but it is not showing any fruitfil > result. > > i used the pizza.owl file and made the subclass of entity of proton.owl. > > also done changes in owlim.ttl. > > i just now want that my classes should be displayed in ontology tab, but > it is not giving any result. > > please help me. i had followed the steps given in KIM doc > > please help me... > > > > shelly > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: new.owl Type: application/octet-stream Size: 9833 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: visibility.nt Type: application/octet-stream Size: 10565 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: owlim.ttl Type: application/octet-stream Size: 2556 bytes Desc: not available URL: From philip.alexiev at ontotext.com Sat Dec 4 21:14:46 2010 From: philip.alexiev at ontotext.com (Philip Alexiev @ Ontotext) Date: Sun, 5 Dec 2010 04:14:46 +0200 Subject: [Kim-discussion] regarding adding own ontology in kim. In-Reply-To: References: <2020D44A-835A-445C-B101-78E935AD6C87@ontotext.com> Message-ID: <1DAAB24B-52DF-48A8-A44C-85427E1E39F2@ontotext.com> Hi Shelly, One important step, which usually exists in the IE process, is using a list of predefined terms, which are meaningful for the specific domain. Such lists are used by a Gazetteer. KIM uses a more complex Gazetteer, which extracts its lists from the semantic repository underneath. Its default behavior is to get all labels of all entities which meet three requirements: * have at least one alias (label) KIM uses two models to associate entities with their labels - aliases and labels. Aliases are separate objects and allow having some metadata associated with a concrete label. Labels are just datatype properties - more simple and compact. The model is set via the com.ontotext.kim.KIMConstants.ENTITY_DESCR property in KIM/config/install.properties . * are of type that is subclass of protons:Entity example: wkb:Person_Aristotle a protont:Person . protont:Person rdfs:subClassOf protons:Entity . * are marked as Trusted To mark an entity as trusted, there should exist in the semantic repository statements, that this entity is generated by a trusted source. An example: wkb:Gazetteer a protons:Trusted . wkb:Person_Aristotle protons:generatedBy wkb:Gazetteer . There are some trusted sources defined in the default KB, but new ones can be defined also. Many approaches exist for adding new entities to KIM's IE. Some of the most common are: * use the existing PROTON classes The quickest and easiest way. KIM already knows about most of PROTON's classes and has grammars to create meaningful annotations over them. So for example if we want to recognize "Aristotle" as a person in the analyzed documents, a new person instance has to be defined like this: customkb:Person_Aristotle a protont:Person ; protons:hasMainAlias customkb:Person_Aristotle.1 . customkb:Person_Aristotle.1 a protons:Alias; rdfs:label "Aristotle" . Note: The format of the URI is not strict. The only requirement is that it is unique. Note: An entity can have multiple aliases and one main alias ( labels respectively) . The gazetteer will create Lookup annotations, which serve as input for other resources and rules. That is why we want to transform these into meaningful ones. In KIM there are rules that will match a Lookup annotation with class feature class=http://proton.semanticweb.org/2006/05/protont#Person and create a Person annotation over it. That is why over Aristotle, a new Person annotation will be created. The drawback of this approach is that the new ontology is very closely tied to PROTON. It is good for extending the instance base of already existing classes, but not that good for extending KIM with a completely new ontology. * default gazetteer with custom Jape rules If we have a complete ontology we want to adapt, and for example: customkb:Person_Aristotle a customkb:Person . Then we can complete the mentioned requirements for an entity to be included in the gazetteer lists: * define aliases customkb:Person_Aristotle a protont:Person ; protons:hasMainAlias customkb:Person_Aristotle.1 . customkb:Person_Aristotle.1 a protons:Alias; rdfs:label "Aristotle" . * make the class subclass directly or indirectly protons:Entity customkb:Person rdfs:subClassOf protont:Person . * mark the entity as Trusted customkb:Person_Aristotle protons:generatedBy wkb:Gazetteer . These steps will make the gazetteer create Lookup annotations whenever it meets "Aristotle" in the text. To make these lookups useful, we can write a Jape grammar to create Person annotations. The rules will be similar to this one: Rule: customkb_person ( {Lookup.class == "http://customkb#Person"} ) :person --> :person.Person = {rule = "customkb_person", class = :person.Lookup.class, inst = :person.Lookup.inst, originalName = :person.Lookup.originalName } We can write a rule like this for every class of the custom ontology. * define a new gazetteer Another way, if we have a complete ontology, is to create a new gazetteer, dedicated to recognizing instances from this ontology. Its query will look like this: select LA, I, DC from {I} rdf:type customkb:EntitiesRoot , {I} serql:directType {DC}, {I} customkb:name {LA} In this case, the new entities do not need to meet the requirements mentioned at the beginning (to have aliases, to be of type protons:Entity, to be Trusted). All the results from the query will be used to fill the gazetteer's dictionary. After the new gazetteer has created lookups, we can use Jape rules like the one above. This is basically how new entities are recognized. There are of course alternatives, and which one you use depends on you particular case. But this should be enough to give you directions. Hope this helps, Philip On Dec 3, 2010, at 9:06 PM, shelly mangla wrote: > > Hello Alex > Thanks for your help and quick response. I have following the steps from the given document (ExtendInformationExtraction.html). After following all steps, I am unable to get any result (on display and annotation). > > I am listing down my steps:- > > 1. Creation of ontology file using Protege (4.0). Attaching the owl file in attachment. > a. Created Two Classes (Country and State). > b. Created object properties between them. (hasState and isStateOf) > c. Created Individual of Both Classes (India, USA, China) (Punjab, New York) etc. > d. Object Properties Assertion between Individual. > 2. Added the following entries in (owlim.ttl). Attaching the ttl file in attachment. > a. kb/owl/new.owl; > b. http://www.semanticweb.org/ontologies/2010/11/shelly#; > 3. Added the following entries in visibility.nt (Attaching File) > a. > "" . > b. > "" . > > > Please help me how to do it. If Possible, Please reply as soon as possible. > > Regards > Shelly > > > On Fri, Dec 3, 2010 at 4:35 AM, Philip Alexiev @ Ontotext wrote: > Hello Shelly, > > Is this the documentation you are following: > > http://ontotext.com/kim/doc/KimDocs-3.0-EN/ExtendInformationExtraction.html > > Have you made the classes visible? The only way this may be done is to append visibility statements to the file KIM/context/default/kb/visibility.nt . > > Hth > Philip Alexiev > Software Engineer, KIM Team > > On Dec 2, 2010, at 2:49 PM, shelly mangla wrote: > > > hello sir.. > > i am trying to add my ontology in KIM, but it is not showing any fruitfil result. > > i used the pizza.owl file and made the subclass of entity of proton.owl. > > also done changes in owlim.ttl. > > i just now want that my classes should be displayed in ontology tab, but it is not giving any result. > > please help me. i had followed the steps given in KIM doc > > please help me... > > > > shelly > > > _______________________________________________ > Kim-discussion mailing list > Kim-discussion at ontotext.com > http://ontotext.com/mailman/listinfo/kim-discussion -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrislshaw at gmail.com Thu Dec 9 09:41:28 2010 From: chrislshaw at gmail.com (Chris Shaw) Date: Thu, 9 Dec 2010 08:41:28 -0600 Subject: [Kim-discussion] regarding adding own ontology in kim. In-Reply-To: <1DAAB24B-52DF-48A8-A44C-85427E1E39F2@ontotext.com> References: <2020D44A-835A-445C-B101-78E935AD6C87@ontotext.com> <1DAAB24B-52DF-48A8-A44C-85427E1E39F2@ontotext.com> Message-ID: I've been working on the same problem. I'm on the step now where I should build a new gazetteer, but I can't find the screen where you have the option to set the FeedSetupPath. I'm following this tutorial: http://ontotext.com/kim/doc/KimDocs-3.0-EN/CaseStudy-IntegrationDbPedia.htmland I'm on step 3.6. I'm using the kim-gate-gui, is this correct? When I add a new ANNIE gazetteer I only get 4 fields. The example screen shows 10 fields. Thanks, Chris On Sat, Dec 4, 2010 at 8:14 PM, Philip Alexiev @ Ontotext < philip.alexiev at ontotext.com> wrote: > Hi Shelly, > > One important step, which usually exists in the IE process, is using a list > of predefined terms, which are meaningful for the specific domain. Such > lists are used by a Gazetteer. KIM uses a more complex Gazetteer, which > extracts its lists from the semantic repository underneath. Its default > behavior is to get all labels of all entities which meet three requirements: > ** have at least one alias (label)* > KIM uses two models to associate entities with their labels - aliases and > labels. Aliases are separate objects and allow having some metadata > associated with a concrete label. Labels are just datatype properties - more > simple and compact. The model is set via the > com.ontotext.kim.KIMConstants.ENTITY_DESCR property in > KIM/config/install.properties . > ** are of type that is subclass of protons:Entity* > example: > *wkb:Person_Aristotle a protont:Person .* > *protont:Person rdfs:subClassOf protons:Entity .* > ** are marked as Trusted* > To mark an entity as trusted, there should exist in the semantic repository > statements, that this entity is generated by a trusted source. An example: > *wkb:Gazetteer a protons:Trusted .* > *wkb:Person_Aristotle protons:generatedBy wkb:Gazetteer .* > > There are some trusted sources defined in the default KB, but new ones can > be defined also. > > > Many approaches exist for adding new entities to KIM's IE. Some of the most > common are: > > ** use the existing PROTON classes* > The quickest and easiest way. KIM already knows about most of PROTON's > classes and has grammars to create meaningful annotations over them. So for > example if we want to recognize "Aristotle" as a person in the analyzed > documents, a new person instance has to be defined like this: > *customkb:Person_Aristotle a protont:Person ;* > * **protons:hasMainAlias customkb:Person_Aristotle.1 .* > *customkb:Person_Aristotle.1 a protons:Alias;* > * **rdfs:label "Aristotle" .* > > Note: The format of the URI is not strict. The only requirement is that it > is unique. > Note: An entity can have multiple aliases and one main alias ( labels > respectively) . > > The gazetteer will create Lookup annotations, which serve as input for > other resources and rules. That is why we want to transform these into > meaningful ones. In KIM there are rules that will match a Lookup annotation > with class feature class= > http://proton.semanticweb.org/2006/05/protont#Person and create a Person > annotation over it. That is why over Aristotle, a new Person annotation will > be created. > > The drawback of this approach is that the new ontology is very closely tied > to PROTON. It is good for extending the instance base of already existing > classes, but not that good for extending KIM with a completely new ontology. > > ** default gazetteer with custom Jape rules* > If we have a complete ontology we want to adapt, and for example: > *customkb:Person_Aristotle a customkb:Person .* > Then we can complete the mentioned requirements for an entity to be > included in the gazetteer lists: > * define aliases > *customkb:Person_Aristotle a protont:Person ;* > * **protons:hasMainAlias customkb:Person_Aristotle.1 .* > * customkb:Person_Aristotle.1 a protons:Alias;* > * **rdfs:label "Aristotle" .* > * > * > * make the class subclass directly or indirectly protons:Entity > *customkb:Person rdfs:subClassOf protont:Person .* > * > * > * mark the entity as Trusted > *customkb:Person_Aristotle protons:generatedBy wkb:Gazetteer .* > > These steps will make the gazetteer create Lookup annotations whenever it > meets "Aristotle" in the text. To make these lookups useful, we can write a > Jape grammar to create Person annotations. The rules will be similar to this > one: > *Rule: customkb_person* > *(* > * {Lookup.class == "http://customkb#Person"}* > *)* > *:person* > *-->* > * :person.Person = {rule = "customkb_person",* > * class = :person.Lookup.class, inst = :person.Lookup.inst, originalName = > :person.Lookup.originalName }* > > We can write a rule like this for every class of the custom ontology. > > ** define a new gazetteer* > Another way, if we have a complete ontology, is to create a new gazetteer, > dedicated to recognizing instances from this ontology. Its query will look > like this: > *select LA, I, DC from* > *{I} rdf:type customkb:EntitiesRoot ,* > *{I} serql:directType {DC},* > *{I} customkb:name {LA}* > > In this case, the new entities do not need to meet the requirements > mentioned at the beginning (to have aliases, to be of type protons:Entity, > to be Trusted). All the results from the query will be used to fill the > gazetteer's dictionary. > > After the new gazetteer has created lookups, we can use Jape rules like the > one above. > > > This is basically how new entities are recognized. There are of course > alternatives, and which one you use depends on you particular case. But this > should be enough to give you directions. > > Hope this helps, > Philip > > On Dec 3, 2010, at 9:06 PM, shelly mangla wrote: > > > Hello Alex > Thanks for your help and quick response. I have following the > steps from the given document (ExtendInformationExtraction.html). > After following all steps, I am unable to get any result (on display and > annotation). > > I am listing down my steps:- > > 1. Creation of ontology file using Protege (4.0). Attaching the owl file in > attachment. > a. Created Two Classes (Country and State). > b. Created object properties between them. (hasState and isStateOf) > c. Created Individual of Both Classes (India, USA, China) (Punjab, > New York) etc. > d. Object Properties Assertion between Individual. > 2. Added the following entries in (owlim.ttl). Attaching the ttl file in > attachment. > a. kb/owl/new.owl; > b. http://www.semanticweb.org/ontologies/2010/11/shelly#; > 3. Added the following entries in visibility.nt (Attaching File) > a. > < > http://www.ontotext.com/kim/2006/05/kimso#visibilityLevel1> "" . > b. > > "" . > > > Please help me how to do it. If Possible, Please reply as soon as possible. > > Regards > Shelly > > > On Fri, Dec 3, 2010 at 4:35 AM, Philip Alexiev @ Ontotext < > philip.alexiev at ontotext.com> wrote: > >> Hello Shelly, >> >> Is this the documentation you are following: >> >> >> http://ontotext.com/kim/doc/KimDocs-3.0-EN/ExtendInformationExtraction.html >> >> Have you made the classes visible? The only way this may be done is to >> append visibility statements to the file >> KIM/context/default/kb/visibility.nt . >> >> Hth >> Philip Alexiev >> Software Engineer, KIM Team >> >> On Dec 2, 2010, at 2:49 PM, shelly mangla wrote: >> >> > hello sir.. >> > i am trying to add my ontology in KIM, but it is not showing any >> fruitfil result. >> > i used the pizza.owl file and made the subclass of entity of proton.owl. >> > also done changes in owlim.ttl. >> > i just now want that my classes should be displayed in ontology tab, but >> it is not giving any result. >> > please help me. i had followed the steps given in KIM doc >> > please help me... >> > >> > shelly >> >> > > _______________________________________________ > > Kim-discussion mailing list > Kim-discussion at ontotext.com > http://ontotext.com/mailman/listinfo/kim-discussion > > > > _______________________________________________ > Kim-discussion mailing list > Kim-discussion at ontotext.com > http://ontotext.com/mailman/listinfo/kim-discussion > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.alexiev at ontotext.com Thu Dec 9 10:19:29 2010 From: philip.alexiev at ontotext.com (Philip Alexiev @ Ontotext) Date: Thu, 9 Dec 2010 17:19:29 +0200 Subject: [Kim-discussion] regarding adding own ontology in kim. In-Reply-To: References: <2020D44A-835A-445C-B101-78E935AD6C87@ontotext.com> <1DAAB24B-52DF-48A8-A44C-85427E1E39F2@ontotext.com> Message-ID: Hi Chris kim-gate-ui starts Gate with all the libraries from KIM loaded. This means you can load and use all the extra plugins and resources developed by Ontotext. They will be visible on the UI. You will have to load the lkb-gazetteer plugin in gate. Then you will be able to create an lkb-gazetteer PR. When you create a new one, the dialog asks you to setup a number of parameters. FeedSetupPath is set in the dictFeederParams. Set it to something like FeedSetupPath=$relpath$../../../config . Hth Philip Alexiev Software Engineer, KIM Team On Dec 9, 2010, at 4:41 PM, Chris Shaw wrote: > I've been working on the same problem. I'm on the step now where I should build a new gazetteer, but I can't find the screen where you have the option to set the FeedSetupPath. I'm following this tutorial: http://ontotext.com/kim/doc/KimDocs-3.0-EN/CaseStudy-IntegrationDbPedia.html and I'm on step 3.6. I'm using the kim-gate-gui, is this correct? When I add a new ANNIE gazetteer I only get 4 fields. The example screen shows 10 fields. > > Thanks, > Chris > > On Sat, Dec 4, 2010 at 8:14 PM, Philip Alexiev @ Ontotext wrote: > Hi Shelly, > > One important step, which usually exists in the IE process, is using a list of predefined terms, which are meaningful for the specific domain. Such lists are used by a Gazetteer. KIM uses a more complex Gazetteer, which extracts its lists from the semantic repository underneath. Its default behavior is to get all labels of all entities which meet three requirements: > * have at least one alias (label) > KIM uses two models to associate entities with their labels - aliases and labels. Aliases are separate objects and allow having some metadata associated with a concrete label. Labels are just datatype properties - more simple and compact. The model is set via the com.ontotext.kim.KIMConstants.ENTITY_DESCR property in KIM/config/install.properties . > * are of type that is subclass of protons:Entity > example: > wkb:Person_Aristotle a protont:Person . > protont:Person rdfs:subClassOf protons:Entity . > * are marked as Trusted > To mark an entity as trusted, there should exist in the semantic repository statements, that this entity is generated by a trusted source. An example: > wkb:Gazetteer a protons:Trusted . > wkb:Person_Aristotle protons:generatedBy wkb:Gazetteer . > > There are some trusted sources defined in the default KB, but new ones can be defined also. > > > Many approaches exist for adding new entities to KIM's IE. Some of the most common are: > > * use the existing PROTON classes > The quickest and easiest way. KIM already knows about most of PROTON's classes and has grammars to create meaningful annotations over them. So for example if we want to recognize "Aristotle" as a person in the analyzed documents, a new person instance has to be defined like this: > customkb:Person_Aristotle a protont:Person ; > protons:hasMainAlias customkb:Person_Aristotle.1 . > customkb:Person_Aristotle.1 a protons:Alias; > rdfs:label "Aristotle" . > > Note: The format of the URI is not strict. The only requirement is that it is unique. > Note: An entity can have multiple aliases and one main alias ( labels respectively) . > > The gazetteer will create Lookup annotations, which serve as input for other resources and rules. That is why we want to transform these into meaningful ones. In KIM there are rules that will match a Lookup annotation with class feature class=http://proton.semanticweb.org/2006/05/protont#Person and create a Person annotation over it. That is why over Aristotle, a new Person annotation will be created. > > The drawback of this approach is that the new ontology is very closely tied to PROTON. It is good for extending the instance base of already existing classes, but not that good for extending KIM with a completely new ontology. > > * default gazetteer with custom Jape rules > If we have a complete ontology we want to adapt, and for example: > customkb:Person_Aristotle a customkb:Person . > Then we can complete the mentioned requirements for an entity to be included in the gazetteer lists: > * define aliases > customkb:Person_Aristotle a protont:Person ; > protons:hasMainAlias customkb:Person_Aristotle.1 . > customkb:Person_Aristotle.1 a protons:Alias; > rdfs:label "Aristotle" . > > * make the class subclass directly or indirectly protons:Entity > customkb:Person rdfs:subClassOf protont:Person . > > * mark the entity as Trusted > customkb:Person_Aristotle protons:generatedBy wkb:Gazetteer . > > These steps will make the gazetteer create Lookup annotations whenever it meets "Aristotle" in the text. To make these lookups useful, we can write a Jape grammar to create Person annotations. The rules will be similar to this one: > Rule: customkb_person > ( > {Lookup.class == "http://customkb#Person"} > ) > :person > --> > :person.Person = {rule = "customkb_person", > class = :person.Lookup.class, inst = :person.Lookup.inst, originalName = :person.Lookup.originalName } > > We can write a rule like this for every class of the custom ontology. > > * define a new gazetteer > Another way, if we have a complete ontology, is to create a new gazetteer, dedicated to recognizing instances from this ontology. Its query will look like this: > select LA, I, DC from > {I} rdf:type customkb:EntitiesRoot , > {I} serql:directType {DC}, > {I} customkb:name {LA} > > In this case, the new entities do not need to meet the requirements mentioned at the beginning (to have aliases, to be of type protons:Entity, to be Trusted). All the results from the query will be used to fill the gazetteer's dictionary. > > After the new gazetteer has created lookups, we can use Jape rules like the one above. > > > This is basically how new entities are recognized. There are of course alternatives, and which one you use depends on you particular case. But this should be enough to give you directions. > > Hope this helps, > Philip > > On Dec 3, 2010, at 9:06 PM, shelly mangla wrote: > >> >> Hello Alex >> Thanks for your help and quick response. I have following the steps from the given document (ExtendInformationExtraction.html). After following all steps, I am unable to get any result (on display and annotation). >> >> I am listing down my steps:- >> >> 1. Creation of ontology file using Protege (4.0). Attaching the owl file in attachment. >> a. Created Two Classes (Country and State). >> b. Created object properties between them. (hasState and isStateOf) >> c. Created Individual of Both Classes (India, USA, China) (Punjab, New York) etc. >> d. Object Properties Assertion between Individual. >> 2. Added the following entries in (owlim.ttl). Attaching the ttl file in attachment. >> a. kb/owl/new.owl; >> b. http://www.semanticweb.org/ontologies/2010/11/shelly#; >> 3. Added the following entries in visibility.nt (Attaching File) >> a. >> "" . >> b. >> "" . >> >> >> Please help me how to do it. If Possible, Please reply as soon as possible. >> >> Regards >> Shelly >> >> >> On Fri, Dec 3, 2010 at 4:35 AM, Philip Alexiev @ Ontotext wrote: >> Hello Shelly, >> >> Is this the documentation you are following: >> >> http://ontotext.com/kim/doc/KimDocs-3.0-EN/ExtendInformationExtraction.html >> >> Have you made the classes visible? The only way this may be done is to append visibility statements to the file KIM/context/default/kb/visibility.nt . >> >> Hth >> Philip Alexiev >> Software Engineer, KIM Team >> >> On Dec 2, 2010, at 2:49 PM, shelly mangla wrote: >> >> > hello sir.. >> > i am trying to add my ontology in KIM, but it is not showing any fruitfil result. >> > i used the pizza.owl file and made the subclass of entity of proton.owl. >> > also done changes in owlim.ttl. >> > i just now want that my classes should be displayed in ontology tab, but it is not giving any result. >> > please help me. i had followed the steps given in KIM doc >> > please help me... >> > >> > shelly >> >> >> _______________________________________________ >> >> Kim-discussion mailing list >> Kim-discussion at ontotext.com >> http://ontotext.com/mailman/listinfo/kim-discussion > > > _______________________________________________ > Kim-discussion mailing list > Kim-discussion at ontotext.com > http://ontotext.com/mailman/listinfo/kim-discussion > > > _______________________________________________ > Kim-discussion mailing list > Kim-discussion at ontotext.com > http://ontotext.com/mailman/listinfo/kim-discussion -------------- next part -------------- An HTML attachment was scrubbed... URL: From naaman at truemeridian.com Sun Dec 12 23:54:13 2010 From: naaman at truemeridian.com (Naaman Musawwir) Date: Mon, 13 Dec 2010 09:54:13 +0500 Subject: [Kim-discussion] Help - Search against custom feature Message-ID: <11.84.19095.FE7A50D4@cm-omr8> Hello, I followed the example http://ontotext.com/kim/doc/KimDocs-3.0-EN/SearchForDocumentsExamples.html to search documents against some custom document features. It works fine for default set of features but not for custom features. Do we need to do some extra work in order to get search work for custom features? Regards, Naaman Musawwir. -------------- next part -------------- An HTML attachment was scrubbed... URL: From boyan.kukushev at ontotext.com Mon Dec 13 12:28:44 2010 From: boyan.kukushev at ontotext.com (Boyan Kukushev) Date: Mon, 13 Dec 2010 19:28:44 +0200 Subject: [Kim-discussion] Help - Search against custom feature In-Reply-To: <11.84.19095.FE7A50D4@cm-omr8> References: <11.84.19095.FE7A50D4@cm-omr8> Message-ID: <201012131928.44974.boyan.kukushev@ontotext.com> Hello, Naaman, We are currently investigating your issue. Please, send sample code to clarify the problem. Thanks! Regards, Boyan On Mon December 13 2010 06:54:13 Naaman Musawwir wrote: > Hello, > > > > I followed the example > http://ontotext.com/kim/doc/KimDocs-3.0-EN/SearchForDocumentsExamples.html > to search documents against some custom document features. It works fine for > default set of features but not for custom features. Do we need to do some > extra work in order to get search work for custom features? > > > > Regards, > > Naaman Musawwir. > > > > -- Boyan Kukushev Senior Software Engineer / Java Developer Ontotext AD @ Sirma Group Corp. From naaman at truemeridian.com Mon Dec 13 12:36:30 2010 From: naaman at truemeridian.com (Naaman Musawwir) Date: Mon, 13 Dec 2010 22:36:30 +0500 Subject: [Kim-discussion] Help - Search against custom feature In-Reply-To: <201012131928.44974.boyan.kukushev@ontotext.com> Message-ID: Hello, thank you. Here is part of the code that I am using for searching. Please notice the lines where I set query restrictions. If I use title:women it returns relevant documents but if I use BB_ID:2 it never returns anything even if many documents exist. The feature BB_ID is there in documents as verified by displaying that in the code. static void searchDocuments(DocumentRepositoryAPI apiDR) { // load documents from persistence // ---------------------------------------------------------------------------- ------ System.out.println("\n\nLoading documents from persistance ..."); DocumentQueryResult listDocIDs = null; // example DocumentQuery query = new DocumentQuery(); try { //query = query.setKeywordRestriction("bb_id:153"); //query.setKeywordRestriction("lens_id:2"); //query = query.setKeywordRestriction("Using food to AND title:bank"); //query = query.setKeywordRestriction("Using food to"); //query.setMaxResultLength(1); listDocIDs = apiDR.getDocumentIds(query); System.out.println("Documents Found: " + listDocIDs.size()); } catch (Exception ex1) { ex1.printStackTrace(); return; } int numDocIDs = listDocIDs.size(); int numReadDocs = 0; for (int i = 0; i < numDocIDs; i++) { long docID = listDocIDs.get(i).getDocumentId(); try { KIMDocument kdoc = apiDR.loadDocument(docID); if (kdoc != null) { KIMFeatureMap features = kdoc.getFeatures(); Set featureNames = features.keySet(); for (Iterator it = featureNames.iterator(); it.hasNext();) { String feature = (String) it.next(); if (feature.equals("TIMESTAMP")) { System.out.print(" - " + feature); long timeStamp = (Long) features.get(feature); System.out.println(" : " + new Date(timeStamp)); } else if (feature.equals("TITLE")) { System.out.print(" - " + feature); System.out.println(" : " + features.get(feature)); } else if (feature.equals("CHALLENGE_ID")) { System.out.print(" - " + feature); System.out.println(" : " + Long.parseLong((String)features.get(feature))); } else if (feature.equals("LENS_ID")) { System.out.print(" - " + feature); System.out.println(" : " + Long.parseLong((String)features.get(feature))); } else if (feature.equals("BB_ID")) { System.out.print(" - " + feature); System.out.println(" : " + Long.parseLong((String)features.get(feature))); } } //System.out.println("Document: " + kdoc.getContent()); numReadDocs += 1; } System.out.println(); } catch (Exception ex) { ex.printStackTrace(); //System.out.println(" - " + "Can NOT load a doc with docId=" + docID + "!!!"); continue; } } System.out.println("Documents Successfully Read: " + numReadDocs); } Regards, Naaman Musawwir. _____ From: Boyan Kukushev [mailto:boyan.kukushev at ontotext.com] Sent: Monday, December 13, 2010 10:29 PM To: kim-discussion at ontotext.com Cc: Naaman Musawwir Subject: Re: [Kim-discussion] Help - Search against custom feature Hello, Naaman, We are currently investigating your issue. Please, send sample code to clarify the problem. Thanks! Regards, Boyan On Mon December 13 2010 06:54:13 Naaman Musawwir wrote: > Hello, > > > > I followed the example > http://ontotext.com/kim/doc/KimDocs-3.0-EN/SearchForDocumentsExamples.html > to search documents against some custom document features. It works fine for > default set of features but not for custom features. Do we need to do some > extra work in order to get search work for custom features? > > > > Regards, > > Naaman Musawwir. > > > > -- Boyan Kukushev Senior Software Engineer / Java Developer Ontotext AD @ Sirma Group Corp. _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3312 - Release Date: 12/12/10 -------------- next part -------------- An HTML attachment was scrubbed... URL: From naaman at truemeridian.com Mon Dec 20 01:00:47 2010 From: naaman at truemeridian.com (Naaman Musawwir) Date: Mon, 20 Dec 2010 11:00:47 +0500 Subject: [Kim-discussion] Help - Search against custom feature In-Reply-To: <201012131928.44974.boyan.kukushev@ontotext.com> Message-ID: <7E.16.00366.112FE0D4@cm-omr13> Hello there, did you get chance to have a look at this issue yet? Regards, Naaman Musawwir. _____ From: Boyan Kukushev [mailto:boyan.kukushev at ontotext.com] Sent: Monday, December 13, 2010 10:29 PM To: kim-discussion at ontotext.com Cc: Naaman Musawwir Subject: Re: [Kim-discussion] Help - Search against custom feature Hello, Naaman, We are currently investigating your issue. Please, send sample code to clarify the problem. Thanks! Regards, Boyan On Mon December 13 2010 06:54:13 Naaman Musawwir wrote: > Hello, > > > > I followed the example > http://ontotext.com/kim/doc/KimDocs-3.0-EN/SearchForDocumentsExamples.html > to search documents against some custom document features. It works fine for > default set of features but not for custom features. Do we need to do some > extra work in order to get search work for custom features? > > > > Regards, > > Naaman Musawwir. > > > > -- Boyan Kukushev Senior Software Engineer / Java Developer Ontotext AD @ Sirma Group Corp. _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3312 - Release Date: 12/12/10 -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.alexiev at ontotext.com Mon Dec 20 04:21:18 2010 From: philip.alexiev at ontotext.com (Philip Alexiev @ Ontotext) Date: Mon, 20 Dec 2010 11:21:18 +0200 Subject: [Kim-discussion] Help - Search against custom feature In-Reply-To: <7E.16.00366.112FE0D4@cm-omr13> References: <7E.16.00366.112FE0D4@cm-omr13> Message-ID: Hi Naaman, I will have a look at it now. Greetings, Philip Alexiev Software Engineer, KIM team On Dec 20, 2010, at 8:00 AM, Naaman Musawwir wrote: > Hello there, did you get chance to have a look at this issue yet? > > Regards, > Naaman Musawwir. > From: Boyan Kukushev [mailto:boyan.kukushev at ontotext.com] > Sent: Monday, December 13, 2010 10:29 PM > To: kim-discussion at ontotext.com > Cc: Naaman Musawwir > Subject: Re: [Kim-discussion] Help - Search against custom feature > > Hello, Naaman, > > We are currently investigating your issue. Please, send sample code to clarify the problem. Thanks! > > Regards, > Boyan > > On Mon December 13 2010 06:54:13 Naaman Musawwir wrote: > > Hello, > > > > > > > > I followed the example > > http://ontotext.com/kim/doc/KimDocs-3.0-EN/SearchForDocumentsExamples.html > > to search documents against some custom document features. It works fine for > > default set of features but not for custom features. Do we need to do some > > extra work in order to get search work for custom features? > > > > > > > > Regards, > > > > Naaman Musawwir. > > > > > > > > > > > > -- > Boyan Kukushev > Senior Software Engineer / Java Developer > Ontotext AD @ Sirma Group Corp. > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3312 - Release Date: 12/12/10 > > _______________________________________________ > Kim-discussion mailing list > Kim-discussion at ontotext.com > http://ontotext.com/mailman/listinfo/kim-discussion -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.alexiev at ontotext.com Mon Dec 20 08:44:59 2010 From: philip.alexiev at ontotext.com (Philip Alexiev @ Ontotext) Date: Mon, 20 Dec 2010 15:44:59 +0200 Subject: [Kim-discussion] Help - Search against custom feature In-Reply-To: References: Message-ID: <9AFDD845-C76B-4D8F-8929-7064C58600F7@ontotext.com> Hi Naaman, This question is related to how Lucene creates its indexes. It uses different formatters for different types of fields. So non-string values require special treatment. Lucene is intended to serve as FTS index and query engine, and not a DB, so our wrapper on top of it supports only String literals. You should consider using strings instead of numeric values. Hth Philip Alexiev Software Engineer, KIM team On Dec 13, 2010, at 7:36 PM, Naaman Musawwir wrote: > Hello, thank you. Here is part of the code that I am using for searching. Please notice the lines where I set query restrictions. If I use title:women it returns relevant documents but if I use BB_ID:2 it never returns anything even if many documents exist. The feature BB_ID is there in documents as verified by displaying that in the code. > > static void searchDocuments(DocumentRepositoryAPI apiDR) { > // load documents from persistence > // ---------------------------------------------------------------------------------- > System.out.println("\n\nLoading documents from persistance ..."); > DocumentQueryResult listDocIDs = null; > > // example > DocumentQuery query = new DocumentQuery(); > try { > //query = query.setKeywordRestriction("bb_id:153"); > //query.setKeywordRestriction("lens_id:2"); > //query = query.setKeywordRestriction("Using food to AND title:bank"); > //query = query.setKeywordRestriction("Using food to"); > //query.setMaxResultLength(1); > > listDocIDs = apiDR.getDocumentIds(query); > System.out.println("Documents Found: " + listDocIDs.size()); > } catch (Exception ex1) { > ex1.printStackTrace(); > return; > } > > int numDocIDs = listDocIDs.size(); > int numReadDocs = 0; > for (int i = 0; i < numDocIDs; i++) { > long docID = listDocIDs.get(i).getDocumentId(); > try { > KIMDocument kdoc = apiDR.loadDocument(docID); > if (kdoc != null) { > KIMFeatureMap features = kdoc.getFeatures(); > Set featureNames = features.keySet(); > for (Iterator it = featureNames.iterator(); it.hasNext();) { > String feature = (String) it.next(); > if (feature.equals("TIMESTAMP")) { > System.out.print(" - " + feature); > long timeStamp = (Long) features.get(feature); > System.out.println(" : " + new Date(timeStamp)); > } else if (feature.equals("TITLE")) { > System.out.print(" - " + feature); > System.out.println(" : " + features.get(feature)); > } else if (feature.equals("CHALLENGE_ID")) { > System.out.print(" - " + feature); > System.out.println(" : " + Long.parseLong((String)features.get(feature))); > } else if (feature.equals("LENS_ID")) { > System.out.print(" - " + feature); > System.out.println(" : " + Long.parseLong((String)features.get(feature))); > } else if (feature.equals("BB_ID")) { > System.out.print(" - " + feature); > System.out.println(" : " + Long.parseLong((String)features.get(feature))); > } > } > //System.out.println("Document: " + kdoc.getContent()); > numReadDocs += 1; > } > > System.out.println(); > } catch (Exception ex) { > ex.printStackTrace(); > //System.out.println(" - " + "Can NOT load a doc with docId=" + docID + "!!!"); > continue; > } > } > System.out.println("Documents Successfully Read: " + numReadDocs); > } > > > Regards, > Naaman Musawwir. > From: Boyan Kukushev [mailto:boyan.kukushev at ontotext.com] > Sent: Monday, December 13, 2010 10:29 PM > To: kim-discussion at ontotext.com > Cc: Naaman Musawwir > Subject: Re: [Kim-discussion] Help - Search against custom feature > > Hello, Naaman, > > We are currently investigating your issue. Please, send sample code to clarify the problem. Thanks! > > Regards, > Boyan > > On Mon December 13 2010 06:54:13 Naaman Musawwir wrote: > > Hello, > > > > > > > > I followed the example > > http://ontotext.com/kim/doc/KimDocs-3.0-EN/SearchForDocumentsExamples.html > > to search documents against some custom document features. It works fine for > > default set of features but not for custom features. Do we need to do some > > extra work in order to get search work for custom features? > > > > > > > > Regards, > > > > Naaman Musawwir. > > > > > > > > > > > > -- > Boyan Kukushev > Senior Software Engineer / Java Developer > Ontotext AD @ Sirma Group Corp. > > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1170 / Virus Database: 426/3312 - Release Date: 12/12/10 > > _______________________________________________ > Kim-discussion mailing list > Kim-discussion at ontotext.com > http://ontotext.com/mailman/listinfo/kim-discussion -------------- next part -------------- An HTML attachment was scrubbed... URL: From naaman at truemeridian.com Wed Dec 22 06:54:49 2010 From: naaman at truemeridian.com (Naaman Musawwir) Date: Wed, 22 Dec 2010 16:54:49 +0500 Subject: [Kim-discussion] Help - Search against custom feature In-Reply-To: <9AFDD845-C76B-4D8F-8929-7064C58600F7@ontotext.com> Message-ID: <74.48.30361.B08E11D4@cm-omr10> All right, I tried adding String features and searching against them works fine. Thank you. _____ From: Philip Alexiev @ Ontotext [mailto:philip.alexiev at ontotext.com] Sent: Monday, December 20, 2010 6:45 PM To: Naaman Musawwir Cc: 'Boyan Kukushev'; kim-discussion at ontotext.com Subject: Re: [Kim-discussion] Help - Search against custom feature Hi Naaman, This question is related to how Lucene creates its indexes. It uses different formatters for different types of fields. So non-string values require special treatment. Lucene is intended to serve as FTS index and query engine, and not a DB, so our wrapper on top of it supports only String literals. You should consider using strings instead of numeric values. Hth Philip Alexiev Software Engineer, KIM team On Dec 13, 2010, at 7:36 PM, Naaman Musawwir wrote: Hello, thank you. Here is part of the code that I am using for searching. Please notice the lines where I set query restrictions. If I use title:women it returns relevant documents but if I use BB_ID:2 it never returns anything even if many documents exist. The feature BB_ID is there in documents as verified by displaying that in the code. static void searchDocuments(DocumentRepositoryAPI apiDR) { // load documents from persistence // ---------------------------------------------------------------------------- ------ System.out.println("\n\nLoading documents from persistance ..."); DocumentQueryResult listDocIDs = null; // example DocumentQuery query = new DocumentQuery(); try { //query = query.setKeywordRestriction("bb_id:153"); //query.setKeywordRestriction("lens_id:2"); //query = query.setKeywordRestriction("Using food to AND title:bank"); //query = query.setKeywordRestriction("Using food to"); //query.setMaxResultLength(1); listDocIDs = apiDR.getDocumentIds(query); System.out.println("Documents Found: " + listDocIDs.size()); } catch (Exception ex1) { ex1.printStackTrace(); return; } int numDocIDs = listDocIDs.size(); int numReadDocs = 0; for (int i = 0; i < numDocIDs; i++) { long docID = listDocIDs.get(i).getDocumentId(); try { KIMDocument kdoc = apiDR.loadDocument(docID); if (kdoc != null) { KIMFeatureMap features = kdoc.getFeatures(); Set featureNames = features.keySet(); for (Iterator it = featureNames.iterator(); it.hasNext();) { String feature = (String) it.next(); if (feature.equals("TIMESTAMP")) { System.out.print(" - " + feature); long timeStamp = (Long) features.get(feature); System.out.println(" : " + new Date(timeStamp)); } else if (feature.equals("TITLE")) { System.out.print(" - " + feature); System.out.println(" : " + features.get(feature)); } else if (feature.equals("CHALLENGE_ID")) { System.out.print(" - " + feature); System.out.println(" : " + Long.parseLong((String)features.get(feature))); } else if (feature.equals("LENS_ID")) { System.out.print(" - " + feature); System.out.println(" : " + Long.parseLong((String)features.get(feature))); } else if (feature.equals("BB_ID")) { System.out.print(" - " + feature); System.out.println(" : " + Long.parseLong((String)features.get(feature))); } } //System.out.println("Document: " + kdoc.getContent()); numReadDocs += 1; } System.out.println(); } catch (Exception ex) { ex.printStackTrace(); //System.out.println(" - " + "Can NOT load a doc with docId=" + docID + "!!!"); continue; } } System.out.println("Documents Successfully Read: " + numReadDocs); } Regards, Naaman Musawwir. _____ From: Boyan Kukushev [mailto:boyan.kukushev at ontotext.com] Sent: Monday, December 13, 2010 10:29 PM To: kim-discussion at ontotext.com Cc: Naaman Musawwir Subject: Re: [Kim-discussion] Help - Search against custom feature Hello, Naaman, We are currently investigating your issue. Please, send sample code to clarify the problem. Thanks! Regards, Boyan On Mon December 13 2010 06:54:13 Naaman Musawwir wrote: > Hello, > > > > I followed the example > http://ontotext.com/kim/doc/KimDocs-3.0-EN/SearchForDocumentsExamples.html > to search documents against some custom document features. It works fine for > default set of features but not for custom features. Do we need to do some > extra work in order to get search work for custom features? > > > > Regards, > > Naaman Musawwir. > > > > -- Boyan Kukushev Senior Software Engineer / Java Developer Ontotext AD @ Sirma Group Corp. _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3312 - Release Date: 12/12/10 _______________________________________________ Kim-discussion mailing list Kim-discussion at ontotext.com http://ontotext.com/mailman/listinfo/kim-discussion _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1170 / Virus Database: 426/3326 - Release Date: 12/19/10 -------------- next part -------------- An HTML attachment was scrubbed... URL: From naaman at truemeridian.com Mon Dec 27 10:45:14 2010 From: naaman at truemeridian.com (Naaman Musawwir) Date: Mon, 27 Dec 2010 20:45:14 +0500 Subject: [Kim-discussion] KIM Startup problem Message-ID: Hello, I have noticed that if KIM service is stopped using killall java or the host machine stops abnormally then KIM won't start. It gives the following message: root at isbsvr2:/usr/local/kim-platform-3.0-RC4/bin# ./kim start & [1] 7521 root at isbsvr2:/usr/local/kim-platform-3.0-RC4/bin# KIM_HOME=/usr/local/kim-platform-3.0-RC4 KIM_CONTEXT=/usr/local/kim-platform-3.0-RC4/context/default KIM_MAX_JAVA_HEAP=1g KIM_LOG_FOLDER=/usr/local/kim-platform-3.0-RC4/log [INFO] The KIM Server will be remotely available for RMI connections at 192.168.11.13 [INFO] : : : : : : : : KIM SERVER START : : : : : : : : [INFO] OwlimSchemaRepository: 3.3 [INFO] Build date: 06-22-2010 11:57 [INFO] Configured parameter 'imports' to 'kb/owl/owl.rdfs; kb/owl/protons.owl; kb/owl/protont.owl; kb/owl/protonu.owl; kb/owl/kimso.owl; kb/owl/kimlo.owl; kb/skos-owl1-dl.rdf; kb/wkb.nt; kb/wkbx.nt;' [INFO] Configured parameter 'defaultNS' to 'http://www.w3.org/2002/07/owl#; http://proton.semanticweb.org/2006/05/protons#; http://proton.semanticweb.org/2006/05/protont#; http://proton.semanticweb.org/2006/05/protonu#; http://www.ontotext.com/kim/2006/05/wkb#; http://www.ontotext.com/kim/2006/05/wkb#; http://www.ontotext.com/kim/2006/05/wkb#; http://www.ontotext.com/kim/2006/05/wkb#; http://www.ontotext.com/kim/2006/05/wkb#;' [INFO] Configured parameter 'base-URL' to 'http://www.ontotext.com/kim/2006/05/wkb#' [INFO] Configured parameter 'ruleset' to 'kb/KIMRules.pie' [INFO] Configured parameter 'ftsLiteralsOnly' to 'true' [INFO] Configured parameter 'console-thread' to 'false' [INFO] Configured parameter 'useShutdownHooks' to 'false' [INFO] Configured parameter 'entity-index-size' to '400000' [INFO] Configured parameter 'ftsIndexPolicy' to 'onStartup' [INFO] Tokenization regular expression: [\p{L}\d_]+ [INFO] Repository fragments: 1 [INFO] Inferencer threads: 1 [INFO] ftsPolicy = on-startup [INFO] fts: indexing literals only [INFO] Configured parameter 'tuple-index-memory' to '100M' [INFO] Configured parameter 'fts-memory' to '80M' [INFO] Cache pages for tuples: 5241 [INFO] Cache pages for predicates: 0 [INFO] Cache pages for FTS: 4193 [INFO] Configured parameter 'storage-folder' to 'populated' [INFO] KIMService registered on port 1099 [ERROR] Server Starter thread failed! java.rmi.RemoteException: Error creating repository; nested exception is: java.lang.IllegalArgumentException: Not a valid (absolute) URI: at com.ontotext.kim.semanticrepository.UnmanagedRepositoryFactory.reconnect(Unm anagedRepositoryFactory.java:44) at com.ontotext.kim.KIMServiceImpl.getSemanticRepositoryAPI(KIMServiceImpl.java :228) at com.ontotext.kim.KIMServiceImpl.getSemanticRepositoryAPI(KIMServiceImpl.java :198) at com.ontotext.kim.KIMServiceImpl$ServerComponentStarter.run(KIMServiceImpl.ja va:82) Caused by: java.lang.IllegalArgumentException: Not a valid (absolute) URI: at org.openrdf.model.impl.URIImpl.setURIString(URIImpl.java:68) at org.openrdf.model.impl.URIImpl.(URIImpl.java:57) at com.ontotext.trree.HashEntityPool.toObject(HashEntityPool.java:819) at com.ontotext.trree.HashEntityPool.buildFullTextSearchIndex(HashEntityPool.ja va:1154) at com.ontotext.trree.HashEntityPool.buildFullTextIndex(HashEntityPool.java:154 ) at com.ontotext.trree.HashEntityPool.(HashEntityPool.java:143) at com.ontotext.trree.OwlimSchemaRepository.initialize(OwlimSchemaRepository.ja va:443) at org.openrdf.repository.sail.SailRepository.initialize(SailRepository.java:84 ) at com.ontotext.kim.semanticrepository.UnmanagedRepositoryFactory.reconnect(Unm anagedRepositoryFactory.java:40) ... 3 more [INFO] It is now safe to close the KIM Server. [INFO] KIMService unregistered from port 1099 [INFO] It is now safe to close the KIM Server. [1]+ Done ./kim start I fixed this by deleting all files under context/default/populated and then starting KIM again. Why is it happening and can we fix this issue of abnormal shutdown using some commands? Regards, Naaman Musawwir. -------------- next part -------------- An HTML attachment was scrubbed... URL: