W3C home > Mailing lists > Public > public-rdf-comments@w3.org > February 2013

Re: Unsetting @base and @prefix

From: Eric Prud'hommeaux <eric@w3.org>
Date: Wed, 13 Feb 2013 23:47:16 -0500
To: Stephen Allen <sallen@apache.org>
Cc: public-rdf-comments@w3.org
Message-ID: <20130214044715.GD15692@w3.org>
* Stephen Allen <sallen@apache.org> [2012-09-17 11:04-0700]
> RDF Working Group,
> I apologize for not getting this comment out before the 15th.
> Hopefully it is not too late for consideration.
> I have a concern about the @base and @prefix features of IRI
> construction.  I like that you can set these and re-map them at any
> point.  However, there doesn't appear to be a way to unset them.  This
> seems like it could lead to silent creation of incorrect data when you
> would actually want a parsing error.
> An example would be if you were using text tools to concatenate turtle
> files together [1].  If the files were unrelated, you would want to
> ensure they are not inadvertently sharing prefixes or base IRIs if one
> of the files is internally invalid (referring to an undefined prefix
> that just happens to be defined in an earlier file).
> A proposed syntax for unsetting base IRI and prefix state:
>     @base .      # Unsets base URI
>     @prefix .     # Unsets all prefixes
>     @prefix ex:  # Unsets the ex: prefix
> Thanks for your time!
> -Stephen
> [1] Sample bash script to concatenate Turtle files:
> #!/usr/bin/env bash
> for file in *.ttl; do
>   cat $file >> out.ttl
>   echo -e "\n @base . @prefix . \n" >> out.ttl
> done

Apologies for the extreme delay in responding to your comment on the
Last Call draft of Turtle.

The RDF Working Group noted that there was no actual implementation
experience indicating widespread need for resetting base and prefix
and that other complications arise, e.g. the unification of
similarly-named BNodes. We elected instead to add the text
Note that concatenation of Turtle files does not necessarily produce
the RDF graph merge of the two serialized graphs and can lead to
unexpected results. For instance, @base may change the Base IRI,
re-used blank node labels will be merged.

Note that the script above could produce different triples if
e.g. a.ttl had relative IRIs:
  <out.ttl/s> <out.ttl/p> <out.ttl/o> .
  <a.ttl/s> <a.ttl/p> <a.ttl/o> .
Echoing "@base <$file> .\n" seems like it would improve the situation.
Please let us know if this addresses your comment.
Received on Thursday, 14 February 2013 04:47:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:59:31 UTC