Re: error out of global stack prolog
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 01/09/2014 01:59 AM, atom meta wrote:
> Hi, I am currently learning Prolog. when I apply a query such as
> findall(A, rdf(A,_,_), Y), length(Y, L), prolog throws out of global
> stack, error. How could I fix this problem?
You are creating a list with all subjects. If you have a really big
RDF store, that costs a lot of memory. There are some options:
- Raise the stack limit using set_prolog_stack/2.
- Use aggregate_all(count, rdf(_,_,_), Triples).
- Use rdf_statistics(triples(Triples)).
For really counting the triples, the latter is the best (it just
looks up the number that is maintained in the store). In similar
cases you may need to do one of the first two.
Success --- Jan
>
> Thank you,
> Batselem Jagvaral
>
>
>
>
> 2 ?- findall(A, rdf(A,_,_), Y), length(Y, L).ERROR: Out of global stack
> Call: (13) rdf_db:rdf_update_duplicates_thread ? No previous search
> Call: (13) rdf_db:rdf_update_duplicates_thread ? No previous search
> Call: (13) rdf_db:rdf_update_duplicates_thread ? creep
> ^ Call: (14) thread_create(rdf_update_duplicates, _G75, [detached(true),
> alias('__rdf_duplicate_detecter')]) ? creep
> ^ Exit: (14) thread_create(rdf_update_duplicates,
> '__rdf_duplicate_detecter', [detached(true),
> alias('__rdf_duplicate_detecter')]) ?
> Call: (1) rdf_db:rdf_update_duplicates ? creep
> |:
> Exit: (13) rdf_db:rdf_update_duplicates_thread ?
> -------------- next part --------------
> HTML attachment scrubbed and removed
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>