Permalink
Browse files

First commit, completed, but un-debugged, reader.

  • Loading branch information...
0 parents commit 7fdefd6b313d86e75c7b30f154dfb9ada9f38e13 @gkellogg gkellogg committed Jun 26, 2011
Showing with 21,706 additions and 0 deletions.
  1. +38 −0 .gemspec
  2. +12 −0 .yardopts
  3. +1 −0 AUTHORS
  4. +2 −0 History.md
  5. +1 −0 README
  6. +80 −0 README.md
  7. +39 −0 Rakefile
  8. +24 −0 UNLICENSE
  9. +1 −0 VERSION
  10. +3,757 −0 doc/spec.html
  11. +163 −0 doc/yard/Nokogiri/XML/Document.html
  12. +231 −0 doc/yard/Nokogiri/XML/Node.html
  13. +95 −0 doc/yard/RDF.html
  14. +264 −0 doc/yard/RDF/Graph.html
  15. +110 −0 doc/yard/RDF/Literal.html
  16. +875 −0 doc/yard/RDF/Literal/XML.html
  17. +100 −0 doc/yard/RDF/PTR.html
  18. +100 −0 doc/yard/RDF/RDFa.html
  19. +137 −0 doc/yard/RDF/RDFa/Format.html
  20. +121 −0 doc/yard/RDF/RDFa/HTML.html
  21. +1,498 −0 doc/yard/RDF/RDFa/Profile.html
  22. +108 −0 doc/yard/RDF/RDFa/ProfileError.html
  23. +2,754 −0 doc/yard/RDF/RDFa/Reader.html
  24. +121 −0 doc/yard/RDF/RDFa/SVG.html
  25. +318 −0 doc/yard/RDF/RDFa/VERSION.html
  26. +4,382 −0 doc/yard/RDF/RDFa/Writer.html
  27. +121 −0 doc/yard/RDF/RDFa/XHTML.html
  28. +100 −0 doc/yard/RDF/XHV.html
  29. +100 −0 doc/yard/RDF/XML.html
  30. +100 −0 doc/yard/RDF/XSI.html
  31. +177 −0 doc/yard/String.html
  32. +346 −0 doc/yard/_index.html
  33. +36 −0 doc/yard/class_list.html
  34. +1 −0 doc/yard/css/common.css
  35. +53 −0 doc/yard/css/full_list.css
  36. +318 −0 doc/yard/css/style.css
  37. +56 −0 doc/yard/file.AUTHORS.html
  38. +56 −0 doc/yard/file.CONTRIBUTORS.html
  39. +224 −0 doc/yard/file.History.html
  40. +395 −0 doc/yard/file.README.html
  41. +76 −0 doc/yard/file.UNLICENSE.html
  42. +53 −0 doc/yard/file.VERSION.html
  43. +53 −0 doc/yard/file_list.html
  44. +13 −0 doc/yard/frames.html
  45. +395 −0 doc/yard/index.html
  46. +203 −0 doc/yard/js/app.js
  47. +149 −0 doc/yard/js/full_list.js
  48. +16 −0 doc/yard/js/jquery.js
  49. +627 −0 doc/yard/method_list.html
  50. +90 −0 doc/yard/top-level-namespace.html
  51. +15 −0 etc/basic.html
  52. +83 −0 etc/foaf.html
  53. +40 −0 etc/profile.html
  54. +459 −0 etc/xhv.html
  55. +2 −0 lib/rdf/.gitignore
  56. +34 −0 lib/rdf/microdata.rb
  57. +34 −0 lib/rdf/microdata/extensions.rb
  58. +21 −0 lib/rdf/microdata/format.rb
  59. +472 −0 lib/rdf/microdata/reader.rb
  60. +18 −0 lib/rdf/microdata/version.rb
  61. +3 −0 lib/rdf/microdata/vocab.rb
  62. +1 −0 rdf-microdata.gemspec
  63. +90 −0 script/parse
  64. +2 −0 script/yard-to-rubyforge
  65. +1 −0 spec/.gitignore
  66. +106 −0 spec/matchers.rb
  67. +68 −0 spec/profile_spec.rb
  68. +572 −0 spec/reader_spec.rb
  69. +1 −0 spec/spec.opts
  70. +46 −0 spec/spec_helper.rb
  71. +23 −0 spec/test-files/example1.microdata
  72. +15 −0 spec/test-files/example1.ttl
  73. +10 −0 spec/test-files/example2.microdata
  74. +18 −0 spec/test-files/example2.ttl
  75. +97 −0 spec/test_helper.rb
  76. +385 −0 spec/writer_spec.rb
38 .gemspec
@@ -0,0 +1,38 @@
+#!/usr/bin/env ruby -rubygems
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |gem|
+ gem.version = File.read('VERSION').chomp
+ gem.date = File.mtime('VERSION').strftime('%Y-%m-%d')
+
+ gem.name = "rdf-microdata"
+ gem.homepage = "http://github.com/gkellogg/rdf-microdata"
+ gem.license = 'Public Domain' if gem.respond_to?(:license=)
+ gem.summary = "Microdata reader for Ruby."
+ gem.description = gem.summary
+ gem.rubyforge_project = 'rdf-microdata'
+
+ gem.authors = ['Gregg Kellogg']
+ gem.email = 'public-rdf-ruby@w3.org'
+
+ gem.platform = Gem::Platform::RUBY
+ gem.files = %w(AUTHORS README UNLICENSE VERSION) + Dir.glob('lib/**/*.rb')
+ #gem.bindir = %q(bin)
+ #gem.executables = %w(json_ld)
+ #gem.default_executable = gem.executables.first
+ gem.require_paths = %w(lib)
+ gem.extensions = %w()
+ gem.test_files = %w()
+ gem.has_rdoc = false
+
+ gem.required_ruby_version = '>= 1.8.1'
+ gem.requirements = []
+ gem.add_runtime_dependency 'rdf', '>= 0.3.3'
+ gem.add_runtime_dependency 'nokogiri', '>= 1.4.4'
+ gem.add_development_dependency 'yard' , '>= 0.6.0'
+ gem.add_development_dependency 'rspec', '>= 2.5.0'
+ gem.add_development_dependency 'rdf-spec', '>= 0.3.2'
+ gem.add_development_dependency 'rdf-n3', '>= 0.3.3'
+ gem.add_development_dependency 'rdf-isomorphic', '>= 0.3.4'
+ gem.post_install_message = nil
+end
12 .yardopts
@@ -0,0 +1,12 @@
+--title "Microdata reader for RDF.rb."
+--output-dir doc/yard
+--protected
+--no-private
+--hide-void-return
+--markup markdown
+--readme README.md
+-
+History.md
+AUTHORS
+VERSION
+UNLICENSE
1 AUTHORS
@@ -0,0 +1 @@
+* Gregg Kellogg <gregg@kellogg-assoc.com>
2 History.md
@@ -0,0 +1,2 @@
+### 0.0.1
+* Initial release
1 README
80 README.md
@@ -0,0 +1,80 @@
+# RDF::Microdata reader/writer
+
+[Microdata][] parser for RDF.rb.
+
+## DESCRIPTION
+RDF::Microdata is a Microdata reader for Ruby using the [RDF.rb][RDF.rb] library suite.
+
+## FEATURES
+RDF::Microdata parses [Microdata][] into statements or triples.
+
+* Microdata parser.
+* Uses Nokogiri for parsing HTML
+
+Install with 'gem install rdf-microdata'
+
+## Usage
+
+### Reading RDF data in the RDFa format
+
+ graph = RDF::Graph.load("etc/foaf.html", :format => :microdata)
+
+## Dependencies
+* [RDF.rb](http://rubygems.org/gems/rdf) (>= 0.3.3)
+* [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.3.3)
+
+## Documentation
+Full documentation available on [RubyForge](http://rdf.rubyforge.org/microdata)
+
+### Principle Classes
+* {RDF::Microdata::Format}
+ * {RDF::Microdata::HTML}
+ Asserts :html format, text/html mime-type and .html file extension.
+* {RDF::RDFa::Reader}
+
+### Additional vocabularies
+
+## TODO
+* Add support for LibXML and REXML bindings, and use the best available
+* Consider a SAX-based parser for improved performance
+
+## Resources
+* [RDF.rb][RDF.rb]
+* [Documentation](http://rdf.rubyforge.org/microdata)
+* [History](file:file.History.html)
+* [Microdata][]
+
+## Author
+* [Gregg Kellogg](http://github.com/gkellogg) - <http://kellogg-assoc.com/>
+
+## Contributing
+
+* Do your best to adhere to the existing coding conventions and idioms.
+* Don't use hard tabs, and don't leave trailing whitespace on any line.
+* Do document every method you add using [YARD][] annotations. Read the
+ [tutorial][YARD-GS] or just look at the existing code for examples.
+* Don't touch the `.gemspec`, `VERSION` or `AUTHORS` files. If you need to
+ change them, do so on your private branch only.
+* Do feel free to add yourself to the `CREDITS` file and the corresponding
+ list in the the `README`. Alphabetical order applies.
+* Do note that in order for us to merge any non-trivial changes (as a rule
+ of thumb, additions larger than about 15 lines of code), we need an
+ explicit [public domain dedication][PDD] on record from you.
+
+## License
+
+This is free and unencumbered public domain software. For more information,
+see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
+
+## FEEDBACK
+
+* gregg@kellogg-assoc.com
+* <http://rubygems.org/rdf-microdata>
+* <http://github.com/gkellogg/rdf-microdata>
+* <http://lists.w3.org/Archives/Public/public-rdf-ruby/>
+
+[RDF.rb]: http://rdf.rubyforge.org/
+[YARD]: http://yardoc.org/
+[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
+[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
+[Microdata]: http://www.w3.org/TR/2011/WD-microdata-20110525/ "HTML Microdata"
39 Rakefile
@@ -0,0 +1,39 @@
+require 'rubygems'
+
+task :default => [ :spec ]
+
+namespace :gem do
+ desc "Build the rdf-microdata-#{File.read('VERSION').chomp}.gem file"
+ task :build do
+ sh "gem build .gemspec"
+ end
+
+ desc "Release the rdf-microdata-#{File.read('VERSION').chomp}.gem file"
+ task :release do
+ sh "gem push rdf-microdata-#{File.read('VERSION').chomp}.gem"
+ end
+end
+
+require 'rspec/core/rake_task'
+desc 'Run specifications'
+RSpec::Core::RakeTask.new(:spec) do |spec|
+ spec.rspec_opts = %w(--options spec/spec.opts) if File.exists?('spec/spec.opts')
+end
+
+desc "Run specs through RCov"
+RSpec::Core::RakeTask.new("spec:rcov") do |spec|
+ spec.rcov = true
+ spec.rcov_opts = %q[--exclude "spec"]
+end
+
+desc "Generate HTML report specs"
+RSpec::Core::RakeTask.new("doc:spec") do |spec|
+ spec.rspec_opts = ["--format", "html", "-o", "doc/spec.html"]
+end
+
+require 'yard'
+namespace :doc do
+ YARD::Rake::YardocTask.new
+end
+
+task :default => :spec
24 UNLICENSE
@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+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 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.
+
+For more information, please refer to <http://unlicense.org/>
1 VERSION
@@ -0,0 +1 @@
+0.0.1
3,757 doc/spec.html
3,757 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
163 doc/yard/Nokogiri/XML/Document.html
@@ -0,0 +1,163 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Class: Nokogiri::XML::Document</title>
+<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
+
+<script type="text/javascript" charset="utf-8">
+ relpath = '../..';
+ if (relpath != '') relpath += '/';
+</script>
+<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
+<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
+
+ </head>
+ <body>
+ <script type="text/javascript" charset="utf-8">
+ if (window.top.frames.main) document.body.className = 'frames';
+ </script>
+
+ <div id="header">
+ <div id="menu">
+
+ <a href="../../_index.html">Index (D)</a> &raquo;
+ <span class='title'>Nokogiri</span> &raquo; <span class='title'>XML</span>
+ &raquo;
+ <span class="title">Document</span>
+
+
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
+</div>
+
+ <div id="search">
+ <a id="class_list_link" href="#">Class List</a>
+ <a id="method_list_link" href="#">Method List</a>
+ <a id ="file_list_link" href="#">File List</a>
+</div>
+
+ <div class="clear"></div>
+ </div>
+
+ <iframe id="search_frame"></iframe>
+
+ <div id="content"><h1>Class: Nokogiri::XML::Document
+
+
+
+</h1>
+
+<dl class="box">
+
+ <dt class="r1">Inherits:</dt>
+ <dd class="r1">
+ <span class="inheritName">Object</span>
+
+ <ul class="fullTree">
+ <li>Object</li>
+
+ <li class="next">Nokogiri::XML::Document</li>
+
+ </ul>
+ <a href="#" class="inheritanceTree">show all</a>
+
+ </dd>
+
+
+
+
+
+
+
+
+
+ <dt class="r2 last">Defined in:</dt>
+ <dd class="r2 last">lib/rdf/rdfa/patches/nokogiri_hacks.rb</dd>
+
+</dl>
+<div class="clear"></div>
+
+
+
+
+
+ <h2>
+ Instance Method Summary
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
+ </h2>
+
+ <ul class="summary">
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#doctype-instance_method" title="#doctype (instance method)">- (Object) <strong>doctype</strong> </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
+ </ul>
+
+
+
+
+ <div id="instance_method_details" class="method_details_list">
+ <h2>Instance Method Details</h2>
+
+
+ <div class="method_details first">
+ <p class="signature first" id="doctype-instance_method">
+
+ - (<tt>Object</tt>) <strong>doctype</strong>
+
+
+
+</p><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+19
+20
+21</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/nokogiri_hacks.rb', line 19</span>
+
+<span class='def def kw'>def</span> <span class='doctype identifier id'>doctype</span>
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='children identifier id'>children</span><span class='dot token'>.</span><span class='first identifier id'>first</span> <span class='rescue rescue kw'>rescue</span> <span class='false false kw'>false</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ </div>
+
+</div>
+
+ <div id="footer">
+ Generated on Fri Apr 29 10:44:45 2011 by
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
+ 0.6.5 (ruby-1.8.7).
+</div>
+
+ </body>
+</html>
231 doc/yard/Nokogiri/XML/Node.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Class: Nokogiri::XML::Node</title>
+<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
+
+<script type="text/javascript" charset="utf-8">
+ relpath = '../..';
+ if (relpath != '') relpath += '/';
+</script>
+<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
+<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
+
+ </head>
+ <body>
+ <script type="text/javascript" charset="utf-8">
+ if (window.top.frames.main) document.body.className = 'frames';
+ </script>
+
+ <div id="header">
+ <div id="menu">
+
+ <a href="../../_index.html">Index (N)</a> &raquo;
+ <span class='title'>Nokogiri</span> &raquo; <span class='title'>XML</span>
+ &raquo;
+ <span class="title">Node</span>
+
+
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
+</div>
+
+ <div id="search">
+ <a id="class_list_link" href="#">Class List</a>
+ <a id="method_list_link" href="#">Method List</a>
+ <a id ="file_list_link" href="#">File List</a>
+</div>
+
+ <div class="clear"></div>
+ </div>
+
+ <iframe id="search_frame"></iframe>
+
+ <div id="content"><h1>Class: Nokogiri::XML::Node
+
+
+
+</h1>
+
+<dl class="box">
+
+ <dt class="r1">Inherits:</dt>
+ <dd class="r1">
+ <span class="inheritName">Object</span>
+
+ <ul class="fullTree">
+ <li>Object</li>
+
+ <li class="next">Nokogiri::XML::Node</li>
+
+ </ul>
+ <a href="#" class="inheritanceTree">show all</a>
+
+ </dd>
+
+
+
+
+
+
+
+
+
+ <dt class="r2 last">Defined in:</dt>
+ <dd class="r2 last">lib/rdf/rdfa/patches/nokogiri_hacks.rb</dd>
+
+</dl>
+<div class="clear"></div>
+
+
+
+
+
+ <h2>
+ Instance Method Summary
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
+ </h2>
+
+ <ul class="summary">
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#display_path-instance_method" title="#display_path (instance method)">- (Object) <strong>display_path</strong> </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#uri-instance_method" title="#uri (instance method)">- (Object) <strong>uri</strong> </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>URI of namespace + node_name.</p></div></span>
+
+</li>
+
+
+ </ul>
+
+
+
+
+ <div id="instance_method_details" class="method_details_list">
+ <h2>Instance Method Details</h2>
+
+
+ <div class="method_details first">
+ <p class="signature first" id="display_path-instance_method">
+
+ - (<tt>Object</tt>) <strong>display_path</strong>
+
+
+
+</p><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+9
+10
+11
+12
+13
+14
+15</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/nokogiri_hacks.rb', line 9</span>
+
+<span class='def def kw'>def</span> <span class='display_path identifier id'>display_path</span>
+ <span class='@display_path ivar id'>@display_path</span> <span class='opasgn op'>||=</span> <span class='case case kw'>case</span> <span class='self self kw'>self</span>
+ <span class='when when kw'>when</span> <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Document constant id'>Document</span> <span class='then then kw'>then</span> <span class='string val'>&quot;&quot;</span>
+ <span class='when when kw'>when</span> <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Element constant id'>Element</span> <span class='then then kw'>then</span> <span class='parent identifier id'>parent</span> <span class='integer val'>? </span><span class='dstring node'>&quot;#{parent.display_path}/#{name}&quot;</span> <span class='colon op'>:</span> <span class='name identifier id'>name</span>
+ <span class='when when kw'>when</span> <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Attr constant id'>Attr</span> <span class='then then kw'>then</span> <span class='dstring node'>&quot;#{parent.display_path}@#{name}&quot;</span>
+ <span class='end end kw'>end</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <p class="signature " id="uri-instance_method">
+
+ - (<tt>Object</tt>) <strong>uri</strong>
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>URI of namespace + node_name</p>
+
+ </div>
+</div>
+<div class="tags">
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+4
+5
+6
+7</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/nokogiri_hacks.rb', line 4</span>
+
+<span class='def def kw'>def</span> <span class='uri identifier id'>uri</span>
+ <span class='ns identifier id'>ns</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='namespace identifier id'>namespace</span> <span class='integer val'>? </span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='namespace identifier id'>namespace</span><span class='dot token'>.</span><span class='href identifier id'>href</span> <span class='colon op'>:</span> <span class='RDF constant id'>RDF</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
+ <span class='RDF constant id'>RDF</span><span class='colon2 op'>::</span><span class='URI constant id'>URI</span><span class='dot token'>.</span><span class='intern identifier id'>intern</span><span class='lparen token'>(</span><span class='ns identifier id'>ns</span> <span class='plus op'>+</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='node_name identifier id'>node_name</span><span class='rparen token'>)</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ </div>
+
+</div>
+
+ <div id="footer">
+ Generated on Fri Apr 29 10:44:44 2011 by
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
+ 0.6.5 (ruby-1.8.7).
+</div>
+
+ </body>
+</html>
95 doc/yard/RDF.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Module: RDF</title>
+<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
+
+<script type="text/javascript" charset="utf-8">
+ relpath = '';
+ if (relpath != '') relpath += '/';
+</script>
+<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
+<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
+
+ </head>
+ <body>
+ <script type="text/javascript" charset="utf-8">
+ if (window.top.frames.main) document.body.className = 'frames';
+ </script>
+
+ <div id="header">
+ <div id="menu">
+
+ <a href="_index.html">Index (R)</a> &raquo;
+
+
+ <span class="title">RDF</span>
+
+
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
+</div>
+
+ <div id="search">
+ <a id="class_list_link" href="#">Class List</a>
+ <a id="method_list_link" href="#">Method List</a>
+ <a id ="file_list_link" href="#">File List</a>
+</div>
+
+ <div class="clear"></div>
+ </div>
+
+ <iframe id="search_frame"></iframe>
+
+ <div id="content"><h1>Module: RDF
+
+
+
+</h1>
+
+<dl class="box">
+
+
+
+
+
+
+
+
+ <dt class="r1 last">Defined in:</dt>
+ <dd class="r1 last">lib/rdf/rdfa.rb<span class="defines">,<br />
+ lib/rdf/rdfa/vocab.rb,<br /> lib/rdf/rdfa/patches/literal_hacks.rb,<br /> lib/rdf/rdfa/patches/graph_properties.rb</span>
+</dd>
+
+</dl>
+<div class="clear"></div>
+
+<h2>Defined Under Namespace</h2>
+<p class="children">
+
+
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="RDF/RDFa.html" title="RDF::RDFa (module)">RDFa</a></span>
+
+
+
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="RDF/Graph.html" title="RDF::Graph (class)">Graph</a></span>, <span class='object_link'><a href="RDF/Literal.html" title="RDF::Literal (class)">Literal</a></span>, <span class='object_link'><a href="RDF/PTR.html" title="RDF::PTR (class)">PTR</a></span>, <span class='object_link'><a href="RDF/RDFA.html" title="RDF::RDFA (class)">RDFA</a></span>, <span class='object_link'><a href="RDF/XHV.html" title="RDF::XHV (class)">XHV</a></span>, <span class='object_link'><a href="RDF/XML.html" title="RDF::XML (class)">XML</a></span>, <span class='object_link'><a href="RDF/XSI.html" title="RDF::XSI (class)">XSI</a></span>
+
+
+</p>
+
+
+
+
+
+</div>
+
+ <div id="footer">
+ Generated on Fri Apr 29 10:44:45 2011 by
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
+ 0.6.5 (ruby-1.8.7).
+</div>
+
+ </body>
+</html>
264 doc/yard/RDF/Graph.html
@@ -0,0 +1,264 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Class: RDF::Graph</title>
+<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
+
+<script type="text/javascript" charset="utf-8">
+ relpath = '..';
+ if (relpath != '') relpath += '/';
+</script>
+<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
+<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
+
+ </head>
+ <body>
+ <script type="text/javascript" charset="utf-8">
+ if (window.top.frames.main) document.body.className = 'frames';
+ </script>
+
+ <div id="header">
+ <div id="menu">
+
+ <a href="../_index.html">Index (G)</a> &raquo;
+ <span class='title'><span class='object_link'><a href="../RDF.html" title="RDF (module)">RDF</a></span></span>
+ &raquo;
+ <span class="title">Graph</span>
+
+
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
+</div>
+
+ <div id="search">
+ <a id="class_list_link" href="#">Class List</a>
+ <a id="method_list_link" href="#">Method List</a>
+ <a id ="file_list_link" href="#">File List</a>
+</div>
+
+ <div class="clear"></div>
+ </div>
+
+ <iframe id="search_frame"></iframe>
+
+ <div id="content"><h1>Class: RDF::Graph
+
+
+
+</h1>
+
+<dl class="box">
+
+ <dt class="r1">Inherits:</dt>
+ <dd class="r1">
+ <span class="inheritName">Object</span>
+
+ <ul class="fullTree">
+ <li>Object</li>
+
+ <li class="next">RDF::Graph</li>
+
+ </ul>
+ <a href="#" class="inheritanceTree">show all</a>
+
+ </dd>
+
+
+
+
+
+
+
+
+
+ <dt class="r2 last">Defined in:</dt>
+ <dd class="r2 last">lib/rdf/rdfa/patches/graph_properties.rb</dd>
+
+</dl>
+<div class="clear"></div>
+
+
+
+
+
+ <h2>
+ Instance Method Summary
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
+ </h2>
+
+ <ul class="summary">
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#properties-instance_method" title="#properties (instance method)">- (Object) <strong>properties</strong>(subject, recalc = false) </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>Resource properties.</p></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#type_of-instance_method" title="#type_of (instance method)">- (Object) <strong>type_of</strong>(subject) </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>Get type(s) of subject, returns a list of symbols.</p></div></span>
+
+</li>
+
+
+ </ul>
+
+
+
+
+ <div id="instance_method_details" class="method_details_list">
+ <h2>Instance Method Details</h2>
+
+
+ <div class="method_details first">
+ <p class="signature first" id="properties-instance_method">
+
+ - (<tt>Object</tt>) <strong>properties</strong>(subject, recalc = false)
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>Resource properties</p>
+
+<p>Properties arranged as a hash with the predicate Term as index to an array of resources or literals</p>
+
+<p>Example:
+ graph.load(':foo a :bar; rdfs:label "An example" .', "http://example.com/")
+ graph.resources(URI.new("http://example.com/subject")) =>
+ {</p>
+
+<pre class="code"><span class='string val'>&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='lt op'>&lt;</span><span class='http identifier id'>http</span><span class='symbol val'>:/</span><span class='regexp val'>/example.com/</span><span class='comment val'>#bar&gt;],</span>
+<span class='string val'>&quot;http://example.com/#label&quot;</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;An example&quot;</span><span class='rbrack token'>]</span>
+</pre>
+
+<p> }</p>
+
+ </div>
+</div>
+<div class="tags">
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/graph_properties.rb', line 14</span>
+
+<span class='def def kw'>def</span> <span class='properties identifier id'>properties</span><span class='lparen token'>(</span><span class='subject identifier id'>subject</span><span class='comma token'>,</span> <span class='recalc identifier id'>recalc</span> <span class='assign token'>=</span> <span class='false false kw'>false</span><span class='rparen token'>)</span>
+ <span class='@properties ivar id'>@properties</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
+ <span class='@properties ivar id'>@properties</span><span class='dot token'>.</span><span class='delete identifier id'>delete</span><span class='lparen token'>(</span><span class='subject identifier id'>subject</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='rparen token'>)</span> <span class='if if_mod kw'>if</span> <span class='recalc identifier id'>recalc</span>
+ <span class='@properties ivar id'>@properties</span><span class='lbrack token'>[</span><span class='subject identifier id'>subject</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='begin begin kw'>begin</span>
+ <span class='hash identifier id'>hash</span> <span class='assign token'>=</span> <span class='Hash constant id'>Hash</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='query identifier id'>query</span><span class='lparen token'>(</span><span class='symbol val'>:subject</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='subject identifier id'>subject</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='statement identifier id'>statement</span><span class='bitor op'>|</span>
+ <span class='pred identifier id'>pred</span> <span class='assign token'>=</span> <span class='statement identifier id'>statement</span><span class='dot token'>.</span><span class='predicate identifier id'>predicate</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
+
+ <span class='hash identifier id'>hash</span><span class='lbrack token'>[</span><span class='pred identifier id'>pred</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
+ <span class='hash identifier id'>hash</span><span class='lbrack token'>[</span><span class='pred identifier id'>pred</span><span class='rbrack token'>]</span> <span class='lshft op'>&lt;&lt;</span> <span class='statement identifier id'>statement</span><span class='dot token'>.</span><span class='object identifier id'>object</span>
+ <span class='end end kw'>end</span>
+ <span class='hash identifier id'>hash</span>
+ <span class='end end kw'>end</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <p class="signature " id="type_of-instance_method">
+
+ - (<tt>Object</tt>) <strong>type_of</strong>(subject)
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>Get type(s) of subject, returns a list of symbols</p>
+
+ </div>
+</div>
+<div class="tags">
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+30
+31
+32</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/graph_properties.rb', line 30</span>
+
+<span class='def def kw'>def</span> <span class='type_of identifier id'>type_of</span><span class='lparen token'>(</span><span class='subject identifier id'>subject</span><span class='rparen token'>)</span>
+ <span class='query identifier id'>query</span><span class='lparen token'>(</span><span class='symbol val'>:subject</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='subject identifier id'>subject</span><span class='comma token'>,</span> <span class='symbol val'>:predicate</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='RDF constant id'>RDF</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='st identifier id'>st</span><span class='bitor op'>|</span> <span class='st identifier id'>st</span><span class='dot token'>.</span><span class='object identifier id'>object</span><span class='rbrace token'>}</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ </div>
+
+</div>
+
+ <div id="footer">
+ Generated on Fri Apr 29 10:44:45 2011 by
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
+ 0.6.5 (ruby-1.8.7).
+</div>
+
+ </body>
+</html>
110 doc/yard/RDF/Literal.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Class: RDF::Literal</title>
+<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
+
+<script type="text/javascript" charset="utf-8">
+ relpath = '..';
+ if (relpath != '') relpath += '/';
+</script>
+<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
+<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
+
+ </head>
+ <body>
+ <script type="text/javascript" charset="utf-8">
+ if (window.top.frames.main) document.body.className = 'frames';
+ </script>
+
+ <div id="header">
+ <div id="menu">
+
+ <a href="../_index.html">Index (L)</a> &raquo;
+ <span class='title'><span class='object_link'><a href="../RDF.html" title="RDF (module)">RDF</a></span></span>
+ &raquo;
+ <span class="title">Literal</span>
+
+
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
+</div>
+
+ <div id="search">
+ <a id="class_list_link" href="#">Class List</a>
+ <a id="method_list_link" href="#">Method List</a>
+ <a id ="file_list_link" href="#">File List</a>
+</div>
+
+ <div class="clear"></div>
+ </div>
+
+ <iframe id="search_frame"></iframe>
+
+ <div id="content"><h1>Class: RDF::Literal
+
+
+
+</h1>
+
+<dl class="box">
+
+ <dt class="r1">Inherits:</dt>
+ <dd class="r1">
+ <span class="inheritName">Object</span>
+
+ <ul class="fullTree">
+ <li>Object</li>
+
+ <li class="next">RDF::Literal</li>
+
+ </ul>
+ <a href="#" class="inheritanceTree">show all</a>
+
+ </dd>
+
+
+
+
+
+
+
+
+
+ <dt class="r2 last">Defined in:</dt>
+ <dd class="r2 last">lib/rdf/rdfa/patches/literal_hacks.rb</dd>
+
+</dl>
+<div class="clear"></div>
+
+<div id="subclasses">
+ <h2>Direct Known Subclasses</h2>
+ <p class="children"><span class='object_link'><a href="Literal/XML.html" title="RDF::Literal::XML (class)">XML</a></span></p>
+</div>
+<h2>Defined Under Namespace</h2>
+<p class="children">
+
+
+
+
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Literal/XML.html" title="RDF::Literal::XML (class)">XML</a></span>
+
+
+</p>
+
+
+
+
+
+</div>
+
+ <div id="footer">
+ Generated on Fri Apr 29 10:44:44 2011 by
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
+ 0.6.5 (ruby-1.8.7).
+</div>
+
+ </body>
+</html>
875 doc/yard/RDF/Literal/XML.html
@@ -0,0 +1,875 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Class: RDF::Literal::XML</title>
+<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
+
+<script type="text/javascript" charset="utf-8">
+ relpath = '../..';
+ if (relpath != '') relpath += '/';
+</script>
+<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
+<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
+
+ </head>
+ <body>
+ <script type="text/javascript" charset="utf-8">
+ if (window.top.frames.main) document.body.className = 'frames';
+ </script>
+
+ <div id="header">
+ <div id="menu">
+
+ <a href="../../_index.html">Index (X)</a> &raquo;
+ <span class='title'><span class='object_link'><a href="../../RDF.html" title="RDF (module)">RDF</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Literal.html" title="RDF::Literal (class)">Literal</a></span></span>
+ &raquo;
+ <span class="title">XML</span>
+
+
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
+</div>
+
+ <div id="search">
+ <a id="class_list_link" href="#">Class List</a>
+ <a id="method_list_link" href="#">Method List</a>
+ <a id ="file_list_link" href="#">File List</a>
+</div>
+
+ <div class="clear"></div>
+ </div>
+
+ <iframe id="search_frame"></iframe>
+
+ <div id="content"><h1>Class: RDF::Literal::XML
+
+
+
+</h1>
+
+<dl class="box">
+
+ <dt class="r1">Inherits:</dt>
+ <dd class="r1">
+ <span class="inheritName"><span class='object_link'><a href="../Literal.html" title="RDF::Literal (class)">RDF::Literal</a></span></span>
+
+ <ul class="fullTree">
+ <li>Object</li>
+
+ <li class="next"><span class='object_link'><a href="../Literal.html" title="RDF::Literal (class)">RDF::Literal</a></span></li>
+
+ <li class="next">RDF::Literal::XML</li>
+
+ </ul>
+ <a href="#" class="inheritanceTree">show all</a>
+
+ </dd>
+
+
+
+
+
+
+
+
+
+ <dt class="r2 last">Defined in:</dt>
+ <dd class="r2 last">lib/rdf/rdfa/patches/literal_hacks.rb</dd>
+
+</dl>
+<div class="clear"></div>
+
+<h2>Overview</h2><div class="docstring">
+ <div class="discussion">
+ <p>An XML literal.</p>
+
+ </div>
+</div>
+<div class="tags">
+
+ <h3>See Also:</h3>
+ <ul class="see">
+
+ <li><a href="http://www.w3.org/TR/rdf-concepts/#section-XMLLiteral" target="_parent" title="http://www.w3.org/TR/rdf-concepts/#section-XMLLiteral">http://www.w3.org/TR/rdf-concepts/#section-XMLLiteral</a></li>
+
+ <li><a href="http://www.w3.org/TR/rdfa-core/#s_xml_literals" target="_parent" title="http://www.w3.org/TR/rdfa-core/#s_xml_literals">http://www.w3.org/TR/rdfa-core/#s_xml_literals</a></li>
+
+ </ul>
+<h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div>
+
+
+
+
+
+
+
+ <h2>
+ Instance Method Summary
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
+ </h2>
+
+ <ul class="summary">
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#canonicalize-instance_method" title="#canonicalize (instance method)">- (Literal) <strong>canonicalize</strong> </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>Converts the literal into its canonical lexical representation.</p></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (XML) <strong>initialize</strong>(value, options = {}) </a>
+
+
+
+ </span>
+
+ <span class="note title constructor">constructor</span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>A new instance of XML.</p></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#parse_value_libxml-instance_method" title="#parse_value_libxml (instance method)">- (Object) <strong>parse_value_libxml</strong>(value, ns_strs, language) </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>This should use Document#canonicalize if as and when it is available in libxml-ruby.</p></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#parse_value_nokogiri-instance_method" title="#parse_value_nokogiri (instance method)">- (Object) <strong>parse_value_nokogiri</strong>(value, ns_hash, options) </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>A somewhat half-hearted attempt at C14N.</p></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#serialize_nodeset_libxml-instance_method" title="#serialize_nodeset_libxml (instance method)">- (Object) <strong>serialize_nodeset_libxml</strong>(object) </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#serialize_nodeset_nokogiri-instance_method" title="#serialize_nodeset_nokogiri (instance method)">- (Object) <strong>serialize_nodeset_nokogiri</strong>(object) </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#to_s-instance_method" title="#to_s (instance method)">- (String) <strong>to_s</strong> </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'><p>Returns the value as a string.</p></div></span>
+
+</li>
+
+
+ </ul>
+
+
+
+
+
+
+
+ <div id="constructor_details" class="method_details_list">
+ <h2>Constructor Details</h2>
+
+ <div class="method_details first">
+ <p class="signature first" id="initialize-instance_method">
+
+ - (<tt><span class='object_link'><a href="" title="RDF::Literal::XML (class)">XML</a></span></tt>) <strong>initialize</strong>(value, options = {})
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>A new instance of XML</p>
+
+ </div>
+</div>
+<div class="tags">
+ <h3>Parameters:</h3>
+<ul class="param">
+
+ <li>
+
+ <span class='type'>(<tt>Object</tt>)</span>
+
+
+ <span class='name'>value</span>
+
+
+
+ </li>
+
+ <li>
+
+ <span class='type'>(<tt>Hash</tt>)</span>
+
+
+ <span class='name'>options</span>
+
+
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
+
+
+ &mdash;
+ <div class='inline'><p>a customizable set of options</p></div>
+
+ </li>
+
+</ul>
+
+
+
+
+
+
+ <h3>Options Hash (<tt>options</tt>):</h3>
+ <ul class="option">
+
+ <li>
+ <span class="type">(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
+ <span class="name">:lexical</span>
+ <span class="default">
+
+ &mdash; default:
+ <tt>nil</tt>
+
+ </span>
+ &mdash; <div class='inline'></div>
+ </tr>
+
+ <li>
+ <span class="type">(<tt>Hash</tt>)</span>
+ <span class="name">:namespaces</span>
+ <span class="default">
+
+ &mdash; default:
+ <tt>{}</tt>
+
+ </span>
+ &mdash; <div class='inline'><p>Use "" to declare default namespace</p></div>
+ </tr>
+
+ <li>
+ <span class="type">(<tt>Symbol</tt>)</span>
+ <span class="name">:language</span>
+ <span class="default">
+
+ &mdash; default:
+ <tt>nil</tt>
+
+ </span>
+ &mdash; <div class='inline'></div>
+ </tr>
+
+ <li>
+ <span class="type">(<tt>:nokogiri</tt>, <tt>:libxml</tt>, <tt>or :rexml</tt>)</span>
+ <span class="name">:library</span>
+ <span class="default">
+
+ </span>
+
+ </tr>
+
+ </ul>
+
+<h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/literal_hacks.rb', line 26</span>
+
+<span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='value identifier id'>value</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
+ <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:namespaces</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
+
+ <span class='@library ivar id'>@library</span> <span class='assign token'>=</span> <span class='case case kw'>case</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:library</span><span class='rbrack token'>]</span>
+ <span class='when when kw'>when</span> <span class='nil nil kw'>nil</span>
+ <span class='case case kw'>case</span>
+ <span class='when when kw'>when</span> <span class='defined? defined kw'>defined?</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='Nokogiri constant id'>Nokogiri</span><span class='rparen token'>)</span> <span class='then then kw'>then</span> <span class='symbol val'>:nokogiri</span>
+ <span class='when when kw'>when</span> <span class='defined? defined kw'>defined?</span><span class='lparen token'>(</span><span class='colon3 op'>::</span><span class='LibXML constant id'>LibXML</span><span class='rparen token'>)</span> <span class='then then kw'>then</span> <span class='symbol val'>:libxml</span>
+ <span class='else else kw'>else</span> <span class='symbol val'>:rexml</span>
+ <span class='end end kw'>end</span>
+ <span class='when when kw'>when</span> <span class='symbol val'>:nokogiri</span><span class='comma token'>,</span> <span class='symbol val'>:libxml</span><span class='comma token'>,</span> <span class='symbol val'>:rexml</span>
+ <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:library</span><span class='rbrack token'>]</span>
+ <span class='else else kw'>else</span>
+ <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='dstring node'>&quot;expected :rexml, :libxml or :nokogiri, but got #{options[:library].inspect}&quot;</span><span class='rparen token'>)</span>
+ <span class='end end kw'>end</span>
+
+ <span class='@datatype ivar id'>@datatype</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:datatype</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='DATATYPE constant id'>DATATYPE</span>
+ <span class='@string ivar id'>@string</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:lexical</span><span class='rbrack token'>]</span> <span class='if if_mod kw'>if</span> <span class='options identifier id'>options</span><span class='dot token'>.</span><span class='has_key? fid id'>has_key?</span><span class='lparen token'>(</span><span class='symbol val'>:lexical</span><span class='rparen token'>)</span>
+ <span class='@object ivar id'>@object</span> <span class='assign token'>=</span> <span class='parse_value identifier id'>parse_value</span><span class='lparen token'>(</span><span class='value identifier id'>value</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='rparen token'>)</span>
+ <span class='@string ivar id'>@string</span> <span class='assign token'>=</span> <span class='serialize_nodeset identifier id'>serialize_nodeset</span><span class='lparen token'>(</span><span class='@object ivar id'>@object</span><span class='rparen token'>)</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+</div>
+
+
+ <div id="instance_method_details" class="method_details_list">
+ <h2>Instance Method Details</h2>
+
+
+ <div class="method_details first">
+ <p class="signature first" id="canonicalize-instance_method">
+
+ - (<tt><span class='object_link'><a href="../Literal.html" title="RDF::Literal (class)">Literal</a></span></tt>) <strong>canonicalize</strong>
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>Converts the literal into its canonical lexical representation.</p>
+
+ </div>
+</div>
+<div class="tags">
+ <h3>Returns:</h3>
+<ul class="return">
+
+ <li>
+
+ <span class='type'>(<tt><span class='object_link'><a href="../Literal.html" title="RDF::Literal (class)">Literal</a></span></tt>)</span>
+
+
+
+
+ </li>
+
+</ul>
+
+ <h3>See Also:</h3>
+ <ul class="see">
+
+ <li><a href="http://www.w3.org/TR/xml-exc-c14n/" target="_parent" title="http://www.w3.org/TR/xml-exc-c14n/">http://www.w3.org/TR/xml-exc-c14n/</a></li>
+
+ </ul>
+<h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+53
+54
+55
+56</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/literal_hacks.rb', line 53</span>
+
+<span class='def def kw'>def</span> <span class='canonicalize identifier id'>canonicalize</span>
+ <span class='comment val'># This is the opportunity to use exclusive canonicalization library</span>
+ <span class='self self kw'>self</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <p class="signature " id="parse_value_libxml-instance_method">
+
+ - (<tt>Object</tt>) <strong>parse_value_libxml</strong>(value, ns_strs, language)
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>This should use Document#canonicalize if as and when it is available in libxml-ruby</p>
+
+ </div>
+</div>
+<div class="tags">
+ <h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+135
+136
+137</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/literal_hacks.rb', line 135</span>
+
+<span class='def def kw'>def</span> <span class='parse_value_libxml identifier id'>parse_value_libxml</span><span class='lparen token'>(</span><span class='value identifier id'>value</span><span class='comma token'>,</span> <span class='ns_strs identifier id'>ns_strs</span><span class='comma token'>,</span> <span class='language identifier id'>language</span><span class='rparen token'>)</span>
+ <span class='comment val'># Fixme</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <p class="signature " id="parse_value_nokogiri-instance_method">
+
+ - (<tt>Object</tt>) <strong>parse_value_nokogiri</strong>(value, ns_hash, options)
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>A somewhat half-hearted attempt at C14N.
+Main problem is that it promotes all namespaces to top element, instead of demoting them
+to the required element, and does not properly order either namespaces or attributes.</p>
+
+<p>An open-issue in Nokogiri is to add support for C14N from the underlying libxml2 libraries.</p>
+
+ </div>
+</div>
+<div class="tags">
+ <h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/literal_hacks.rb', line 100</span>
+
+<span class='def def kw'>def</span> <span class='parse_value_nokogiri identifier id'>parse_value_nokogiri</span><span class='lparen token'>(</span><span class='value identifier id'>value</span><span class='comma token'>,</span> <span class='ns_hash identifier id'>ns_hash</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='rparen token'>)</span>
+ <span class='elements identifier id'>elements</span> <span class='assign token'>=</span> <span class='if if kw'>if</span> <span class='value identifier id'>value</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='NodeSet constant id'>NodeSet</span><span class='rparen token'>)</span>
+ <span class='value identifier id'>value</span>
+ <span class='else else kw'>else</span>
+ <span class='ns_strs identifier id'>ns_strs</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
+ <span class='ns_hash identifier id'>ns_hash</span><span class='dot token'>.</span><span class='each_pair identifier id'>each_pair</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='a identifier id'>a</span><span class='comma token'>,</span> <span class='u identifier id'>u</span><span class='bitor op'>|</span> <span class='ns_strs identifier id'>ns_strs</span> <span class='lshft op'>&lt;&lt;</span> <span class='dstring node'>&quot;#{a}=\&quot;#{u}\&quot;&quot;</span><span class='rbrace token'>}</span>
+ <span class='comment val'># Add inherited namespaces to created root element so that they're inherited to sub-elements</span>
+ <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Document constant id'>Document</span><span class='dot token'>.</span><span class='parse identifier id'>parse</span><span class='lparen token'>(</span><span class='dstring node'>&quot;&lt;foo #{ns_strs.join(&quot; &quot;)}&gt;#{value.to_s}&lt;/foo&gt;&quot;</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='root identifier id'>root</span><span class='dot token'>.</span><span class='children identifier id'>children</span>
+ <span class='end end kw'>end</span>
+
+ <span class='elements identifier id'>elements</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='c identifier id'>c</span><span class='bitor op'>|</span>
+ <span class='if if kw'>if</span> <span class='c identifier id'>c</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Element constant id'>Element</span><span class='rparen token'>)</span>
+ <span class='c identifier id'>c</span> <span class='assign token'>=</span> <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='dot token'>.</span><span class='parse identifier id'>parse</span><span class='lparen token'>(</span><span class='c identifier id'>c</span><span class='dot token'>.</span><span class='dup identifier id'>dup</span><span class='dot token'>.</span><span class='to_xml identifier id'>to_xml</span><span class='lparen token'>(</span><span class='symbol val'>:save_with</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Node constant id'>Node</span><span class='colon2 op'>::</span><span class='SaveOptions constant id'>SaveOptions</span><span class='colon2 op'>::</span><span class='NO_EMPTY_TAGS constant id'>NO_EMPTY_TAGS</span><span class='rparen token'>)</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='root identifier id'>root</span>
+
+ <span class='comment val'># Apply defined namespaces</span>
+ <span class='ns_hash identifier id'>ns_hash</span><span class='dot token'>.</span><span class='each_pair identifier id'>each_pair</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='prefix identifier id'>prefix</span><span class='comma token'>,</span> <span class='href identifier id'>href</span><span class='bitor op'>|</span>
+ <span class='c identifier id'>c</span><span class='lbrack token'>[</span><span class='prefix identifier id'>prefix</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='href identifier id'>href</span> <span class='unless unless_mod kw'>unless</span> <span class='c identifier id'>c</span><span class='dot token'>.</span><span class='namespaces identifier id'>namespaces</span><span class='lbrack token'>[</span><span class='prefix identifier id'>prefix</span><span class='rbrack token'>]</span>
+ <span class='end end kw'>end</span>
+
+ <span class='comment val'># Add language</span>
+ <span class='if if kw'>if</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:language</span><span class='rbrack token'>]</span> <span class='andop op'>&amp;&amp;</span> <span class='c identifier id'>c</span><span class='lbrack token'>[</span><span class='string val'>&quot;lang&quot;</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='empty? fid id'>empty?</span>
+ <span class='c identifier id'>c</span><span class='lbrack token'>[</span><span class='string val'>&quot;xml:lang&quot;</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:language</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
+ <span class='end end kw'>end</span>
+ <span class='end end kw'>end</span>
+ <span class='c identifier id'>c</span>
+ <span class='end end kw'>end</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <p class="signature " id="serialize_nodeset_libxml-instance_method">
+
+ - (<tt>Object</tt>) <strong>serialize_nodeset_libxml</strong>(object)
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+
+
+ </div>
+</div>
+<div class="tags">
+ <h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+139
+140
+141</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/literal_hacks.rb', line 139</span>
+
+<span class='def def kw'>def</span> <span class='serialize_nodeset_libxml identifier id'>serialize_nodeset_libxml</span><span class='lparen token'>(</span><span class='object identifier id'>object</span><span class='rparen token'>)</span>
+ <span class='comment val'># Fixme</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <p class="signature " id="serialize_nodeset_nokogiri-instance_method">
+
+ - (<tt>Object</tt>) <strong>serialize_nodeset_nokogiri</strong>(object)
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+
+
+ </div>
+</div>
+<div class="tags">
+ <h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+128
+129
+130</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/literal_hacks.rb', line 128</span>
+
+<span class='def def kw'>def</span> <span class='serialize_nodeset_nokogiri identifier id'>serialize_nodeset_nokogiri</span><span class='lparen token'>(</span><span class='object identifier id'>object</span><span class='rparen token'>)</span>
+ <span class='object identifier id'>object</span><span class='dot token'>.</span><span class='map identifier id'>map</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='c identifier id'>c</span><span class='bitor op'>|</span> <span class='c identifier id'>c</span><span class='dot token'>.</span><span class='to_xml identifier id'>to_xml</span><span class='lparen token'>(</span><span class='symbol val'>:save_with</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Node constant id'>Node</span><span class='colon2 op'>::</span><span class='SaveOptions constant id'>SaveOptions</span><span class='colon2 op'>::</span><span class='NO_EMPTY_TAGS constant id'>NO_EMPTY_TAGS</span><span class='rparen token'>)</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>&quot;&quot;</span><span class='rparen token'>)</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <p class="signature " id="to_s-instance_method">
+
+ - (<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>) <strong>to_s</strong>
+
+
+
+</p><div class="docstring">
+ <div class="discussion">
+ <p>Returns the value as a string.</p>
+
+ </div>
+</div>
+<div class="tags">
+ <h3>Returns:</h3>
+<ul class="return">
+
+ <li>
+
+ <span class='type'>(<tt><span class='object_link'><a href="../../String.html" title="String (class)">String</a></span></tt>)</span>
+
+
+
+
+ </li>
+
+</ul>
+<h3>Since:</h3>
+<ul class="since">
+
+ <li>
+
+
+
+
+
+ <div class='inline'><p>0.2.1</p></div>
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+62
+63
+64</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/rdf/rdfa/patches/literal_hacks.rb', line 62</span>
+
+<span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span>
+ <span class='@string ivar id'>@string</span>
+<span class='end end kw'>end</span>
+</pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ </div>
+
+</div>
+
+ <div id="footer">