GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: The Curies library implements the CURIE syntax for expressing Compact URIs. See http://www.w3.org/TR/curie/ for more information on the CURIE specification.
Clone URL: git://github.com/pius/curies.git
curies /
name age message
file History.txt Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
file License.txt Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
file Manifest.txt Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
file README.txt Wed Mar 19 16:21:21 -0700 2008 updated README with fuller version [pius]
file Rakefile Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
directory blah/ Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
directory config/ Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
directory lib/ Wed Mar 19 17:42:18 -0700 2008 Added ical, vcard, Creative Commons, and a few ... [pius]
directory log/ Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
directory script/ Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
file setup.rb Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
directory spec/ Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
directory tasks/ Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
directory website/ Wed Mar 19 16:19:55 -0700 2008 initial commit [pius]
README.txt
= Curies

* http://curies.rubyforge.org

== DESCRIPTION:

The Curies library implements the CURIE syntax for expressing Compact URIs.  

In a nutshell, a CURIE is a compact way of representing a URI.  For example, suppose you've got an XML document in which 

you'll be writing many attributes of the form "http://www.amazon.com/?isbn=123478753".  With a CURIE, you can represent 
those as
"[amazon:123478753]" where "amazon" is a registered prefix in your document.

This library is small, but useful if you're writing a parser for a language that uses CURIEs.  
I wrote it because I'm implementing an RDF/JSON library and, because the RDF/JSON spec isn't 
finalized yet, I've taken the liberty of using CURIEs rather than QNAMEs.

See http://www.w3.org/TR/curie/ for more information on the CURIE specification.

== FEATURES:

== 0.5.0 2008-03-19

* Initial release:
  * Should fully implement the W3C spec [http://www.w3.org/TR/curie/]
  * Allows the creation of CURIEs
  * Allows the parsing of a string as a putative CURIE
  * Allows prefixes/namespaces to be added and removed
  * Parses both safe and unsafe CURIEs but only outputs safe CURIEs
  * Includes the FOAF namespace loaded by default

== SYNOPSIS:

<pre syntax="ruby">require 'curies'</pre>
<pre syntax="ruby">c = Curie.new("foaf", "person")</pre>

<pre syntax="ruby">c.to_s</pre>
<pre syntax="ruby">=>"[foaf:person]"</pre>

<pre syntax="ruby">Curie.parse "[foaf:name]"</pre>
<pre syntax="ruby">"http://xmlns.com/foaf/0.1/person"</pre>

<pre syntax="ruby">Curie.parse "[foo:bar]"</pre>
<pre syntax="ruby">"RuntimeError: Sorry, no namespace or prefix registered for curies with the prefix foo"</pre>
<pre syntax="ruby">Curie.add_prefixes! :foo => "http://www.example.com/ns/foo/"</pre>
<pre syntax="ruby">=> {"foo"=>"http://www.example.com/ns/foo/", "foaf"=>"http://xmlns.com/foaf/0.1/"}</pre>
<pre syntax="ruby">Curie.parse "[foo:bar]"</pre>
<pre syntax="ruby">=> "http://www.example.com/ns/foo/bar"</pre>

== INSTALL:

sudo gem install curies

== LICENSE:

(The MIT License)

Copyright (c) 2008 Pius A. Uzamere II, The Uyiosa Corporation

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.