[uf-new] Statement of Principles/code of conduct - any prior work ?

Toby A Inkster mail at tobyinkster.co.uk
Thu Nov 13 07:18:18 PST 2008


Mark Ng wrote:

> Yup, and this is a very useful pattern.  One important use case your
> example below misses though is distinguishing between different types
> of standards you comply to.  If you're trying, for example to compile
> a list of different journalistic codes, it's not very helpful if you
> end up with a bunch of laws and ecological policies at the same time
> :).

One solution to that would be to have the standards document itself  
state what type of standard it is, possibly using rel-tag.

> How would an RDFa example change to account for this ? (considering me
> RDFa-stupid, as I've done very very little with it).

Assuming a namespace URI was set up at http://example.com/ns# with  
the definitions of all the types of standard, you could use something  
like:

     <div xmlns:dc="http://purl.org/dc/terms/"
          xmlns:ex="http://example.com/ns#">

       <p about="#product" rel="dc:conformsTo">
         This product conforms to
         <a href="/foo" typeof="ex:Law">the Foo law</a> and
         <a href="/bar" typeof="ex:Standard">Bar standards</a>.
       </p>

       <p rel="dc:conformsTo">
         This page conforms to
         <a href="http://www.w3.org/TR/rdfa-syntax/"
            typeof="ex:WebStandard">XHTML+RDFa 1.0</a>.
       </p>

     </div>

In the example above, the <div> is just there as a convenient  
container to define the prefixes being used, "dc" and "ex". (In a  
theoretical microformat serialisation, this would probably be  
omitted, but I think it's useful to use a pure RDFa version as a  
prototype to get an idea about how a future microformat might work.)

In RDFa, the about attribute is used to specify what you're making a  
statement about. The first paragraph says that "#product" (a fragment  
identifier representing the product in question) conforms to some  
stuff. The second paragraph omits an about attribute, so is taken to  
be about the page as a whole. If a microformat was created, perhaps  
nesting could be used to determine what the subject of the  
conformancy statement is. For example, within an hProduct or  
hListing, it would refer to the product; within an hCard, it would  
refer to the person or organisation; within an hCalendar event, it  
would refer to the event; within an hAtom entry, it would refer to  
the entry; within an hRecipe, it would refer to the recipe; otherwise  
it would refer to the page.

The typeof attribute in RDFa then specifies the type of thing being  
complied with.

The example above can be parsed by any RDFa implementation[1]  
resulting in a bunch of RDFa triples:

     <> dc:conformsTo <http://www.w3.org/TR/rdfa-syntax/> .
     <#product> dc:conformsTo </foo> .
     <#product> dc:conformsTo </bar> .
     </foo> rdf:type ex:Law .
     </bar> rdf:type ex:Standard .
     <http://www.w3.org/TR/rdfa-syntax/> rdf:type ex:WebStandard .

A tool that is concerned with finding what is labelled that it  
complies with laws, but not worried about complying with standards  
would look for any triples such that X dc:conformsTo Y where Y has an  
rdf:type Z where Z is ex:Law or any subclass of ex:Law. The search  
for such triples could be handled using a single SPARQL[2] query.

____
1. <http://www.w3.org/2006/07/SWD/RDFa/implementation-report/>
2. SPARQL is a SQL-like language for querying RDF data.
    <http://en.wikipedia.org/wiki/SPARQL>

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>





More information about the microformats-new mailing list