rdf - Getting SWI-Prolog to convert Literal to number -
it quite miracle if following...
i'm using swi-prolog perform queries in triples rdf file. values can queried, instead of number, word literal shows in front of them (e.g [literal(500000)] shows value 500000). now, problem arises when have list of numbers want add. try convert these literals atoms prolog can recognize them numbers, following error
error: atom_number/2: type error: atom' expected, found [literal(500000)]'
any clues appreciated. thanks.
just use unification number. instance
?- [literal(500000)] = [literal(n)]. n = 500000.
Comments
Post a Comment