KR 2024 homework part 1: erinevus redaktsioonide vahel

Allikas: Lambda
Mine navigeerimisribale Mine otsikasti
Uus lehekülg: 'You will have to write a small program to convert/filter data to a suitable format for experimenting with a logical reasoner, and then write ca 10 nontrivial rules for answering...'
 
16. rida: 16. rida:
     triple("yago:Lake_Peipsi","rdf:type","yago:Lake").
     triple("yago:Lake_Peipsi","rdf:type","yago:Lake").


The di
The predicate <i>triple</i> is really arbitrary: you may use any name you like. You may also use the fourth argument for type, if you wish (like "string" in the case above). Importantly, there are subtle differences between writing constants like <i>yago:Lake_Peipsi</i> with or without quotation marks:
* Without quotation the reasoner does not assume that two different constants necessarily mean different objects. Saying <i>yago:Lake_Peipsi = yago:Lake_Peipus</i> does not lead to a contradiction. Also, non-ascii symbols are generally not ok for non-quoted constants.
* Quotation marks make the reasoner to treat constants as strings, and thus <i>"yago:Lake_Peipsi" = "yago:Lake_Peipus"</i> is a contradiction. Also, non-ascii symbols are OK.
 
= Rules and questions ==
 
The best way to try out rules and questions is to use http://logictools.org for quick experiments along with small selections of data. For example, try
 
  triple("yago:Lake_Peipsi","rdf:type","yago:Lake").
  triple("yago:Võrtsjärv","rdf:type","yago:Lake").
  triple(X,Y,"yago:Lake") => $ans(X).
 
and you should get a single answer along with the trivial proof. To get more answers, click the "Advanced" button and copy { "max_answers": 2} into the strategy box. Beware that in case you ask for more answers than there really are, the reasoner may just keeping looking for more, eventually timeouting, and not giving any answers at all.

Redaktsioon: 12. veebruar 2024, kell 14:25

You will have to write a small program to convert/filter data to a suitable format for experimenting with a logical reasoner, and then write ca 10 nontrivial rules for answering questions. Finally, experiment with the reasoner on this data + rules and make a small presentation of your data, rules, successes and failures.

Not everything you try out needs to work: some failures are also interesting.

Data

Riina took the large datasets from https://yago-knowledge.org/ and prepared relatively small selections (all about something Estonian) from this data. The link to the files is here. The data is presented as plain triplets, no fancy encoding (except namespaces) are involved.

First, please download the files and explore them a bit. Then convert the files to the format our reasoner gk (or its web version http://logictools.org) can eat.

For example, the triplet

   yago:Lake_Peipsi	rdf:type	yago:Lake

can be converted to

   triple(yago:Lake_Peipsi,rdf:type,yago:Lake).

or with the quotation marks

   triple("yago:Lake_Peipsi","rdf:type","yago:Lake").

The predicate triple is really arbitrary: you may use any name you like. You may also use the fourth argument for type, if you wish (like "string" in the case above). Importantly, there are subtle differences between writing constants like yago:Lake_Peipsi with or without quotation marks:

  • Without quotation the reasoner does not assume that two different constants necessarily mean different objects. Saying yago:Lake_Peipsi = yago:Lake_Peipus does not lead to a contradiction. Also, non-ascii symbols are generally not ok for non-quoted constants.
  • Quotation marks make the reasoner to treat constants as strings, and thus "yago:Lake_Peipsi" = "yago:Lake_Peipus" is a contradiction. Also, non-ascii symbols are OK.

Rules and questions =

The best way to try out rules and questions is to use http://logictools.org for quick experiments along with small selections of data. For example, try

 triple("yago:Lake_Peipsi","rdf:type","yago:Lake").
 triple("yago:Võrtsjärv","rdf:type","yago:Lake").
 triple(X,Y,"yago:Lake") => $ans(X).

and you should get a single answer along with the trivial proof. To get more answers, click the "Advanced" button and copy { "max_answers": 2} into the strategy box. Beware that in case you ask for more answers than there really are, the reasoner may just keeping looking for more, eventually timeouting, and not giving any answers at all.