Home > Archive > Prolog > November 2005 > database use in SWI-Prolog
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
database use in SWI-Prolog
|
|
| Menno van Barneveld 2005-11-23, 7:00 pm |
| Hello all,
I have a problem using two types of data in the database.
Start is a text from the Gr New Testament with the copiing failures, for
example Apocalyps 13:18 :
wde h sofia estin. o ecwn [*|tou] noun yhfisatw ton ariqmon tou qhriou,
[ariqmos|ariqmon] gar anqrwpou estin[, [kai|*] o ariqmos autou|*] [*|estin]
[exakosioi exhkonta ex|exakosiai deka ex|exakosia exhkonta ex|cxV].
At first I import the text into a node network with branches containing
lists of characters and put them in the database with
recordz(zin, tekst(Node0, WoordL, NodeX))
I have no problems to find any branch by node number or by Ref, so I can put
any variant of the text together and do computations to discriminate between
mistakes and original text.
But the text is to long to do depth first search, so I start with a branch,
do computations on the variants and safe the results in the database with
flag(refmin, Oud, Oud + 1),
\+recordz(Oud, traject(Spmin1, Node1, Reflijst1, Waardenlijst1,
Waarderest1, Nrest1)
Spmin1 is the result of the computation that I need for the discrimination.
Then I want to continue with the record with the lowest Spmin1, with
recorded(Ni, traject(Spmin, Node0, Reflijst0, Waardenlijst0, Waarderest0,
Nrest0), Refmin),
but what for clauses I try to use does not mather, I only get the last
record instead of the record with the lowest Spmin.
Can anybody tell me what can be the case here?
Greatings,
Menno van Barneveld.
| |
| Jan Wielemaker 2005-11-24, 7:57 am |
| On 2005-11-23, Menno van Barneveld <g.van.barneveld@hccnet.nl> wrote:
> Hello all,
>
> I have a problem using two types of data in the database.
> Start is a text from the Gr New Testament with the copiing failures, for
> example Apocalyps 13:18 :
> wde h sofia estin. o ecwn [*|tou] noun yhfisatw ton ariqmon tou qhriou,
> [ariqmos|ariqmon] gar anqrwpou estin[, [kai|*] o ariqmos autou|*] [*|estin]
> [exakosioi exhkonta ex|exakosiai deka ex|exakosia exhkonta ex|cxV].
> At first I import the text into a node network with branches containing
> lists of characters and put them in the database with
> recordz(zin, tekst(Node0, WoordL, NodeX))
> I have no problems to find any branch by node number or by Ref, so I can put
> any variant of the text together and do computations to discriminate between
> mistakes and original text.
> But the text is to long to do depth first search, so I start with a branch,
> do computations on the variants and safe the results in the database with
> flag(refmin, Oud, Oud + 1),
> \+recordz(Oud, traject(Spmin1, Node1, Reflijst1, Waardenlijst1,
> Waarderest1, Nrest1)
> Spmin1 is the result of the computation that I need for the discrimination.
> Then I want to continue with the record with the lowest Spmin1, with
> recorded(Ni, traject(Spmin, Node0, Reflijst0, Waardenlijst0, Waarderest0,
> Nrest0), Refmin),
> but what for clauses I try to use does not mather, I only get the last
> record instead of the record with the lowest Spmin.
> Can anybody tell me what can be the case here?
> Greatings,
I must say it is a bit difficult to read the combination of scrambled
gr , english and dutch :-). Anyway, first of all, do not use record
and friends. It is old stuff that only exists for compatibility.
Using dynamic predicates makes life a bit better. If we are talking
a tree, better create a tree structure as a data term. If you need
global access to it you can use global variables (nb_setval/2).
Without any code it is hard to say why exactly your query is failing.
Try querying more general queries from the commandline to see whether
the database contains what you think it doens.
--- Jan
|
|
|
|
|