File: ContextParser.html

package info (click to toggle)
redland-bindings 1.0.17.1%2Bdfsg-1.4
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 6,048 kB
  • sloc: ansic: 39,669; sh: 11,176; javascript: 6,645; ruby: 2,378; python: 2,310; perl: 2,171; makefile: 431; php: 61
file content (165 lines) | stat: -rw-r--r-- 9,765 bytes parent folder | download | duplicates (6)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Redland RDF Language Bindings - Ruby RDoc - Class: Redland::ContextParser</title>
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
<script src="../js/jquery.js" type="text/javascript" charset="utf-8">
</script>
<script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8">
</script>
<script src="../js/quicksearch.js" type="text/javascript" charset="utf-8">
</script>
<script src="../js/darkfish.js" type="text/javascript" charset="utf-8">
</script>
</head>
<body id="top" class="class">
<div id="metadata">
<div id="home-metadata">
<div id="home-section" class="section">
<h3 class="section-header"><a href="../index.html">Home</a> <a href="../index.html#classes">Classes</a> <a href="../index.html#methods">Methods</a></h3>
</div>
</div>
<div id="file-metadata">
<div id="file-list-section" class="section">
<h3 class="section-header">In Files</h3>
<div class="section-body">
<ul>
<li><a href="../rdf/redland/parser_rb.html?TB_iframe=true&amp;height=550&amp;width=785" class="thickbox" title="rdf/redland/parser.rb">rdf/redland/parser.rb</a></li>
</ul>
</div>
</div>
</div>
<div id="class-metadata"><!-- Parent Class -->
<div id="parent-class-section" class="section">
<h3 class="section-header">Parent</h3>
<p class="link">Object</p>
</div>
<!-- Method Quickref -->
<div id="method-list-section" class="section">
<h3 class="section-header">Methods</h3>
<ul class="link-list">
<li><a href="#method-c-new">::new</a></li>
<li><a href="#method-i-parse_into_model">#parse_into_model</a></li>
</ul>
</div>
</div>
<div id="project-metadata">
<div id="fileindex-section" class="section project-section">
<h3 class="section-header">Files</h3>
<ul>
<li class="file"><a href="../Makefile.html">Makefile</a></li>
<li class="file"><a href="../rdf/Makefile.html">Makefile</a></li>
<li class="file"><a href="../rdf/redland/Makefile.html">Makefile</a></li>
<li class="file"><a href="../rdf/redland/schemas/Makefile.html">Makefile</a></li>
</ul>
</div>
<div id="classindex-section" class="section project-section">
<h3 class="section-header">Class/Module Index <span class="search-toggle"><img src="../images/find.png" height="16" width="16" alt="[+]" title="show/hide quicksearch" /></span></h3>
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
<fieldset><legend>Quicksearch</legend> <input type="text" name="quicksearch" value="" class="quicksearch-field" /></fieldset>
</form>
<ul class="link-list">
<li><a href="../Redland.html">Redland</a></li>
<li><a href="../Redland/BNode.html">Redland::BNode</a></li>
<li><a href="../Redland/ContextParser.html">Redland::ContextParser</a></li>
<li><a href="../Redland/FileStore.html">Redland::FileStore</a></li>
<li><a href="../Redland/HashOpen.html">Redland::HashOpen</a></li>
<li><a href="../Redland/HashStore.html">Redland::HashStore</a></li>
<li><a href="../Redland/Literal.html">Redland::Literal</a></li>
<li><a href="../Redland/MemoryStore.html">Redland::MemoryStore</a></li>
<li><a href="../Redland/MergedModel.html">Redland::MergedModel</a></li>
<li><a href="../Redland/Model.html">Redland::Model</a></li>
<li><a href="../Redland/Namespace.html">Redland::Namespace</a></li>
<li><a href="../Redland/Node.html">Redland::Node</a></li>
<li><a href="../Redland/NodeIterator.html">Redland::NodeIterator</a></li>
<li><a href="../Redland/NodeTypeError.html">Redland::NodeTypeError</a></li>
<li><a href="../Redland/OWL.html">Redland::OWL</a></li>
<li><a href="../Redland/Parser.html">Redland::Parser</a></li>
<li><a href="../Redland/Query.html">Redland::Query</a></li>
<li><a href="../Redland/QueryResults.html">Redland::QueryResults</a></li>
<li><a href="../Redland/RDFS.html">Redland::RDFS</a></li>
<li><a href="../Redland/RedlandError.html">Redland::RedlandError</a></li>
<li><a href="../Redland/Resource.html">Redland::Resource</a></li>
<li><a href="../Redland/Serializer.html">Redland::Serializer</a></li>
<li><a href="../Redland/Statement.html">Redland::Statement</a></li>
<li><a href="../Redland/Stream.html">Redland::Stream</a></li>
<li><a href="../Redland/TripleStore.html">Redland::TripleStore</a></li>
<li><a href="../Redland/Uri.html">Redland::Uri</a></li>
<li><a href="../Redland/Util.html">Redland::Util</a></li>
<li><a href="../Redland/World.html">Redland::World</a></li>
<li><a href="../DC.html">DC</a></li>
<li><a href="../FOAF.html">FOAF</a></li>
</ul>
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
</div>
</div>
</div>
<div id="documentation">
<h1 class="class">Redland::ContextParser</h1>
<div id="description" class="description">
<p>Class for parsing a file</p>
</div>
<!-- description -->
<div id="5Buntitled-5D" class="documentation-section"><!-- Methods -->
<div id="public-class-method-details" class="method-section section">
<h3 class="section-header">Public Class Methods</h3>
<div id="new-method" class="method-detail"><a name="method-c-new" id="method-c-new"></a>
<div class="method-heading"><span class="method-name">new</span><span class="method-args">(file)</span> <span class="method-click-advice">click to toggle source</span></div>
<div class="method-description">
<p>Create a new <a href="ContextParser.html">ContextParser</a> for a file</p>
<div class="method-source-code" id="new-source">
<pre>
<span class="ruby-comment"># File rdf/redland/parser.rb, line 218</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">file</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
    <span class="ruby-identifier">file</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">file</span>)
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">RedlandError</span>(<span class="ruby-string">"File doesn't exist"</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">file</span>)
    <span class="ruby-ivar">@uri</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Uri</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-constant">File</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@parser</span> = <span class="ruby-constant">Redland</span>.<span class="ruby-identifier">librdf_new_parser</span>(<span class="ruby-identifier">$world</span>.<span class="ruby-identifier">world</span>,<span class="ruby-identifier">name</span>,<span class="ruby-identifier">mime_type</span>,<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">uri</span>,<span class="ruby-ivar">@uri</span>.<span class="ruby-identifier">uri</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">RedlandError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">"Parser construction failed"</span>) <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@parser</span>
  <span class="ruby-constant">ObjectSpace</span>.<span class="ruby-identifier">define_finalizer</span>(<span class="ruby-keyword">self</span>,<span class="ruby-constant">Parser</span>.<span class="ruby-identifier">create_finalizer</span>(<span class="ruby-ivar">@parser</span>))
  
<span class="ruby-keyword">end</span>
</pre></div>
<!-- new-source --></div>
</div>
<!-- new-method --></div>
<!-- public-class-method-details -->
<div id="public-instance-method-details" class="method-section section">
<h3 class="section-header">Public Instance Methods</h3>
<div id="parse_into_model-method" class="method-detail"><a name="method-i-parse_into_model" id="method-i-parse_into_model"></a>
<div class="method-heading"><span class="method-name">parse_into_model</span><span class="method-args">(model,string,base_uri)</span> <span class="method-click-advice">click to toggle source</span></div>
<div class="method-description">
<p>Parse a file into a model (?? confirm - why doesn't it use most of it's args)</p>
<div class="method-source-code" id="parse_into_model-source">
<pre>
<span class="ruby-comment"># File rdf/redland/parser.rb, line 233</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parse_into_model</span>(<span class="ruby-identifier">model</span>,<span class="ruby-identifier">string</span>,<span class="ruby-identifier">base_uri</span>)
  <span class="ruby-keyword">super</span>(<span class="ruby-identifier">model</span>,<span class="ruby-ivar">@uri</span>,<span class="ruby-keyword">nil</span>,<span class="ruby-ivar">@uri</span>)
<span class="ruby-keyword">end</span>
</pre></div>
<!-- parse_into_model-source --></div>
</div>
<!-- parse_into_model-method --></div>
<!-- public-instance-method-details --></div>
<!-- 5Buntitled-5D --></div>
<!-- documentation -->
<hr />

<div class="outerHeader">
Go to <a href="/" target="_parent">Redland Home</a> - 
<a href="/bindings/" target="_parent">Language Bindings Home</a> - 
<a href="/docs/ruby.html" target="_parent">Ruby API Home</a>
</div>

<p>(C) Copyright 2004-2013 <a href="http://www.dajobe.org/" target="_parent">Dave Beckett</a>, (C) Copyright 2004-2005 <a href="http://www.bristol.ac.uk/" target="_parent">University of Bristol</a></p>

</div> <!-- end outerBlock -->

</body>
</html>