Menu

#1 Counting annotations with empty slots

open
5
2006-09-10
2006-09-10
No

Can someone post a recipe for searching for empty
slots? I am now looking for them manually, which
requires having the text source files open. Since I
have almost a thousand slot-bearing annotations and
they are distributed across ten different files text
source files, it is no fun....

Discussion

  • Philip Ogren

    Philip Ogren - 2006-09-10
     
  • Philip Ogren

    Philip Ogren - 2006-09-10

    Logged In: YES
    user_id=1052182

    I am attaching a file called CountEmptySlots that takes
    three arguments:
    1) the full path of your annotation/protege project (i.e. a
    file that ends with .pprj)
    2) the name of the class of annotations you are counting
    (e.g. Inhibit)
    3) the name of the slot (e.g. Inhibitee)

    Arguments with spaces should be quoted

    The jar files protege.jar and knowtator.jar must be on your
    classpath to run/compile.

    Example output is:
    empty slot found for:<inhibition> at text source:
    36_source_file_953_35195.src
    empty slot found for:<inhibition> at text source:
    25_source_file_974_35203.src
    ############################################################
    empty slots found for class <Inhibit> and slot <Inhibitee> is: 2

     
  • Philip Ogren

    Philip Ogren - 2006-09-10

    Logged In: YES
    user_id=1052182

    There is one caveat I forgot. Annotations do not really
    have "empty slots". They just look like they do because if
    an annotation does not have a slot, then I provide an "empty
    slot value" when the annotation is selected. These are
    removed when a different annotation is selected. The bottom
    line is this, select an annotation that has either no slots
    or no "empty slots", and then save your project. This will
    ensure that no "empty slots" are counted. This is probably
    confusing....

     

Log in to post a comment.