Hi, I tried to do it this way:
This is the list:
getListaTestimoniUdienza(ListaTestimone):-
findall(Y,testimonePartecipaudienza(Y,X),ListaTestimone).
?- getListaTestimoniUdienza(ListaTestimone).
ListaTestimone = [
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Pippo_Testimone',
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Pippo_Testimone',
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Sempronio_Testimone',
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#TestimoneB',
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Pippo_Testimone',
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Pippo_Testimone',
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#Sempronio_Testimone',
'http://www.semanticweb.org/luigi/ontologies/2020/2/untitled-ontology-11#TestimoneB'
].
I’m trying to use this rule, but I can’t replace the various values:
count(_,[],0).
count(X,[X|T],N):-!,count(X,T,N1), N is N1+1.
count(X,[_|T],N):-count(X,T,N).