Trying to save rdf triples to a file using the semweb package in swi-prolog, but keep getting an error and the triples are not saved correctly.
The following small code shows the problem with swi-prolog version 7.6.4 on Ubuntu Bionic.
PS: Please ignore the 'rdf:xyz' predicate as I tend to use it without needing to add new prefixes
:- use_module(library(semweb/rdf_db)).
assert_test :-
rdf_bnode(Node),
rdf_assert(Node, rdf:xyz, literal(type(xsd:string, "foobar"))),
rdf_save('foo.xml').
I get the following error (showing top lines only):
ERROR: Unknown error term: save_attribute_value("foobar")
ERROR: In:
ERROR: [25] throw(error(save_attribute_value("foobar"),_980))
.
.
.
The file is created, but does not have the full triple.
An interesting side note, it works if I use rdf_save_turtle
instead of rdf_save
. Any help is appreciated.
rdf_assert(Node, rdf:xyz, literal(type(xsd:string, foobar)))
or perhaps using justliteral(foobar)
orliteral(lang(en, foobar))
. - Daniel Lyonsrdf_save_turtle
works with the string. Not sure how I can accept a comment as an answer...If you could convert that into an official answer I can try and accept it :) - stan_plogic