comunica / comunica-feature-reasoning

📬 Comunica packages for reasoning during query execution
MIT License
5 stars 5 forks source link

Thoughts on rule specification actors #22

Open jeswr opened 2 years ago

jeswr commented 2 years ago

So far - we don't have a very clean way of handling different sets of rule types within our reasoning components; and instead have an architecture in which we assume that each actor includes whatever rule tests it needs to in its test method.

It may be worth considering the use of an architecture similar to that of the parse actors which are able to handle specific file types.

For instance I'm thinking that an optimization actor would look something like:

export class ActorRuleOptimizeX extends ActorRuleOptimize {
  /**
   * @param args -
   *   \ @defaultNested {[
   *       "premise-conlusion",
   *      "RDFS"
   *     ]} handledRules
   */
  public constructor(args: ...) {
    super(args);
  }

  public async runHandle(action: ..., ...): Promise<...> {
    ...
  }
}

Long term it would be useful to also have an RDF configuration file that defines subset inclusion of rule types; for instance

premise-conlusion subsetOf RDFS

and hence the JSDoc config from above would become

  /**
   * @param args -
   *   \ @defaultNested {"RDFS"} handledRules
   */