Query Language

Granthika’s search engine supports the following semantic elements:

  • literal: Text enclosed in double quotation marks, such as “pipe,” “Sherlock Holmes,” “he was excited.”

  • type: The types defined in Granthika’s ontology are: character, location, object, and event.

  • individual: An instance of a type is an individual. Sherlock Holmes is an individual of the type character.

  • data-property: A relationship between a type and a literal. The query characters containing “Sherlock” uses the data-property contains to find all characters which have the string “Sherlock” in their names, and similarly scenes containing “Sherlock” finds all scenes with the string “Sherlock” within their text.

  • object-property: A relationship between a type and an individual or two individuals. The currently defined object-properties are is-participant, is-sub-event, have-location, and depicts. These allow queries such as events with participant Sherlock Holmes.

  • All discourse elements are represented by the term Discourse. Manuscript is the top-level discourse element.

The following semantic patterns are recognized by Granthika’s search engine:

  • literal only: Queries such as “agonized letters” and “no fear”. The search engine looks for the single word entered, or (if entered) a phrase, and–in the latter case–if there are no results, falls back to searching for individual words within the search term. The results will list discourse elements that contain the matches found and highlights the occurrences of the entered search term.

  • type only: Will find all the individuals of the given type. So event or events will find all events like “Watson Writes Memoirs.”

  • individual only: Will find individuals that have the entered name. So Holmes will find “Sherlock Holmes” (a character) and “Holmes in Practise” (an event), and office will find “Sherlock’s Office” (a location).

  • type object-property individual: Will find all individuals from the given type which have the relationship specified by the given object-property with the individual. So events with participant Sherlock Holmes will find all events that have Sherlock Holmes as a participant, and characters mentioned Chapter 2 will find all characters that are mentioned in Chapter 2.

  • object-property invidual: Works like type object-property individual, but will infer the type of the individual. So have location office infers that you are looking for events, and will find all events that have Sherlock’s Office as a location. Similarly, mentions Holmes infers that you are looking for all discourse elements that mention Sherlock Holmes. mentioned by Chapter 1 will infer that you are looking for any story element mentioned within Chapter 1.

  • type data-property literal: Will find individuals from the given type that have the relationship specified by the data-property with the given literal. So characters containing “Ronder” will find all characters that have the string “Ronder” in their name (Mr. Ronder and Mrs. Ronder).

  • object-property alone: Finds all individuals that engage in a relationship via the given object-property. So participants will find all characters who participate in any events, and depicting will find all discourse elements that depict any events.

  • data-property literal: This works like type data-property literal, but looks for any individual, disregarding its type. So contain “pipe” will find any discourse element that contains “pipe” within its text.

  • individual object-property: Finds all individuals which are objects for the given object-property. So Holmes in Practise participant will find all the characters who participate in the event “Holmes in Practise,” and “Allahabad locate” will find all the events that have Allahabad as a location.

Last updated