pho 0.4.1 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +18 -1
- data/README +10 -0
- data/Rakefile +2 -1
- data/doc/rdoc/classes/Pho.html +33 -22
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +12 -12
- data/doc/rdoc/classes/Pho/{RDF_JSON.html → Enrichment.html} +8 -7
- data/doc/rdoc/classes/Pho/Enrichment/ResourceEnricher.html +310 -0
- data/doc/rdoc/classes/Pho/Etags.html +42 -42
- data/doc/rdoc/classes/Pho/Facet/Results.html +19 -19
- data/doc/rdoc/classes/Pho/Facet/Term.html +6 -6
- data/doc/rdoc/classes/Pho/FieldPredicateMap.html +110 -105
- data/doc/rdoc/classes/Pho/FieldWeighting.html +12 -12
- data/doc/rdoc/classes/Pho/FileManagement.html +121 -0
- data/doc/rdoc/classes/Pho/FileManagement/AbstractFileManager.html +443 -0
- data/doc/rdoc/classes/Pho/FileManagement/FileManager.html +258 -0
- data/doc/rdoc/classes/Pho/FileManagement/RDFManager.html +271 -0
- data/doc/rdoc/classes/Pho/Job.html +64 -64
- data/doc/rdoc/classes/Pho/Jobs.html +60 -60
- data/doc/rdoc/classes/Pho/QueryProfile.html +60 -60
- data/doc/rdoc/classes/Pho/RDFCollection.html +4 -378
- data/doc/rdoc/classes/Pho/ResourceHash.html +123 -0
- data/doc/rdoc/classes/Pho/ResourceHash/Converter.html +323 -0
- data/doc/rdoc/classes/Pho/{RDF_JSON → ResourceHash}/SetAlgebra.html +18 -18
- data/doc/rdoc/classes/Pho/Snapshot.html +35 -35
- data/doc/rdoc/classes/Pho/Sparql.html +137 -0
- data/doc/rdoc/classes/Pho/Sparql/SparqlClient.html +515 -0
- data/doc/rdoc/classes/Pho/Sparql/SparqlHelper.html +575 -0
- data/doc/rdoc/classes/Pho/Status.html +26 -26
- data/doc/rdoc/classes/Pho/Store.html +271 -241
- data/doc/rdoc/classes/Pho/Update/Changeset.html +73 -73
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +34 -34
- data/doc/rdoc/classes/Pho/Update/Changesets.html +14 -14
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +31 -23
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +45 -21
- data/doc/rdoc/classes/Pho/Update/Statement.html +29 -29
- data/doc/rdoc/classes/String.html +1 -1
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +49 -3
- data/doc/rdoc/files/README.html +15 -1
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/changeset_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/converter_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/enrichment_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/etags_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/field_predicate_map_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/file_management_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/file_manager_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/rdf_collection_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/resource_hash_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/{rdf_json_rb.html → sparql_rb.html} +4 -4
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +7 -2
- data/doc/rdoc/fr_class_index.html +12 -2
- data/doc/rdoc/fr_file_index.html +6 -1
- data/doc/rdoc/fr_method_index.html +176 -139
- data/examples/sparql_construct_hash.rb +26 -0
- data/examples/sparql_select.rb +18 -0
- data/lib/pho.rb +6 -1
- data/lib/pho/changeset.rb +24 -9
- data/lib/pho/changeset_builder.rb +10 -10
- data/lib/pho/converter.rb +74 -0
- data/lib/pho/enrichment.rb +81 -0
- data/lib/pho/etags.rb +1 -0
- data/lib/pho/field_predicate_map.rb +6 -1
- data/lib/pho/file_management.rb +102 -0
- data/lib/pho/file_manager.rb +61 -0
- data/lib/pho/rdf_collection.rb +54 -120
- data/lib/pho/{rdf_json.rb → resource_hash.rb} +3 -4
- data/lib/pho/sparql.rb +332 -0
- data/lib/pho/store.rb +20 -14
- data/tests/tc_changeset.rb +46 -0
- data/tests/tc_changeset_builder.rb +122 -1
- data/tests/tc_converter.rb +95 -0
- data/tests/tc_enrichment.rb +83 -0
- data/tests/tc_file_manager.rb +88 -0
- data/tests/tc_rdf_collection.rb +3 -0
- data/tests/{tc_rdf_json.rb → tc_resource_hash.rb} +23 -23
- data/tests/tc_search.rb +1 -1
- data/tests/tc_sparql.rb +131 -6
- data/tests/tc_sparql_helper.rb +214 -0
- data/tests/ts_pho.rb +6 -2
- metadata +47 -8
@@ -0,0 +1,123 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Pho::ResourceHash</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::ResourceHash</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/pho/converter_rb.html">
|
59
|
+
lib/pho/converter.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../../files/lib/pho/resource_hash_rb.html">
|
63
|
+
lib/pho/resource_hash.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
</table>
|
70
|
+
</div>
|
71
|
+
<!-- banner header -->
|
72
|
+
|
73
|
+
<div id="bodyContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<div id="contextContent">
|
78
|
+
|
79
|
+
<div id="description">
|
80
|
+
<p>
|
81
|
+
Module providing code for manipulating resource hashes structured according
|
82
|
+
to the RDF in JSON spec
|
83
|
+
</p>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
<!-- if includes -->
|
95
|
+
|
96
|
+
<div id="section">
|
97
|
+
|
98
|
+
<div id="class-list">
|
99
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
100
|
+
|
101
|
+
Class <a href="ResourceHash/Converter.html" class="link">Pho::ResourceHash::Converter</a><br />
|
102
|
+
Class <a href="ResourceHash/SetAlgebra.html" class="link">Pho::ResourceHash::SetAlgebra</a><br />
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<!-- if method_list -->
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
<div id="validator-badges">
|
119
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</body>
|
123
|
+
</html>
|
@@ -0,0 +1,323 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Pho::ResourceHash::Converter</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Pho::ResourceHash::Converter</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/pho/converter_rb.html">
|
59
|
+
lib/pho/converter.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
Class for converting to and from resource hashes
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div id="method-list">
|
92
|
+
<h3 class="section-bar">Methods</h3>
|
93
|
+
|
94
|
+
<div class="name-list">
|
95
|
+
<a href="#M000077">parse</a>
|
96
|
+
<a href="#M000073">parse_json</a>
|
97
|
+
<a href="#M000075">parse_ntriples</a>
|
98
|
+
<a href="#M000074">parse_rdfxml</a>
|
99
|
+
<a href="#M000076">parse_turtle</a>
|
100
|
+
<a href="#M000078">serialize_json</a>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if includes -->
|
108
|
+
|
109
|
+
<div id="section">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
<!-- if method_list -->
|
119
|
+
<div id="methods">
|
120
|
+
<h3 class="section-bar">Public Class methods</h3>
|
121
|
+
|
122
|
+
<div id="method-M000077" class="method-detail">
|
123
|
+
<a name="M000077"></a>
|
124
|
+
|
125
|
+
<div class="method-heading">
|
126
|
+
<a href="#M000077" class="method-signature">
|
127
|
+
<span class="method-name">parse</span><span class="method-args">(data, base_uri, format="rdfxml")</span>
|
128
|
+
</a>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div class="method-description">
|
132
|
+
<p>
|
133
|
+
Convert specified format into a <a
|
134
|
+
href="../ResourceHash.html">ResourceHash</a>
|
135
|
+
</p>
|
136
|
+
<pre>
|
137
|
+
format:: one of rdfxml, ntriples, turtle
|
138
|
+
data:: String containing the data to be parsed
|
139
|
+
base_uri:: base uri of the data
|
140
|
+
</pre>
|
141
|
+
<p><a class="source-toggle" href="#"
|
142
|
+
onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
|
143
|
+
<div class="method-source-code" id="M000077-source">
|
144
|
+
<pre>
|
145
|
+
<span class="ruby-comment cmt"># File lib/pho/converter.rb, line 48</span>
|
146
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">base_uri</span>, <span class="ruby-identifier">format</span>=<span class="ruby-value str">"rdfxml"</span>)
|
147
|
+
<span class="ruby-identifier">model</span> = <span class="ruby-constant">Redland</span><span class="ruby-operator">::</span><span class="ruby-constant">Model</span>.<span class="ruby-identifier">new</span>()
|
148
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">format</span>
|
149
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">"rdfxml"</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">mime</span>=<span class="ruby-value str">"application/rdf+xml"</span>
|
150
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">"json"</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">mime</span>=<span class="ruby-value str">"application/json"</span>
|
151
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-identifier">mime</span>=<span class="ruby-value str">""</span>
|
152
|
+
<span class="ruby-keyword kw">end</span>
|
153
|
+
|
154
|
+
<span class="ruby-identifier">parser</span> = <span class="ruby-constant">Redland</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">format</span>, <span class="ruby-identifier">mime</span>)
|
155
|
+
<span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse_string_into_model</span>(<span class="ruby-identifier">model</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">base_uri</span>)
|
156
|
+
<span class="ruby-identifier">serializer</span> = <span class="ruby-constant">Redland</span><span class="ruby-operator">::</span><span class="ruby-constant">Serializer</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">"json"</span>, <span class="ruby-value str">"application/json"</span> )
|
157
|
+
<span class="ruby-identifier">json</span> = <span class="ruby-identifier">serializer</span>.<span class="ruby-identifier">model_to_string</span>(<span class="ruby-constant">Redland</span><span class="ruby-operator">::</span><span class="ruby-constant">Uri</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">base_uri</span>), <span class="ruby-identifier">model</span>)
|
158
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse_json</span>( <span class="ruby-identifier">json</span> )
|
159
|
+
<span class="ruby-keyword kw">end</span>
|
160
|
+
</pre>
|
161
|
+
</div>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div id="method-M000073" class="method-detail">
|
166
|
+
<a name="M000073"></a>
|
167
|
+
|
168
|
+
<div class="method-heading">
|
169
|
+
<a href="#M000073" class="method-signature">
|
170
|
+
<span class="method-name">parse_json</span><span class="method-args">(json)</span>
|
171
|
+
</a>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<div class="method-description">
|
175
|
+
<p>
|
176
|
+
Parse JSON structured according to the RDF-in-JSON specification into a
|
177
|
+
Ruby resource hash. Simply invokes the JSON parser.
|
178
|
+
</p>
|
179
|
+
<pre>
|
180
|
+
json:: valid RDF-in-JSON
|
181
|
+
</pre>
|
182
|
+
<p><a class="source-toggle" href="#"
|
183
|
+
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
184
|
+
<div class="method-source-code" id="M000073-source">
|
185
|
+
<pre>
|
186
|
+
<span class="ruby-comment cmt"># File lib/pho/converter.rb, line 18</span>
|
187
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse_json</span>(<span class="ruby-identifier">json</span>)
|
188
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">json</span>)
|
189
|
+
<span class="ruby-keyword kw">end</span>
|
190
|
+
</pre>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div id="method-M000075" class="method-detail">
|
196
|
+
<a name="M000075"></a>
|
197
|
+
|
198
|
+
<div class="method-heading">
|
199
|
+
<a href="#M000075" class="method-signature">
|
200
|
+
<span class="method-name">parse_ntriples</span><span class="method-args">(ntriples, base_uri)</span>
|
201
|
+
</a>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
<div class="method-description">
|
205
|
+
<p>
|
206
|
+
Parse a string containing N-Triples into a resource hash
|
207
|
+
</p>
|
208
|
+
<pre>
|
209
|
+
ntriples:: a String containing N-Triples
|
210
|
+
</pre>
|
211
|
+
<p><a class="source-toggle" href="#"
|
212
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
213
|
+
<div class="method-source-code" id="M000075-source">
|
214
|
+
<pre>
|
215
|
+
<span class="ruby-comment cmt"># File lib/pho/converter.rb, line 32</span>
|
216
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse_ntriples</span>(<span class="ruby-identifier">ntriples</span>, <span class="ruby-identifier">base_uri</span>)
|
217
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">ntriples</span>, <span class="ruby-identifier">base_uri</span>, <span class="ruby-value str">"ntriples"</span>)
|
218
|
+
<span class="ruby-keyword kw">end</span>
|
219
|
+
</pre>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<div id="method-M000074" class="method-detail">
|
225
|
+
<a name="M000074"></a>
|
226
|
+
|
227
|
+
<div class="method-heading">
|
228
|
+
<a href="#M000074" class="method-signature">
|
229
|
+
<span class="method-name">parse_rdfxml</span><span class="method-args">(rdfxml, base_uri)</span>
|
230
|
+
</a>
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="method-description">
|
234
|
+
<p>
|
235
|
+
Parse a string containing RDF/XML into a resource hash
|
236
|
+
</p>
|
237
|
+
<pre>
|
238
|
+
rdfxml: a String containing RDF/XML
|
239
|
+
</pre>
|
240
|
+
<p><a class="source-toggle" href="#"
|
241
|
+
onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
|
242
|
+
<div class="method-source-code" id="M000074-source">
|
243
|
+
<pre>
|
244
|
+
<span class="ruby-comment cmt"># File lib/pho/converter.rb, line 25</span>
|
245
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse_rdfxml</span>(<span class="ruby-identifier">rdfxml</span>, <span class="ruby-identifier">base_uri</span>)
|
246
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">rdfxml</span>, <span class="ruby-identifier">base_uri</span>, <span class="ruby-value str">"rdfxml"</span>)
|
247
|
+
<span class="ruby-keyword kw">end</span>
|
248
|
+
</pre>
|
249
|
+
</div>
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div id="method-M000076" class="method-detail">
|
254
|
+
<a name="M000076"></a>
|
255
|
+
|
256
|
+
<div class="method-heading">
|
257
|
+
<a href="#M000076" class="method-signature">
|
258
|
+
<span class="method-name">parse_turtle</span><span class="method-args">(turtle, base_uri)</span>
|
259
|
+
</a>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div class="method-description">
|
263
|
+
<p>
|
264
|
+
Parse a string containing Turtle into a resource hash
|
265
|
+
</p>
|
266
|
+
<pre>
|
267
|
+
ntriples:: a String containing Turtle
|
268
|
+
</pre>
|
269
|
+
<p><a class="source-toggle" href="#"
|
270
|
+
onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
|
271
|
+
<div class="method-source-code" id="M000076-source">
|
272
|
+
<pre>
|
273
|
+
<span class="ruby-comment cmt"># File lib/pho/converter.rb, line 39</span>
|
274
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse_turtle</span>(<span class="ruby-identifier">turtle</span>, <span class="ruby-identifier">base_uri</span>)
|
275
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">turtle</span>, <span class="ruby-identifier">base_uri</span>, <span class="ruby-value str">"turtle"</span>)
|
276
|
+
<span class="ruby-keyword kw">end</span>
|
277
|
+
</pre>
|
278
|
+
</div>
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
<div id="method-M000078" class="method-detail">
|
283
|
+
<a name="M000078"></a>
|
284
|
+
|
285
|
+
<div class="method-heading">
|
286
|
+
<a href="#M000078" class="method-signature">
|
287
|
+
<span class="method-name">serialize_json</span><span class="method-args">(hash)</span>
|
288
|
+
</a>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
<div class="method-description">
|
292
|
+
<p>
|
293
|
+
Serialize a resource hash as RDF-in-JSON
|
294
|
+
</p>
|
295
|
+
<pre>
|
296
|
+
hash:: the resource hash to serialize
|
297
|
+
</pre>
|
298
|
+
<p><a class="source-toggle" href="#"
|
299
|
+
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
|
300
|
+
<div class="method-source-code" id="M000078-source">
|
301
|
+
<pre>
|
302
|
+
<span class="ruby-comment cmt"># File lib/pho/converter.rb, line 66</span>
|
303
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Converter</span>.<span class="ruby-identifier">serialize_json</span>(<span class="ruby-identifier">hash</span>)
|
304
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">hash</span>)
|
305
|
+
<span class="ruby-keyword kw">end</span>
|
306
|
+
</pre>
|
307
|
+
</div>
|
308
|
+
</div>
|
309
|
+
</div>
|
310
|
+
|
311
|
+
|
312
|
+
</div>
|
313
|
+
|
314
|
+
|
315
|
+
</div>
|
316
|
+
|
317
|
+
|
318
|
+
<div id="validator-badges">
|
319
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
</body>
|
323
|
+
</html>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>Class: Pho::
|
8
|
+
<title>Class: Pho::ResourceHash::SetAlgebra</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
11
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -50,13 +50,13 @@
|
|
50
50
|
<table class="header-table">
|
51
51
|
<tr class="top-aligned-row">
|
52
52
|
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Pho::
|
53
|
+
<td class="class-name-in-header">Pho::ResourceHash::SetAlgebra</td>
|
54
54
|
</tr>
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../../files/lib/pho/
|
59
|
-
lib/pho/
|
58
|
+
<a href="../../../files/lib/pho/resource_hash_rb.html">
|
59
|
+
lib/pho/resource_hash.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -92,8 +92,8 @@ Class providing set algebra methods over triple hashes
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
93
93
|
|
94
94
|
<div class="name-list">
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
95
|
+
<a href="#M000079">minus</a>
|
96
|
+
<a href="#M000080">object_in_array?</a>
|
97
97
|
</div>
|
98
98
|
</div>
|
99
99
|
|
@@ -115,11 +115,11 @@ Class providing set algebra methods over triple hashes
|
|
115
115
|
<div id="methods">
|
116
116
|
<h3 class="section-bar">Public Class methods</h3>
|
117
117
|
|
118
|
-
<div id="method-
|
119
|
-
<a name="
|
118
|
+
<div id="method-M000079" class="method-detail">
|
119
|
+
<a name="M000079"></a>
|
120
120
|
|
121
121
|
<div class="method-heading">
|
122
|
-
<a href="#
|
122
|
+
<a href="#M000079" class="method-signature">
|
123
123
|
<span class="method-name">minus</span><span class="method-args">(first, second)</span>
|
124
124
|
</a>
|
125
125
|
</div>
|
@@ -138,10 +138,10 @@ first graph but which are not present in the second.
|
|
138
138
|
second:: the second graph.
|
139
139
|
</pre>
|
140
140
|
<p><a class="source-toggle" href="#"
|
141
|
-
onclick="toggleCode('
|
142
|
-
<div class="method-source-code" id="
|
141
|
+
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
|
142
|
+
<div class="method-source-code" id="M000079-source">
|
143
143
|
<pre>
|
144
|
-
<span class="ruby-comment cmt"># File lib/pho/
|
144
|
+
<span class="ruby-comment cmt"># File lib/pho/resource_hash.rb, line 20</span>
|
145
145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">SetAlgebra</span>.<span class="ruby-identifier">minus</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">second</span>)
|
146
146
|
|
147
147
|
<span class="ruby-identifier">difference</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
@@ -182,11 +182,11 @@ first graph but which are not present in the second.
|
|
182
182
|
</div>
|
183
183
|
</div>
|
184
184
|
|
185
|
-
<div id="method-
|
186
|
-
<a name="
|
185
|
+
<div id="method-M000080" class="method-detail">
|
186
|
+
<a name="M000080"></a>
|
187
187
|
|
188
188
|
<div class="method-heading">
|
189
|
-
<a href="#
|
189
|
+
<a href="#M000080" class="method-signature">
|
190
190
|
<span class="method-name">object_in_array?</span><span class="method-args">(array, val)</span>
|
191
191
|
</a>
|
192
192
|
</div>
|
@@ -197,10 +197,10 @@ Is there an object in the specified array, that matches the provided
|
|
197
197
|
description
|
198
198
|
</p>
|
199
199
|
<p><a class="source-toggle" href="#"
|
200
|
-
onclick="toggleCode('
|
201
|
-
<div class="method-source-code" id="
|
200
|
+
onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
|
201
|
+
<div class="method-source-code" id="M000080-source">
|
202
202
|
<pre>
|
203
|
-
<span class="ruby-comment cmt"># File lib/pho/
|
203
|
+
<span class="ruby-comment cmt"># File lib/pho/resource_hash.rb, line 57</span>
|
204
204
|
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">SetAlgebra</span>.<span class="ruby-identifier">object_in_array?</span>(<span class="ruby-identifier">array</span>, <span class="ruby-identifier">val</span>)
|
205
205
|
<span class="ruby-identifier">array</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
|
206
206
|
|