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

Modification problem #17

Open
hmqq opened this issue Jan 10, 2022 · 1 comment
Open

Modification problem #17

hmqq opened this issue Jan 10, 2022 · 1 comment

Comments

@hmqq
Copy link

hmqq commented Jan 10, 2022

I have an ontology, where i have a role "headOfDepartment" with a domain "HOD". I want to add additional fact in ontology like

instr("headOfDepartment","P2","Dep2").
delta(qalt,addop("ont:headOfDepartment",A,B)) :- instr("headOfDepartment",A,B).

instc("Department",X) :- &dlCroonto,"ont:Department".
instr("headOfDepartment",Y,X) :- &dlOProonto,"ont:headOfDepartment".
instc("HOD",Y) :- &dlCroonto,"ont:HOD".

modifications(qalt).

result(Y,X) :- instc("Department",X),instr("headOfDepartment",Y,X),instc("HOD",Y).

#show result/2.

and I want to retrieve all the objects in HOD, who are head of some department. But this program show me only the objects from ontology and does not show instr("headOfDepartment","P2","P1").

How can I retrieve the facts from hex-file along with the ontology assertions?

ontologyfile.txt
rulefile.txt
WA-meta.txt

@peschue
Copy link
Member

peschue commented Feb 27, 2022

I am sorry that it took so long to reply, I have been very busy recently.

The command #show result/2. indicates that only atoms of the form result(X,Y) with some substituted constant for X and Y should be shown.

Internally, all atoms are computed, but only the specified ones are shown.

To also see instr with 3 arguments you need to also add #show instr/3. to the program.

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