Hi Valentina,

There seems to be a little inconsistency in some of the versions of PROTON. We found about it recently. It is already fixed and will be included in the public version. The problem comes from the fact that the class protonkm:Device is a child of protont:Product, which is not linked to the ontology - it does not subclass directly or indirectly neither protons:Entity nor protons:LexicalResource. You should make sure that the parents of your top classes are indeed linked to those two classes. An easy way to go around this, although not a good practice, is to make your top classes direct children of the Entity class in the PROTON System ontology.

Another thing you should have in mind is that the InstanceGenerator filters all the unneeded (temporary) annotations - that is annotations with type which is not from the Entity hierarchy. This is the list of types which are not filtered :

     "Entity",
     "Organization",
     "Person",
     "Time",
     "Date",
     "Percent",
     "Location",
     "Position",
     "Money",
     "Abstract",
     "ContactInfo",
     "Object",
     "Event",
     "Brand",
     "GeneralTerm",
     "KeyPhrase",
     "KeyPerson",
     "KeyOrganization",
     "KeyLocation"

When the semantic annotation logic is applied over the document content, the gazetteer creates annotations of type Lookup, which are not in the list. Later the InstanceGenerator removes the Lookup annotations. That is the reason you don't see your custom instances. They are recognized as annotations of type Lookup. So in order to keep them you can make a jape rule, which creates an annotation which type is one of the listed. Here is what it may look like:

// R2D2 etc.
Rule:    GazRobot
Priority: 100
(
{Lookup.class == "http://in.space#Robot"}
)
:robotName -->
{
gate.FeatureMap features = Factory.newFeatureMap();
// create an annotation set consisting of all the annotations for robot
gate.AnnotationSet robotSet = (gate.AnnotationSet)bindings.get("robotName");
// if the annotation type Lookup doesn't exist, do nothing
if (robotSet != null && robotSet.size()>0)
{
// if it does exist, take the first element in the set
 gate.Annotation robotAnn = (gate.Annotation)robotSet.iterator().next();

 features.put("class",robotAnn.getFeatures().get("class"));
 String inst =(String) robotAnn.getFeatures().get("inst");

 if ( inst != null )
   features.put("inst",inst);
}
// create some new features
 features.put("rule", "GazRobot");
annotations.add(robotSet.firstNode(), robotSet.lastNode(), "Object", features); }

You should do that for each of your classes in order to save the annotations with these classes in the document repository.

All the best,
Philip




Valentina De Vivo wrote:
Hi All,
now KIM recognizes my instances only if I use the Specific Annotation Strategy RUNNING_STRATEGY_DISABLE_INSTANCE_GENERATOR (KIM doesn't recognize my instances for any other strategy) I don't know why........
While in KIM web UI all my instances are recognized however...

But I can not find this strategy useful... In the output for all my instances I wolud like to know "original name" feature of annotation. How can I do?
Good weekend to all,
Valentina

_______________________________________________
Kim-discussion mailing list
Kim-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/kim-discussion


_______________________________________________
Kim-discussion mailing list
Kim-discussion@ontotext.com
http://ontotext.com/mailman/listinfo/kim-discussion

Reply via email to