Kjetil

create iri class myexample:story "http://example.org/story/%U"; (in title
varchar)

will eliminate the need in numeric ID, but only if titles are unique.
Otherwise, join on such an IRI may join properties of different
documents with same title, taht is probably not what you expect. Thus an
IRI with ID is a safe choice.

Best Regards,

Ivan Mikhailov,
OpenLink Software,
http://virtuoso.openlinksw.com

On Wed, 2008-11-05 at 14:34 +0100, Kjetil Kjernsmo wrote:

> My next issue is about how URIs are generated in RDF Views. To create more 
> human-understandable URIs, we usually prefer to use e.g. a dumbed down part 
> of the title rather than a numeric ID in our URIs. We tend to use ASCII only 
> for these names, so that for example an article with title "blåbærsyltetøy" 
> would be included as a URI
> http://example.org/story/blabersyltetoy
> 
> Some old Perl code of mine does basically this:
>     $intitle =~ s/\p{TerminalPunctuation}//gs; # Remove terminal punctutation
>     idn_prefix('');
>     $intitle = unac_string('utf8', $intitle); # Try to translate most
>     $intitle = encode_punycode(lc($intitle)); # Punycode the rest if needed
>     $intitle =~ s/\s+/-/gs; # All spaces become one -
>     $intitle =~ s/[^a-z0-9\-_]//g; # Remove all now not a alphanumeric or -
> 
> Then, I also add some numbers in case of a collision.
> 
> Now, the problem is of course that all this is irreversible, so given a URI, 
> you can't easily reconstruct the ID. So, unless the URI itself is stored, 
> this might be among the Harder Problems. 
> 
> Still, I was wondering if this could be accommodated for, perhaps in the form 
> of a special mapping and a sprintf pattern?



Reply via email to