Advertisement
logicmoo

RDFLists

Jun 12th, 2018
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 1.65 KB | None | 0 0
  1. header_sane:  ?- use_module(library(semweb/rdf11),[except([{}/1])]).
  2. true.
  3.  
  4. header_sane:  ?- rdf_retractall(_,_,_),rdf_assert_list([a,b,c], List),forall(rdf(X,Y,Z),writeln(spo(X,Y,Z))).
  5. spo(_:genid26,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://www.w3.org/1999/02/22-rdf-syntax-ns#List)
  6. spo(_:genid26,http://www.w3.org/1999/02/22-rdf-syntax-ns#first,a)
  7. spo(_:genid26,http://www.w3.org/1999/02/22-rdf-syntax-ns#rest,_:genid27)
  8. spo(_:genid27,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://www.w3.org/1999/02/22-rdf-syntax-ns#List)
  9. spo(_:genid27,http://www.w3.org/1999/02/22-rdf-syntax-ns#first,b)
  10. spo(_:genid27,http://www.w3.org/1999/02/22-rdf-syntax-ns#rest,_:genid28)
  11. spo(_:genid28,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://www.w3.org/1999/02/22-rdf-syntax-ns#List)
  12. spo(_:genid28,http://www.w3.org/1999/02/22-rdf-syntax-ns#first,c)
  13. spo(_:genid28,http://www.w3.org/1999/02/22-rdf-syntax-ns#rest,http://www.w3.org/1999/02/22-rdf-syntax-ns#nil)
  14. List = '_:genid26'.
  15.  
  16. header_sane:  ?- rdf_assert_list([a], RDFList).
  17. RDFList = '_:genid29'.
  18.  
  19. header_sane:  ?- rdf_retractall(_,_,_),rdf_assert_list([a], List),forall(rdf(X,Y,Z),writeln(spo(X,Y,Z))).
  20. spo(_:genid30,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://www.w3.org/1999/02/22-rdf-syntax-ns#List)
  21. spo(_:genid30,http://www.w3.org/1999/02/22-rdf-syntax-ns#first,a)
  22. spo(_:genid30,http://www.w3.org/1999/02/22-rdf-syntax-ns#rest,http://www.w3.org/1999/02/22-rdf-syntax-ns#nil)
  23. List = '_:genid30'.
  24.  
  25. header_sane:  ?- rdf_retractall(_,_,_),rdf_assert_list([], List),forall(rdf(X,Y,Z),writeln(spo(X,Y,Z))).
  26. List = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'.
  27.  
  28. header_sane:  ?-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement