Subject: Re: about using assert_list in parsing RDF

From: Jan Wielemaker <[email-masked]>
Date: Tue, 12 Sep 2000 13:25:47 +0200

Cecilia,

[ first of all, please break long lines in messages to the list!
]

On Tue, 12 Sep 2000, Cecilia Wong wrote:

>    I am trying to use the RDF parser to parse a rdf file which is quite long.  I have managed to get rid of any error message, that I supposed to be successfully parsed my data. However, the returning triple list is truncated with something like, "rdf(..., ..., ...)|...] at the end of the list. Does anyone have an idea how can I redirect the resulting triples list into another text file?  Can the example,
>"assert_list([]).
>assert_list([H|T]) :-
> assert(H),
> assert_list(T)."
>be used in my case. Sorry, I am just getting started with it and I'm not so familiarized with Prolog. So, I am not sure if I can make use with the example to deal with my problem and where to put into those lines of the example?  Thank you very much in advance!

This is caused by the depth-limit of write_term/3 used to print answer
by the toplevel.  To print the tripples, use something like:

print_triples(Triples, File) :-
	open(File, write, Out),
	print_to_stream(Triples, Out),
	close(Out).

print_to_stream([], _).
print_to_stream([H|T], Out) :-
	format('~q.~n', [H]),
	print_to_stream(T, Out).

	Regards --- Jan