# $Id: GenHeaderRegistry.rep,v 1.6 2004/10/20 15:09:49 graham Exp $ # # Copyright (c) 2004, G. KLYNE. All rights reserved. # See end of this file for licence information. #--------+---------+---------+---------+---------+---------+---------+---------+ # # Message header registry generator: report description # # Uses to create an RDF-based description, subsequently used by N3Report # query and report generation software to generate registry data files. # #--------+---------+---------+---------+---------+---------+---------+---------+ ## Changes: ## ## hrep:HdrDetailPattern: allow doc section on header specification ## ## hrep:HdrProtoPattern: include hdr:xref value for target document reference ## (NOTE: RFC2XML target documents must be defined in including document source) ## ## hrep:HdrDetailPattern: include hdr:xref and hdr:label values for creating ## target document description and reference. ## (NOTE: RFC2XML target documents must be defined in including document source) ## ## hrep:XmlEntry1: change output format so that ## (a) protocol name cites reference, if defined; ## (b) don't include protocol document URI. @prefix rdf: . @prefix rdfs: . @prefix foaf: . @prefix hdr: . @prefix hrep: . #### top-level report structure #### @report hrep:GenHeaders IFDEF ?htmlname DO hrep:HtmlReport END IFDEF ?xmlname DO hrep:XmlReport END END @report hrep:HtmlReport OPEN "t" (?path "/" ?htmlname ) WRITE "t" hrep:TableHead FOREACH hrep:HdrProtoPattern WRITE "t" hrep:TableItem IFDEF ?entries IFMATCH hrep:HdrDetailPattern OPEN "e" (?path "/" ?pname "/" ?name ".html") DO hrep:HtmlEntry CLOSE "e" ELSE WRITE "t" hrep:NoDetail END END ELSE WRITE "t" hrep:TableEmpty END WRITE "t" hrep:TableFoot CLOSE "t" END @report hrep:HtmlEntry WRITE "e" hrep:HdrEntry1 FOREACH hrep:HdrControllerPattern WRITE "e" hrep:HdrEntryAuthor SEPARATOR WRITE "e" hrep:HdrEntryAuthorSep ELSE FOREACH hrep:HdrAuthorPattern WRITE "e" hrep:HdrEntryAuthor SEPARATOR WRITE "e" hrep:HdrEntryAuthorSep END END WRITE "e" hrep:HdrEntry3 END @report hrep:XmlReport OPEN "x" (?path "/" ?xmlname ) WRITE "x" hrep:XmlTableHead FOREACH hrep:HdrProtoPattern WRITE "x" hrep:XmlTableItem ELSE WRITE "x" hrep:XmlTableEmpty END WRITE "x" hrep:XmlTableFoot FOREACH hrep:HdrProtoPattern DEBUG ("Processing " ?name) IFMATCH hrep:HdrDetailPattern DO hrep:XmlEntry END END CLOSE "x" END @report hrep:XmlEntry WRITE "x" hrep:XmlEntry1 FOREACH hrep:HdrControllerPattern WRITE "x" hrep:XmlEntryAuthor SEPARATOR WRITE "x" hrep:XmlEntryAuthorSep ELSE FOREACH hrep:HdrAuthorPattern WRITE "x" hrep:XmlEntryAuthor SEPARATOR WRITE "x" hrep:XmlEntryAuthorSep END END WRITE "x" hrep:XmlEntry3 END #### query patterns #### # General header field info @query hrep:HdrProtoPattern ( ?header ( rdf:type hdr:HeaderField & hdr:fieldName ?name & hdr:status ?status & [ hdr:label ?purpose ] & hdr:protocol ?p ( hdr:protocolName ?pname & hdr:specification ?ps ( hdr:document ?psdocument & hdr:xref ?psxref ) ) ) ) # Detail header field info (augments basic header data) # Note: some optional sections below are for diagnostic purposes @query hrep:HdrDetailPattern ( ?header ( [ hdr:section ?hssection ] & hdr:specification ?hs ( hdr:document ?hsdocument & [ hdr:label ?hslabel ] & [ hdr:xref ?hsxref ] & [ hdr:section ?hssection ] ) & [ hdr:comment ?info ] ) ) # Controller/Author query patterns separate: # may be repeated, with re-use of bound variables # # Currently transitioning from hdr:author to hdr:controller, # with a view to using these as separate values. @query hrep:HdrControllerPattern ( ?header hdr:controller @hrep:HdrPersonPattern ) @query hrep:HdrAuthorPattern ( ?header hdr:author @hrep:HdrPersonPattern ) @query hrep:HdrPersonPattern ( ?person ( foaf:name ?aname & ( foaf:mbox ?ambox | foaf:homepage ?ahomepage ) & [ foaf:organization ?orgname ] & [ @hrep:HdrPostalPattern ] & [ foaf:workplaceTel ?wtel ] & [ foaf:workplaceFax ?wfax ] & [ foaf:workplaceHomepage ?wurl ] ) ) @query hrep:HdrPostalPattern ( foaf:workplacePostal ?wp ( [ foaf:building ?wpbuilding ] & [ foaf:street1 ?wpstreet1 ] & [ foaf:street2 ?wpstreet2 ] & [ foaf:city ?wpcity ] & [ foaf:area ?wparea ] & [ foaf:postcode ?wppostcode ] & [ foaf:country ?wpcountry ] ) ) #### HTML output templates #### @text hrep:TableHead ( "" NL "" NL "Table of header field registrations" NL "" NL "" NL "

Table of header field registrations

" NL "" NL "" NL "" NL "" NL ### "" NL "" NL ) @text hrep:TableItem ( "" NL "" NL "" NL "" NL "" NL ) @text hrep:NoDetail ( "" NL ) @text hrep:TableFoot ( "

Header name

Protocol

Purpose

" ?name "" ?pname "" NL ( IFDEF ?purpose : ?purpose NL ) "
No detail found for header field " ?name "
" NL "" NL "" NL ) @text hrep:TableEmpty ( "No header fields found" NL ) @text hrep:HdrEntry1 ( "

Header field: " ?name "

" NL (IFDEF ?purpose : "

" ?purpose "

" NL ) "
" NL "
Applicable protocol:
" ?pname " (" ?psdocument "" ")
" NL "
Status:
" ?status "
" NL "
Author/Change controller:
" NL "
" NL ) @text hrep:HdrEntryAuthor ( ?aname (IFDEF ?ambox : " (" ?ambox ")" ) (IFDEF ?ahomepage : " (" ?ahomepage ")" ) "
" NL (IFDEF ?orgname : ?orgname TRIMWS (DEFER : ",
" NL) ) (IFDEF ?wpbuilding : ?wpbuilding TRIMWS (DEFER : ",
" NL) ) (IFDEF ?wpstreet1 : ?wpstreet1 TRIMWS (DEFER : ", ") ) (IFDEF ?wpstreet2 : ?wpstreet2 TRIMWS (DEFER : ", ") ) (IFDEF ?wpcity : (FLUSH : ",
" NL) ?wpcity TRIMWS (DEFER : ", ") ) (IFDEF ?wparea : ?wparea TRIMWS (DEFER : ", ") ) (IFDEF ?wppostcode : ?wppostcode TRIMWS (DEFER : ", ") ) (IFDEF ?wpcountry : ?wpcountry TRIMWS (DEFER : ", ") ) (FLUSH : ".
" NL) (IFDEF ?wtel : "Tel: " ?wtel "
" NL ) (IFDEF ?wfax : "Fax: " ?wfax "
" NL ) (IFDEF ?wurl : "URL: " ?wurl "
" NL ) ) @text hrep:HdrEntryAuthorSep ( TRIMWS ) ## ( "
" NL ) @text hrep:HdrEntry3 ( "
" NL "
Specification document(s):
" NL "
" ?hsdocument "" (IFDEF ?hssection : " (" ?hssection ")" ) "
" NL (IFDEF ?info : "
Related information:
" NL "
" ?info "
" NL ) "
" NL ) #### XML2RFC output templates #### # Summary table @text hrep:XmlTableHeadt ( "" NL "" NL "Header name" NL "Protocol" NL "Status" NL "" NL ) @text hrep:XmlTableItemt ( "" ?name "" ?pname "" ?status "" ( IFDEF ?purpose : "" ?purpose "" ) NL ) @text hrep:XmlTableFoott ( "" NL NL ) @text hrep:XmlTableHead ( "" NL "" NL NL ) @text hrep:XmlTableEmpty ( "(No header fields found)" NL ) # Header field description @text hrep:XmlEntry1 ( "
" NL "" (IFDEF ?purpose : "" ?purpose "" NL ) "" (IFDEF ?psxref : "" ?pname "" | ?pname ) "" NL "" ?status "" NL "" ) @text hrep:XmlEntryAuthor ( NL "" ?aname ( IFDEF ?ambox : " (" ?ambox ")" ) ( IFDEF ?ahomepage : " (" ?ahomepage ")" ) NL ( IFDEF ?orgname : "" ?orgname NL ) ) ### Not used: @text hrep:FullXmlEntryAuthor ( NL "" ?aname ( IFDEF ?ambox : " (" ?ambox ")" ) ( IFDEF ?ahomepage : " (" ?ahomepage ")" ) NL "" ( IFDEF ?orgname : ?orgname TRIMWS ( DEFER : "," NL ) ) ( IFDEF ?wpbuilding : ?wpbuilding TRIMWS ( DEFER : "," NL ) ) ( IFDEF ?wpstreet1 : ?wpstreet1 TRIMWS ( DEFER : ", ") ) ( IFDEF ?wpstreet2 : ?wpstreet2 TRIMWS ( DEFER : ", ") ) ( IFDEF ?wpcity : ( FLUSH : "," NL "" ) ?wpcity TRIMWS ( DEFER : ", ") ) ( IFDEF ?wppostcode : ?wppostcode TRIMWS ( DEFER : ", ") ) ( IFDEF ?wpcountry : ?wpcountry TRIMWS ( DEFER : ", ") ) ( FLUSH : "." NL ) ( IFDEF ?wtel : "Tel: " ?wtel "" NL ) ( IFDEF ?wfax : "Fax: " ?wfax "" NL ) ( IFDEF ?wurl : "URL: " ?wurl "" "" NL ) ) @text hrep:XmlEntryAuthorSep ( TRIMWS ) ## ( "" NL ) @text hrep:XmlEntry3 ( "" NL " " NL (IFDEF ?hsxref : "" ?hslabel "" | ?hslabel ) ( IFDEF ?hssection : " (" ?hssection ")" ) "" NL ( IFDEF ?info : "" NL ?info "" NL ) "
" NL ) #--------+---------+---------+---------+---------+---------+---------+---------+ # # Copyright (c) 2004, G. KLYNE. All rights reserved. # # This is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This software is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this software; if not, write to: # The Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # or view the web page at: # http://www.gnu.org/copyleft/gpl.html # #--------+---------+---------+---------+---------+---------+---------+---------+ # $Source: /file/cvsdev/HdrRegistry/Attic/GenHeaderRegistry.rep,v $ # $Author: graham $ # $Revision: 1.6 $ # $Log: GenHeaderRegistry.rep,v $ # Revision 1.6 2004/10/20 15:09:49 graham # Revised format of header field summary table # # Revision 1.5 2004/08/11 11:14:05 graham # Sync. # # Revision 1.4 2004/04/16 12:15:16 graham # Remove software copy from Web CVS # # Revision 1.3 2004/04/13 15:13:53 graham # Fix up problems with Author/Controller handling. # Remove Origin header field, and add Accept-Language. # # Revision 1.2 2004/04/07 15:03:59 graham # Update report format for XML2RFC output # Update header field definitions # Add Charles Lindsey's Netnews header definitions # # Revision 1.1 2004/03/26 21:25:09 graham # New and modified files for message header field document # generation using the generic N3GenReport module.