CommonsPurl

The CommonsPurl namespace is set up as an prototype for managing documentation associated with URIs used as names as described in Common Naming Project project. Each page in the namespace is set to manage some space of names. An example is CommonsPurl:Record/Ncbi_gene, which is used to construct responses for the names of Entrez gene record names of the form http://purl.org/commons/record/ncbi_gene/7157.

The page has several components, marked by the use of MediaWiki Templates.


 * Template:PurlPattern is a perl regular expression pattern that is matched against the URI that was request. Capture groups can be used on the rest of the page as they would be in perl - $1, $2, etc.
 * Template:PurlHtml This section marks the HTML documentation for the name.
 * Template:PurlRdf This section marks the RDF or OWL documentation for the name. Right now it needs to be RDF/XML, but plans are to let it be in other syntaxes, or to be constructed using templates or forms that capture common patterns, which will be translated by the script to a uniform format (probably RDF/XML)
 * Template:PurlResponseAbout This constructs the name (another URI) for the metadata about the URI. Currently this URI is http://purl.org/about/

To configure this on the PURL side one sets up a redirect (partial redirect in the case of Entrez gene) to the, handler, which fetches the appropriate page from the wiki, grabs the section needed for a response, substitutes the matched portion of the URI in the template, and responds.

Some notes
 * From the OWL point of view, the metadata, named as http://purl.org/about/.... is an OWL ontology of that name. You should be able to open http://purl.org/about/commons/record/ncbi_gene/7157 in Protege and find it to be a valid OWL-DL ontology.
 * The ontology should give at least a type to URI it is about, and as much other information as would be useful. Keep in mind that the ontology documents how to use the name.
 * In the case where the URI being documented names a document such as a web page or a record in a specific format, the URI would redirect straight to the document. To discover the name of the metadata, you have to either know the rule (prepend /about/ to the purl path) or wait until we can add a link: header.
 * In the case where the URI being documented doesn't name a document, or where a two step process of finding the document is tolerable, the URI response is a 303 redirect to the metadata. Currently the response is html with a link rel=meta to the RDF metadata in the head of the html. That will change soon to a direct link to the RDF, with a stylesheet that converts that to HTML for browsing.

The Entrez gene example

The PURLs we've set up are:
 * /commons/asn/ncbi_gene/
 * http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=gene&retmode=asn.1&id=
 * /commons/html/ncbi_gene/
 * http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=full_report&list_uids=
 * /commons/record/ncbi_gene/
 * http://sw.neurocommons.org/cgi-bin/wiki303.pl?show=html&ref=record/ncbi_gene/
 * /commons/xml/ncbi_gene/
 * http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=gene&retmode=xml&id=
 * /about/commons/
 * http://sw.neurocommons.org/cgi-bin/wiki303.pl?ref=

The Metadata conveys the fact that there are records in specific formats that are encodings of this record: XML, ASN.1, HTML, each of which have their own names (URIS) that are PURLS (see above list).