-
Notifications
You must be signed in to change notification settings - Fork 7
/
rdfxml.rb
47 lines (43 loc) · 1.33 KB
/
rdfxml.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..')))
require 'rdf'
module RDF
XML = Class.new(Vocabulary("http://www.w3.org/XML/1998/namespace"))
##
# **`RDF::RDFXML`** is an RDF/XML extension for RDF.rb.
#
# @example Requiring the `RDF::RDFXML` module
# require 'rdf/rdfxml'
#
# @example Parsing RDF statements from an XHTML+RDFXML file
# RDF::RDFXML::Reader.open("etc/foaf.xml") do |reader|
# reader.each_statement do |statement|
# puts statement.inspect
# end
# end
#
# @see https://rubygems.org/gems/rdf
# @see http://www.w3.org/TR/REC-rdf-syntax/
#
# @author [Gregg Kellogg](http://greggkellogg.net/)
module RDFXML
require 'rdf/rdfxml/format'
autoload :Reader, 'rdf/rdfxml/reader'
autoload :Writer, 'rdf/rdfxml/writer'
autoload :VERSION, 'rdf/rdfxml/version'
# Regexp matching an NCName.
NC_REGEXP = Regexp.new(
%{^
(?!\\\\u0301) # ́ is a non-spacing acute accent.
# It is legal within an XML Name, but not as the first character.
( [a-zA-Z_]
| \\\\u[0-9a-fA-F]{4}
)
( [0-9a-zA-Z_\.-]
| \\\\u([0-9a-fA-F]{4})
)*
$},
Regexp::EXTENDED)
def self.debug?; @debug; end
def self.debug=(value); @debug = value; end
end
end