Giter Site home page Giter Site logo

koreografeye's People

Contributors

dependabot[bot] avatar jeswr avatar phochste avatar woutermont avatar woutslabbinck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

koreografeye's Issues

Policy extractor code loops for every policy parameter

https://github.com/eyereasoner/Koreografeye/blob/main/src/policy/Extractor.ts#L46

Take policy:

    ex:MySendNotificationDemo pol:policy [
        a fno:Execution ;
        fno:executes ex:sendNotification ;
        ex:to <http://patrickhochstenbach.net/inbox/> ;
        ex:notification [
                a as:Accept ;
                as:inReplyTo ?id ;
                as:actor     <http://patrickhochstenbach.net/profile/card#me> ;
                as:origin    <http://patrickhochstenbach.net/orchestrator/profile/card#me> ;
                as:target    ?actor;
                as:object    ?id
        ]
    ] .

The ex:sendNotification as two parameters ex:to and ex:notification this means that block L46 is executed two times. Refactor this into one loop.

Policy IPolicyType arguments can only be one RDF Term

args: { // Name/Value pairs of policy arguments
[key : string]: RDF.Term | undefined
}

Due to the IPolicyType type having for the arguments only the possibility to have an RDF.Term with cardinality one, the extractPolicies algorithm will pick a random RDF.Term for the arguments where in the conclusion of an N3 rule where this cardinality was N.

My proposal is to fix this by introducing a breaking change that will fix this problem:

export type IPolicyType = {
    node: N3.NamedNode | N3.BlankNode;
    path: string;
    policy: string;
    target: string;
    mainSubject: string;
    origin: string;
    order: number;
    args: {
        [key: string]: RDF.Term[];
    };
};

For this, extractPolicies must also be changed to make it possible to add a list of RDF.Term[].

Furthermore, there will be no undefined anymore since it can now have the empty list.

Refactor out the ComponentsManager?

Aparently the building and registration of the ComponentsManager has some overhead. It could be a future refactor step to move this to a higher level. When we eventually need a Koreagrafeye that need to have multiple runs of the reasoner this could remove some of this overhead.

https://github.com/eyereasoner/Koreografeye/blob/main/src/orchestrator/Reason.ts#L19

These lines:

const manager = await ComponentsManager.build({
    mainModulePath: path.join(__dirname, '../..') , // Path to your npm package's root
 });

 await manager.configRegistry.register(componentsPath);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.