Re: Methods for referencing URIs

On 2 May 2009, at 15:27, Stephane Corlosquet wrote:

> For the RDFa in Drupal core effort, I'm looking for the best way to  
> store URIs and keep it lightweight and developer friendly.
>
> I see three different methods for referencing vocabulary URIs.
>
> 1. Full URI. very verbose and not very readable.

I would suggest storing full URIs, and...

> 2. CURIE. easy to read and user friendly.

...displaying them as CURIEs if required in the user interface.

> A typical use case is for representing a blog post for example:
>
> $object->title = 'Title of my blog post';
> $object->created = '1235130980';
> $object->user_id = 2;
> $object->body = 'Lorem ipsum dolor sit amet, consectetur adipiscing  
> elit.';
> $object->rdf_mappings = array(
>    'type' => 'sioct:Weblog',
>    'title' => 'dc:title',
>    'body' => 'sioc:content',
>    'user_id' => 'dc:creator',
>  );

Using full URIs this could be:

include 'prefixes.php'; # A bunch of constants
/* ... */
$object->rdf_mappings = array(
    'type' => SIOCT.'Weblog',
    'title' => DC.'title',
    'body' => SIOC. 'content',
    'user_id' => DC.'creator',
  );

Or:

include 'prefixes.php'; # A class definition
/* ... */
$object->rdf_mappings = array(
    'type' => RDF::sioct('Weblog'),
    'title' => RDF::dc('title'),
    'body' => RDF::sioc('content'),
    'user_id' => RDF::dc('creator'),
  );


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

Received on Saturday, 2 May 2009 15:10:54 UTC