Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set rules #11

Open
DionysiaV opened this issue Mar 4, 2022 · 5 comments
Open

set rules #11

DionysiaV opened this issue Mar 4, 2022 · 5 comments

Comments

@DionysiaV
Copy link

Hello, could I ask you if it is possible to set some rules and according to these rules the reasonable reasoner can decide stuff? Like the hermit reasoner??

@gtfierro
Copy link
Owner

gtfierro commented Mar 4, 2022

Hi @DionysiaV ! I'm not super familiar with the Hermit reasoner, but in reasonable all of the rules are hardcoded into the binary (see this terribly long method)

@DionysiaV
Copy link
Author

DionysiaV commented Mar 7, 2022

Hi @gtfierro... Well maybe I should explain to you what I want to do, cause I am not sure that I completely understand this terribly long method :)...

So, I want to create a test, in which I can access a sub-class. And then if this sub-class exists then I can call a function or print something..

What do you think?

I would also like to ask you one more thing... I can only load .n3 files?? And how can I generate .n3 files?
Do you think that it would be possible to extract a .n3 file from the protégé app???

Thankssss

@gtfierro
Copy link
Owner

gtfierro commented Mar 7, 2022

N-triples (n3) is one of the common serialization formats for RDF graphs; you should be able to change the reasonable source code to import from a different format if you need (the parsing library should support most common ones), or you can export n-triples from protege.

If I understand your intended task, then could you not run the existing reasoner and then query the resulting graph for the subclass or instances of the subclass? Or do you want the reasoner to execute custom logic when certain conditions are met during the evaluation process?

@DionysiaV
Copy link
Author

DionysiaV commented Mar 8, 2022

Hello again,

  • Well for exporting the n-triples from protege is not possible, because in the protege 5.5 I do not have the n-triples option.. But I am now downloading older versions of protege to see if it is possible to export the n-triples file...

so, in no previous version of protege I have the option of exporting it in n-triples.. But, I saved the file as turtle, and since protege gives the default extension of .owl, I just changed the extension of the file to .ttl and it works... So it is ok no need to reply for this..

  • For modifying the source code for accepting .owl file (owl/xml syntax), how can I do it??

no need any more cause I will use the .ttl file

  • For my intended task, right now I run the existing reasoner and then I query instances of the subclass, however I would like to see if it is possible for the reasoner to execute custom logic when certain conditions are met during the evaluation process and maybe print a response or an outcome to this.....

What do you think??

@gtfierro
Copy link
Owner

gtfierro commented Mar 8, 2022

If you use the Python bindings then you can use RDFlib to load a graph from whatever import format you want and then provide it to the reasoner. If you are running reasonable as a Rust library then you may want to look at this method

I think it would be somewhat complex to execute custom logic during the evaluation process. If you can avoid doing so, I would recommend it. During the evaluation process there may be certain conditions that will become true later that will invalidate your logic. For example, an instance may be inferred to be members of two disjoint classes --- at an intermediate stage of evaluation, you may believe it is only an instance of one of those classes. As long as your conditions are monotonic, then you should be ok. However, there is no "easy" way to add these custom hooks other than editing the large method I linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants