Subject: Re: [rfc-i] An RFC database in Prolog

From: Marc Petit-Huguenin <[email-masked]>
Date: Mon, 13 Sep 2021 05:31:48 -0700

FWIW the rfc-prolog git repo was just updated with a new Prolog table containing the references for RFCs 4001 and up.  References in RFCs lower than 4000 are less consistent, so it'll take more work to extract the references from these.  The classification of references (i-d, iso, itu-t and so on) will also improve as I improve my scripts.

On 8/27/21 6:06 AM, Marc Petit-Huguenin wrote:
> On 8/27/21 4:32 AM, Marc Petit-Huguenin wrote:
>> On 8/27/21 4:14 AM, Michael Richardson wrote:
>>> Marc Petit-Huguenin <[email-masked]> wrote:
>>>      > I have been working on a Prolog database that would permit to do
>>>      > various queries on RFC metadata and on Errata.
>>>
>>> Can you give us some examples to wet our appetite?
>>
>> Here's one that exports the errata database as a CSV file:
>>
>> [source,prolog]
>> ----
>> :- import format/2 from format.
>> :- [errata].
>> :- [rfcs].
>>
>> month(1, 'January').
>> month(2, 'February').
>> month(3, 'March').
>> month(4, 'April').
>> month(5, 'May').
>> month(6, 'June').
>> month(7, 'July').
>> month(8, 'August').
>> month(9, 'September').
>> month(10, 'October').
>> month(11, 'November').
>> month(12, 'December').
>>
>> :- erratum(Id, Formats, Rfc, Reporter, Date, Type, Status),
>>     rfc(Rfc, Title, _, _, _, date(Y, M), Wg, Area, _),
>>     month(M, MM),
>>     functor(Status, S, _),
>>     format("\"RFC~d\", \"~a\", \"~a ~d\", \"~a\"~n", [Rfc, Title, MM, Y, S]),
>>     fail.
>> ----
>>
>> Another that lists all the RFCs that changed status:
>>
>> [source,prolog]
>> ----
>> :- import format/2 from format.
>> :- [metadata].
>> :- [rfcs].
>>
>> :- rfc(Rfc, Title, _, Status, _, _, _, _, _),
>>     metadatum(Rfc, Status2), Status \= Status2,
>>     format("RFC~d ~a from ~a to ~a~n", [Rfc, Title, Status, Status2]),
>>     fail.
>> ----
>>
>> Just copy the one of the content above (between the "----") in a file with the ".P" extension, then you just have to `xsb <file>` (without the .P extension) to run it.
>>
> 
> Do it again! Do it again!
> 
> OK.  What is the longest obsolescence chain of RFCs?
> 
> [source,prolog]
> ----
> :- import format/2 from format.
> :- import length/2 from basics.
> :- import concat_atom/3 from string.
> :- [metadata].
> :- [rfcs].
> 
> chain(Rfc, List) :-
>    obsoletes(Rfc, Prev),
>    chain(Prev, L),
>    List = [Rfc|L].
> chain(Rfc, [Rfc]).
> 
> chains(Length - Chain) :-
>    rfc(Rfc, _, _, _, _, _, _, _, _),
>    chain(Rfc, List),
>    length(List, Length),
>    concat_atom(List, ' ', Chain).
> 
> print_chains([]).
> print_chains([_ - L|Xs]) :-
>    writeln(L),
>    print_chains(Xs).
> :-
>    findall(X, chains(X), List),
>    keysort(List, Sorted),
>    print_chains(Sorted).
> ----
> 

-- 
Marc Petit-Huguenin
Email: [email-masked]
Blog: https://marc.petit-huguenin.org
Profile: https://www.linkedin.com/in/petithug
_______________________________________________
rfc-interest mailing list
[email-masked]
https://www.rfc-editor.org/mailman/listinfo/rfc-interest

---

From: Marc Petit-Huguenin <[email-masked]>
Date: Thu, 16 Sep 2021 11:16:17 -0700

Can you please explain how this is related to the email you responded to?

Thanks.

On 9/16/21 11:08 AM, Bosubabu wrote:
> When I submit the XML file to submission for RFC, the below error is shown,
> Please resolve this issue.
> 
> 
> On Mon, Sep 13, 2021 at 6:02 PM Marc Petit-Huguenin <[email-masked]>
> wrote:
> 
>> FWIW the rfc-prolog git repo was just updated with a new Prolog table
>> containing the references for RFCs 4001 and up.  References in RFCs lower
>> than 4000 are less consistent, so it'll take more work to extract the
>> references from these.  The classification of references (i-d, iso, itu-t
>> and so on) will also improve as I improve my scripts.
>>
>>>>>       > I have been working on a Prolog database that would permit to do
>>>>>       > various queries on RFC metadata and on Errata.
>>>>>
>>>> Just copy the one of the content above (between the "----") in a file
>> with the ".P" extension, then you just have to `xsb <file>` (without the .P
>> extension) to run it.
>>>>
>>>

---

From: Bosubabu <[email-masked]>
Date: Thu, 16 Sep 2021 23:38:33 +0530

-- 

    *S. Bosubabu*   MCA, M.Tech, AMIE, (Ph.D.), PGDCC, Patents, ©, ®

      Scientist - Innovator, Author

      Assistant Professor, CSE Dept,

      Raghu Engineering College (A), Visakhapatnam, JNTU Kakinada

      Editor-In-Chief, IJRDES <http://www.ijrdes.com/index.php>

      + 91 9640641136

      https://www.bosubabu.com/

---

From: Marc Petit-Huguenin <[email-masked]>
Date: Fri, 17 Sep 2021 09:39:15 -0700

> Please resolve this issue.

No.

---

From: Roger Price <[email-masked]>
Date: Fri, 17 Sep 2021 22:05:06 +0200 (CEST)

On Thu, 16 Sep 2021, Bosubabu wrote:

> When I submit the XML file to submission for RFC, the below error is shown, Please resolve this issue.
> problem.jpg

Your problem is your own broken XML.  Nothing to do with Prolog.  Start by 
learning about XML entity declarations

  https://www.w3schools.com/xml/xml_dtd_entities.asp
  https://www.xml.com/pub/a/98/08/xmlqna2.html

Stop sending huge images to mailing lists when a text would do.

Roger