pho 0.4 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +12 -1
- data/Rakefile +2 -2
- data/doc/index.html +15 -1
- data/doc/rdoc/classes/Pho.html +14 -0
- data/doc/rdoc/classes/Pho/DatatypeProperty.html +12 -12
- data/doc/rdoc/classes/Pho/Etags.html +36 -36
- 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 +90 -90
- data/doc/rdoc/classes/Pho/FieldWeighting.html +12 -12
- data/doc/rdoc/classes/Pho/Job.html +64 -64
- data/doc/rdoc/classes/Pho/Jobs.html +61 -61
- data/doc/rdoc/classes/Pho/Namespaces.html +6 -1
- data/doc/rdoc/classes/Pho/QueryProfile.html +61 -61
- data/doc/rdoc/classes/Pho/RDFCollection.html +71 -71
- data/doc/rdoc/classes/Pho/RDF_JSON.html +118 -0
- data/doc/rdoc/classes/Pho/RDF_JSON/SetAlgebra.html +240 -0
- data/doc/rdoc/classes/Pho/Snapshot.html +35 -35
- data/doc/rdoc/classes/Pho/Status.html +26 -26
- data/doc/rdoc/classes/Pho/Store.html +342 -264
- data/doc/rdoc/classes/Pho/Update.html +127 -0
- data/doc/rdoc/classes/Pho/Update/Changeset.html +520 -0
- data/doc/rdoc/classes/Pho/Update/ChangesetBuilder.html +330 -0
- data/doc/rdoc/classes/Pho/Update/Changesets.html +204 -0
- data/doc/rdoc/classes/Pho/Update/LiteralStatement.html +248 -0
- data/doc/rdoc/classes/Pho/Update/ResourceStatement.html +213 -0
- data/doc/rdoc/classes/Pho/Update/Statement.html +302 -0
- data/doc/rdoc/classes/String.html +146 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/CHANGES.html +33 -2
- data/doc/rdoc/files/lib/pho/changeset_builder_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/changeset_rb.html +108 -0
- data/doc/rdoc/files/lib/pho/job_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/query_profile_rb.html +1 -1
- data/doc/rdoc/files/lib/pho/rdf_json_rb.html +101 -0
- data/doc/rdoc/files/lib/pho/store_rb.html +1 -1
- data/doc/rdoc/files/lib/pho_rb.html +4 -1
- data/doc/rdoc/fr_class_index.html +10 -0
- data/doc/rdoc/fr_file_index.html +3 -0
- data/doc/rdoc/fr_method_index.html +140 -110
- data/lib/pho.rb +14 -1
- data/lib/pho/changeset.rb +312 -0
- data/lib/pho/changeset_builder.rb +118 -0
- data/lib/pho/job.rb +1 -1
- data/lib/pho/query_profile.rb +1 -1
- data/lib/pho/rdf_json.rb +81 -0
- data/lib/pho/store.rb +63 -25
- data/tests/tc_changeset.rb +273 -0
- data/tests/tc_changeset_builder.rb +151 -0
- data/tests/tc_changesets.rb +96 -0
- data/tests/tc_metabox.rb +20 -2
- data/tests/tc_query_profile.rb +4 -2
- data/tests/tc_rdf_json.rb +273 -0
- data/tests/tc_search.rb +5 -5
- data/tests/tc_sparql.rb +12 -0
- data/tests/ts_pho.rb +5 -1
- metadata +25 -3
@@ -20,116 +20,146 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/Pho/
|
24
|
-
<a href="classes/Pho/
|
25
|
-
<a href="classes/Pho/
|
26
|
-
<a href="classes/Pho/
|
27
|
-
<a href="classes/Pho/
|
28
|
-
<a href="classes/Pho/
|
29
|
-
<a href="classes/Pho/
|
30
|
-
<a href="classes/Pho/
|
31
|
-
<a href="classes/Pho/
|
32
|
-
<a href="classes/Pho/
|
33
|
-
<a href="classes/Pho/
|
34
|
-
<a href="classes/Pho/
|
35
|
-
<a href="classes/Pho/
|
36
|
-
<a href="classes/Pho/Store.html#
|
37
|
-
<a href="classes/Pho/
|
38
|
-
<a href="classes/Pho/
|
39
|
-
<a href="classes/Pho/
|
40
|
-
<a href="classes/Pho/
|
41
|
-
<a href="classes/Pho/
|
42
|
-
<a href="classes/Pho/
|
43
|
-
<a href="classes/Pho/
|
44
|
-
<a href="classes/Pho/
|
45
|
-
<a href="classes/Pho/
|
46
|
-
<a href="classes/Pho/
|
47
|
-
<a href="classes/Pho/
|
48
|
-
<a href="classes/Pho/
|
49
|
-
<a href="classes/Pho/
|
50
|
-
<a href="classes/Pho/
|
51
|
-
<a href="classes/Pho/
|
52
|
-
<a href="classes/Pho/Store.html#
|
53
|
-
<a href="classes/Pho/
|
54
|
-
<a href="classes/Pho/
|
55
|
-
<a href="classes/Pho/
|
56
|
-
<a href="classes/Pho/
|
57
|
-
<a href="classes/Pho/
|
58
|
-
<a href="classes/Pho/
|
59
|
-
<a href="classes/Pho/
|
60
|
-
<a href="classes/Pho/
|
61
|
-
<a href="classes/Pho/
|
62
|
-
<a href="classes/Pho/
|
63
|
-
<a href="classes/Pho/
|
64
|
-
<a href="classes/Pho/
|
65
|
-
<a href="classes/Pho/
|
66
|
-
<a href="classes/Pho/
|
67
|
-
<a href="classes/Pho/
|
68
|
-
<a href="classes/Pho/Store.html#
|
69
|
-
<a href="classes/Pho/
|
70
|
-
<a href="classes/Pho/
|
71
|
-
<a href="classes/Pho/
|
72
|
-
<a href="classes/Pho/
|
73
|
-
<a href="classes/Pho/
|
74
|
-
<a href="classes/Pho/
|
75
|
-
<a href="classes/Pho/
|
76
|
-
<a href="classes/Pho/
|
77
|
-
<a href="classes/Pho/
|
78
|
-
<a href="classes/Pho/
|
79
|
-
<a href="classes/Pho/
|
80
|
-
<a href="classes/Pho/Snapshot.html#
|
81
|
-
<a href="classes/Pho/
|
82
|
-
<a href="classes/Pho/
|
83
|
-
<a href="classes/Pho/
|
84
|
-
<a href="classes/Pho/
|
85
|
-
<a href="classes/Pho/
|
86
|
-
<a href="classes/Pho/
|
87
|
-
<a href="classes/Pho/
|
88
|
-
<a href="classes/Pho/
|
89
|
-
<a href="classes/Pho/
|
90
|
-
<a href="classes/Pho/
|
91
|
-
<a href="classes/Pho/
|
92
|
-
<a href="classes/Pho/
|
93
|
-
<a href="classes/Pho/
|
94
|
-
<a href="classes/Pho/
|
95
|
-
<a href="classes/Pho/
|
96
|
-
<a href="classes/Pho/
|
97
|
-
<a href="classes/Pho/Job.html#
|
98
|
-
<a href="classes/Pho/
|
99
|
-
<a href="classes/Pho/Store.html#
|
100
|
-
<a href="classes/Pho/
|
101
|
-
<a href="classes/Pho/
|
102
|
-
<a href="classes/Pho/
|
103
|
-
<a href="classes/Pho/
|
104
|
-
<a href="classes/Pho/
|
105
|
-
<a href="classes/Pho/
|
106
|
-
<a href="classes/Pho/
|
107
|
-
<a href="classes/Pho/
|
108
|
-
<a href="classes/Pho/
|
109
|
-
<a href="classes/Pho/Store.html#
|
110
|
-
<a href="classes/Pho/
|
111
|
-
<a href="classes/Pho/
|
112
|
-
<a href="classes/Pho/
|
113
|
-
<a href="classes/Pho/
|
114
|
-
<a href="classes/Pho/
|
115
|
-
<a href="classes/Pho/
|
116
|
-
<a href="classes/Pho/
|
117
|
-
<a href="classes/Pho/RDFCollection.html#
|
118
|
-
<a href="classes/Pho/Job.html#
|
119
|
-
<a href="classes/Pho/
|
120
|
-
<a href="classes/Pho/
|
121
|
-
<a href="classes/Pho/
|
122
|
-
<a href="classes/Pho/
|
123
|
-
<a href="classes/Pho/
|
124
|
-
<a href="classes/Pho/
|
125
|
-
<a href="classes/Pho/
|
126
|
-
<a href="classes/Pho/Store.html#
|
127
|
-
<a href="classes/
|
128
|
-
<a href="classes/Pho/
|
129
|
-
<a href="classes/Pho/
|
130
|
-
<a href="classes/Pho/
|
131
|
-
<a href="classes/Pho/
|
132
|
-
<a href="classes/Pho/
|
23
|
+
<a href="classes/Pho/QueryProfile.html#M000056"><< (Pho::QueryProfile)</a><br />
|
24
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000037"><< (Pho::FieldPredicateMap)</a><br />
|
25
|
+
<a href="classes/Pho/Update/ResourceStatement.html#M000010">== (Pho::Update::ResourceStatement)</a><br />
|
26
|
+
<a href="classes/Pho/Update/LiteralStatement.html#M000003">== (Pho::Update::LiteralStatement)</a><br />
|
27
|
+
<a href="classes/Pho/Etags.html#M000137">add (Pho::Etags)</a><br />
|
28
|
+
<a href="classes/Pho/Update/Changeset.html#M000022">add_addition (Pho::Update::Changeset)</a><br />
|
29
|
+
<a href="classes/Pho/Update/Changeset.html#M000023">add_additions (Pho::Update::Changeset)</a><br />
|
30
|
+
<a href="classes/Pho/Etags.html#M000138">add_from_response (Pho::Etags)</a><br />
|
31
|
+
<a href="classes/Pho/Update/Changeset.html#M000025">add_removal (Pho::Update::Changeset)</a><br />
|
32
|
+
<a href="classes/Pho/Update/Changeset.html#M000026">add_removals (Pho::Update::Changeset)</a><br />
|
33
|
+
<a href="classes/Pho/Update/Changeset.html#M000021">additions (Pho::Update::Changeset)</a><br />
|
34
|
+
<a href="classes/Pho/Update/Changesets.html#M000012">all_to_rdf (Pho::Update::Changesets)</a><br />
|
35
|
+
<a href="classes/Pho/Store.html#M000092">augment (Pho::Store)</a><br />
|
36
|
+
<a href="classes/Pho/Store.html#M000091">augment_uri (Pho::Store)</a><br />
|
37
|
+
<a href="classes/Pho/Snapshot.html#M000111">backup (Pho::Snapshot)</a><br />
|
38
|
+
<a href="classes/Pho/Update/ChangesetBuilder.html#M000006">build (Pho::Update::ChangesetBuilder)</a><br />
|
39
|
+
<a href="classes/Pho/Update/ChangesetBuilder.html#M000005">build_batch (Pho::Update::ChangesetBuilder)</a><br />
|
40
|
+
<a href="classes/Pho/Jobs.html#M000069">build_job_request (Pho::Jobs)</a><br />
|
41
|
+
<a href="classes/Pho/Store.html#M000077">build_uri (Pho::Store)</a><br />
|
42
|
+
<a href="classes/Pho/Job.html#M000117">completed? (Pho::Job)</a><br />
|
43
|
+
<a href="classes/Pho/Store.html#M000093">configure_headers_for_conditional_get (Pho::Store)</a><br />
|
44
|
+
<a href="classes/Pho/Update/Statement.html#M000014">create_literal (Pho::Update::Statement)</a><br />
|
45
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000035">create_mapping (Pho::FieldPredicateMap)</a><br />
|
46
|
+
<a href="classes/Pho/Update/Statement.html#M000015">create_resource (Pho::Update::Statement)</a><br />
|
47
|
+
<a href="classes/Pho/Update/ChangesetBuilder.html#M000007">create_statements (Pho::Update::ChangesetBuilder)</a><br />
|
48
|
+
<a href="classes/Pho/Update/ChangesetBuilder.html#M000008">create_statements_for_uri (Pho::Update::ChangesetBuilder)</a><br />
|
49
|
+
<a href="classes/Pho/QueryProfile.html#M000054">create_weighting (Pho::QueryProfile)</a><br />
|
50
|
+
<a href="classes/Pho/Store.html#M000096">delete_item (Pho::Store)</a><br />
|
51
|
+
<a href="classes/Pho/Store.html#M000081">describe (Pho::Store)</a><br />
|
52
|
+
<a href="classes/Pho/Store.html#M000089">facet (Pho::Store)</a><br />
|
53
|
+
<a href="classes/Pho/RDFCollection.html#M000129">failures (Pho::RDFCollection)</a><br />
|
54
|
+
<a href="classes/Pho/Etags.html#M000139">get (Pho::Etags)</a><br />
|
55
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000042">get_by_name (Pho::FieldPredicateMap)</a><br />
|
56
|
+
<a href="classes/Pho/QueryProfile.html#M000057">get_by_name (Pho::QueryProfile)</a><br />
|
57
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000043">get_by_uri (Pho::FieldPredicateMap)</a><br />
|
58
|
+
<a href="classes/Pho/RDFCollection.html#M000133">get_fail_file_for (Pho::RDFCollection)</a><br />
|
59
|
+
<a href="classes/Pho/Store.html#M000103">get_field_predicate_map (Pho::Store)</a><br />
|
60
|
+
<a href="classes/Pho/Store.html#M000097">get_item (Pho::Store)</a><br />
|
61
|
+
<a href="classes/Pho/Store.html#M000098">get_job (Pho::Store)</a><br />
|
62
|
+
<a href="classes/Pho/Store.html#M000099">get_jobs (Pho::Store)</a><br />
|
63
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000038">get_name (Pho::FieldPredicateMap)</a><br />
|
64
|
+
<a href="classes/Pho/RDFCollection.html#M000134">get_ok_file_for (Pho::RDFCollection)</a><br />
|
65
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000039">get_property_uri (Pho::FieldPredicateMap)</a><br />
|
66
|
+
<a href="classes/Pho/Store.html#M000105">get_query_profile (Pho::Store)</a><br />
|
67
|
+
<a href="classes/Pho/Store.html#M000090">get_search_params (Pho::Store)</a><br />
|
68
|
+
<a href="classes/Pho/Store.html#M000102">get_snapshots (Pho::Store)</a><br />
|
69
|
+
<a href="classes/Pho/Store.html#M000101">get_status (Pho::Store)</a><br />
|
70
|
+
<a href="classes/Pho/Etags.html#M000140">has_tag? (Pho::Etags)</a><br />
|
71
|
+
<a href="classes/Pho/RDFCollection.html#M000128">list (Pho::RDFCollection)</a><br />
|
72
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000040">mapped_name? (Pho::FieldPredicateMap)</a><br />
|
73
|
+
<a href="classes/Pho/QueryProfile.html#M000060">mapped_name? (Pho::QueryProfile)</a><br />
|
74
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000041">mapped_uri? (Pho::FieldPredicateMap)</a><br />
|
75
|
+
<a href="classes/Pho/RDF_JSON/SetAlgebra.html#M000032">minus (Pho::RDF_JSON::SetAlgebra)</a><br />
|
76
|
+
<a href="classes/Pho/Status.html#M000049">new (Pho::Status)</a><br />
|
77
|
+
<a href="classes/Pho/QueryProfile.html#M000055">new (Pho::QueryProfile)</a><br />
|
78
|
+
<a href="classes/Pho/Update/ResourceStatement.html#M000009">new (Pho::Update::ResourceStatement)</a><br />
|
79
|
+
<a href="classes/Pho/FieldWeighting.html#M000122">new (Pho::FieldWeighting)</a><br />
|
80
|
+
<a href="classes/Pho/Snapshot.html#M000109">new (Pho::Snapshot)</a><br />
|
81
|
+
<a href="classes/Pho/Store.html#M000075">new (Pho::Store)</a><br />
|
82
|
+
<a href="classes/Pho/RDFCollection.html#M000124">new (Pho::RDFCollection)</a><br />
|
83
|
+
<a href="classes/Pho/Facet/Term.html#M000031">new (Pho::Facet::Term)</a><br />
|
84
|
+
<a href="classes/Pho/Update/Statement.html#M000017">new (Pho::Update::Statement)</a><br />
|
85
|
+
<a href="classes/Pho/Update/LiteralStatement.html#M000002">new (Pho::Update::LiteralStatement)</a><br />
|
86
|
+
<a href="classes/Pho/DatatypeProperty.html#M000073">new (Pho::DatatypeProperty)</a><br />
|
87
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000036">new (Pho::FieldPredicateMap)</a><br />
|
88
|
+
<a href="classes/Pho/Facet/Results.html#M000028">new (Pho::Facet::Results)</a><br />
|
89
|
+
<a href="classes/Pho/Etags.html#M000135">new (Pho::Etags)</a><br />
|
90
|
+
<a href="classes/Pho/Update/Changeset.html#M000018">new (Pho::Update::Changeset)</a><br />
|
91
|
+
<a href="classes/Pho/Job.html#M000112">new (Pho::Job)</a><br />
|
92
|
+
<a href="classes/Pho/RDFCollection.html#M000131">new_files (Pho::RDFCollection)</a><br />
|
93
|
+
<a href="classes/Pho/RDF_JSON/SetAlgebra.html#M000033">object_in_array? (Pho::RDF_JSON::SetAlgebra)</a><br />
|
94
|
+
<a href="classes/Pho/Facet/Results.html#M000030">parse (Pho::Facet::Results)</a><br />
|
95
|
+
<a href="classes/Pho/Snapshot.html#M000108">parse (Pho::Snapshot)</a><br />
|
96
|
+
<a href="classes/Pho/Job.html#M000114">parse (Pho::Job)</a><br />
|
97
|
+
<a href="classes/Pho/Job.html#M000115">progress_updates (Pho::Job)</a><br />
|
98
|
+
<a href="classes/Pho/Store.html#M000104">put_field_predicate_map (Pho::Store)</a><br />
|
99
|
+
<a href="classes/Pho/Store.html#M000106">put_query_profile (Pho::Store)</a><br />
|
100
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000034">read_from_store (Pho::FieldPredicateMap)</a><br />
|
101
|
+
<a href="classes/Pho/QueryProfile.html#M000053">read_from_store (Pho::QueryProfile)</a><br />
|
102
|
+
<a href="classes/Pho/Snapshot.html#M000107">read_from_store (Pho::Snapshot)</a><br />
|
103
|
+
<a href="classes/Pho/Jobs.html#M000063">read_from_store (Pho::Jobs)</a><br />
|
104
|
+
<a href="classes/Pho/Status.html#M000050">read_from_store (Pho::Status)</a><br />
|
105
|
+
<a href="classes/Pho/Job.html#M000113">read_from_store (Pho::Job)</a><br />
|
106
|
+
<a href="classes/Pho/Facet/Results.html#M000029">read_from_store (Pho::Facet::Results)</a><br />
|
107
|
+
<a href="classes/Pho/Snapshot.html#M000110">read_md5 (Pho::Snapshot)</a><br />
|
108
|
+
<a href="classes/Pho/Status.html#M000051">readable? (Pho::Status)</a><br />
|
109
|
+
<a href="classes/Pho/Store.html#M000094">record_etags (Pho::Store)</a><br />
|
110
|
+
<a href="classes/Pho/Update/Changeset.html#M000024">removals (Pho::Update::Changeset)</a><br />
|
111
|
+
<a href="classes/Pho/QueryProfile.html#M000059">remove (Pho::QueryProfile)</a><br />
|
112
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000044">remove (Pho::FieldPredicateMap)</a><br />
|
113
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000045">remove_by_name (Pho::FieldPredicateMap)</a><br />
|
114
|
+
<a href="classes/Pho/QueryProfile.html#M000058">remove_by_name (Pho::QueryProfile)</a><br />
|
115
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000046">remove_by_uri (Pho::FieldPredicateMap)</a><br />
|
116
|
+
<a href="classes/Pho/RDFCollection.html#M000127">reset (Pho::RDFCollection)</a><br />
|
117
|
+
<a href="classes/Pho/RDFCollection.html#M000126">retry_failures (Pho::RDFCollection)</a><br />
|
118
|
+
<a href="classes/Pho/Job.html#M000119">running? (Pho::Job)</a><br />
|
119
|
+
<a href="classes/Pho/Etags.html#M000136">save (Pho::Etags)</a><br />
|
120
|
+
<a href="classes/Pho/Store.html#M000088">search (Pho::Store)</a><br />
|
121
|
+
<a href="classes/Pho/Store.html#M000076">set_credentials (Pho::Store)</a><br />
|
122
|
+
<a href="classes/Pho/Store.html#M000087">sparql (Pho::Store)</a><br />
|
123
|
+
<a href="classes/Pho/Store.html#M000085">sparql_ask (Pho::Store)</a><br />
|
124
|
+
<a href="classes/Pho/Store.html#M000084">sparql_construct (Pho::Store)</a><br />
|
125
|
+
<a href="classes/Pho/Store.html#M000083">sparql_describe (Pho::Store)</a><br />
|
126
|
+
<a href="classes/Pho/Store.html#M000086">sparql_select (Pho::Store)</a><br />
|
127
|
+
<a href="classes/String.html#M000001">start_with? (String)</a><br />
|
128
|
+
<a href="classes/Pho/Job.html#M000116">started? (Pho::Job)</a><br />
|
129
|
+
<a href="classes/Pho/RDFCollection.html#M000125">store (Pho::RDFCollection)</a><br />
|
130
|
+
<a href="classes/Pho/Store.html#M000078">store_data (Pho::Store)</a><br />
|
131
|
+
<a href="classes/Pho/Store.html#M000079">store_file (Pho::Store)</a><br />
|
132
|
+
<a href="classes/Pho/Store.html#M000080">store_url (Pho::Store)</a><br />
|
133
|
+
<a href="classes/Pho/Update/Changeset.html#M000027">submit (Pho::Update::Changeset)</a><br />
|
134
|
+
<a href="classes/Pho/Update/Changesets.html#M000013">submit_all (Pho::Update::Changesets)</a><br />
|
135
|
+
<a href="classes/Pho/Store.html#M000082">submit_changeset (Pho::Store)</a><br />
|
136
|
+
<a href="classes/Pho/Store.html#M000100">submit_job (Pho::Store)</a><br />
|
137
|
+
<a href="classes/Pho/Jobs.html#M000068">submit_job (Pho::Jobs)</a><br />
|
138
|
+
<a href="classes/Pho/Jobs.html#M000065">submit_reindex (Pho::Jobs)</a><br />
|
139
|
+
<a href="classes/Pho/Jobs.html#M000064">submit_reset (Pho::Jobs)</a><br />
|
140
|
+
<a href="classes/Pho/Jobs.html#M000067">submit_restore (Pho::Jobs)</a><br />
|
141
|
+
<a href="classes/Pho/Jobs.html#M000066">submit_snapshot (Pho::Jobs)</a><br />
|
142
|
+
<a href="classes/Pho/RDFCollection.html#M000130">successes (Pho::RDFCollection)</a><br />
|
143
|
+
<a href="classes/Pho/Job.html#M000118">successful? (Pho::Job)</a><br />
|
144
|
+
<a href="classes/Pho/RDFCollection.html#M000132">summary (Pho::RDFCollection)</a><br />
|
145
|
+
<a href="classes/Pho/FieldWeighting.html#M000123">to_rdf (Pho::FieldWeighting)</a><br />
|
146
|
+
<a href="classes/Pho/QueryProfile.html#M000061">to_rdf (Pho::QueryProfile)</a><br />
|
147
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000047">to_rdf (Pho::FieldPredicateMap)</a><br />
|
148
|
+
<a href="classes/Pho/Update/Statement.html#M000016">to_rdf (Pho::Update::Statement)</a><br />
|
149
|
+
<a href="classes/Pho/Update/Changeset.html#M000020">to_rdf (Pho::Update::Changeset)</a><br />
|
150
|
+
<a href="classes/Pho/DatatypeProperty.html#M000074">to_rdf (Pho::DatatypeProperty)</a><br />
|
151
|
+
<a href="classes/Pho/Update/Changeset.html#M000019">to_s (Pho::Update::Changeset)</a><br />
|
152
|
+
<a href="classes/Pho/QueryProfile.html#M000062">upload (Pho::QueryProfile)</a><br />
|
153
|
+
<a href="classes/Pho/FieldPredicateMap.html#M000048">upload (Pho::FieldPredicateMap)</a><br />
|
154
|
+
<a href="classes/Pho/Store.html#M000095">upload_item (Pho::Store)</a><br />
|
155
|
+
<a href="classes/Pho/Jobs.html#M000071">wait_for (Pho::Jobs)</a><br />
|
156
|
+
<a href="classes/Pho/Jobs.html#M000070">wait_for_submitted (Pho::Jobs)</a><br />
|
157
|
+
<a href="classes/Pho/Job.html#M000121">with_each (Pho::Job)</a><br />
|
158
|
+
<a href="classes/Pho/Job.html#M000120">with_first (Pho::Job)</a><br />
|
159
|
+
<a href="classes/Pho/Update/LiteralStatement.html#M000004">write_object (Pho::Update::LiteralStatement)</a><br />
|
160
|
+
<a href="classes/Pho/Update/ResourceStatement.html#M000011">write_object (Pho::Update::ResourceStatement)</a><br />
|
161
|
+
<a href="classes/Pho/Status.html#M000052">writeable? (Pho::Status)</a><br />
|
162
|
+
<a href="classes/Pho/Jobs.html#M000072">yield_job_update (Pho::Jobs)</a><br />
|
133
163
|
</div>
|
134
164
|
</div>
|
135
165
|
</body>
|
data/lib/pho.rb
CHANGED
@@ -13,6 +13,17 @@ require 'pho/status'
|
|
13
13
|
require 'pho/facet'
|
14
14
|
require 'pho/job'
|
15
15
|
require 'pho/rdf_collection'
|
16
|
+
require 'pho/rdf_json'
|
17
|
+
require 'pho/changeset_builder'
|
18
|
+
require 'pho/changeset'
|
19
|
+
|
20
|
+
if RUBY_VERSION < "1.8.7"
|
21
|
+
class String
|
22
|
+
def start_with?(prefix)
|
23
|
+
self.index(prefix) == 0
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
16
27
|
|
17
28
|
module Pho
|
18
29
|
|
@@ -30,6 +41,7 @@ module Pho
|
|
30
41
|
RDFS = "http://www.w3.org/2000/01/rdf-schema#"
|
31
42
|
DC = "http://purl.org/dc/elements/1.1/"
|
32
43
|
DC_TERMS = "http://purl.org/dc/terms/"
|
44
|
+
CHANGESET = "http://purl.org/vocab/changeset/schema#"
|
33
45
|
|
34
46
|
MAPPING = {
|
35
47
|
"bf" => CONFIG,
|
@@ -37,7 +49,8 @@ module Pho
|
|
37
49
|
"rdf" => RDF,
|
38
50
|
"rdfs" => RDFS,
|
39
51
|
"dc" => DC,
|
40
|
-
"dcterms" => DC_TERMS
|
52
|
+
"dcterms" => DC_TERMS,
|
53
|
+
"cs" => CHANGESET
|
41
54
|
}
|
42
55
|
|
43
56
|
end
|
@@ -0,0 +1,312 @@
|
|
1
|
+
module Pho
|
2
|
+
|
3
|
+
# Previous changeset
|
4
|
+
# Identifier for changeset?
|
5
|
+
# Blank nodes
|
6
|
+
# Convenience functions for adding/removing lists?
|
7
|
+
|
8
|
+
require 'uri'
|
9
|
+
|
10
|
+
#Module organizing classes related to Changeset handling.
|
11
|
+
module Update
|
12
|
+
|
13
|
+
#Base class capturing data relating to a reified RDF triple described in a Changeset
|
14
|
+
class Statement
|
15
|
+
|
16
|
+
#URI of subject
|
17
|
+
attr_reader :subject
|
18
|
+
#URI of predicate
|
19
|
+
attr_reader :predicate
|
20
|
+
#Object value. May be uri or literal
|
21
|
+
attr_reader :object
|
22
|
+
|
23
|
+
# Create a Statement referring to a literal. Can have one of lang or datatype but not both
|
24
|
+
#
|
25
|
+
# subject:: URI of subject of triple
|
26
|
+
# predicate:: URI of predicate of triple
|
27
|
+
# object:: literal value
|
28
|
+
# lang:: language for literal
|
29
|
+
# datatype:: datatype for literal
|
30
|
+
def Statement.create_literal(subject, predicate, object, lang=nil, datatype=nil)
|
31
|
+
return LiteralStatement.new(subject, predicate, object, lang, datatype)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create a Statement referring to a resource
|
35
|
+
#
|
36
|
+
# subject:: URI of subject of triple
|
37
|
+
# predicate:: URI of predicate of triple
|
38
|
+
# object:: resource uri
|
39
|
+
def Statement.create_resource(subject, predicate, object)
|
40
|
+
return ResourceStatement.new(subject, predicate, object)
|
41
|
+
end
|
42
|
+
|
43
|
+
#Create an RDF/XML fragment describing this Statement
|
44
|
+
def to_rdf()
|
45
|
+
rdf = "<rdf:Statement>"
|
46
|
+
rdf << " <rdf:subject rdf:resource=\"#{@subject}\"/>"
|
47
|
+
rdf << " <rdf:predicate rdf:resource=\"#{@predicate}\"/>"
|
48
|
+
rdf << write_object()
|
49
|
+
rdf << "</rdf:Statement>"
|
50
|
+
return rdf
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
# subject:: URI of subject of triple
|
56
|
+
# predicate:: URI of predicate of triple
|
57
|
+
# object:: object value of triple (may be URI or literal)
|
58
|
+
def initialize(subject, predicate, object)
|
59
|
+
@subject = subject
|
60
|
+
@predicate = predicate
|
61
|
+
@object = object
|
62
|
+
end
|
63
|
+
|
64
|
+
class << self
|
65
|
+
protected :new
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
class LiteralStatement < Statement
|
70
|
+
|
71
|
+
#Language for literals
|
72
|
+
attr_reader :language
|
73
|
+
#Datatype for literals
|
74
|
+
attr_reader :datatype
|
75
|
+
|
76
|
+
# Create a Statement referring to a literal. Can have one of lang or datatype but not both
|
77
|
+
#
|
78
|
+
# subject:: URI of subject of triple
|
79
|
+
# predicate:: URI of predicate of triple
|
80
|
+
# object:: literal value
|
81
|
+
# lang:: language for literal
|
82
|
+
# datatype:: datatype for literal
|
83
|
+
def initialize(subject, predicate, object, language=nil, datatype=nil)
|
84
|
+
super(subject, predicate, object)
|
85
|
+
if language != nil && datatype != nil
|
86
|
+
raise "Cannot specify both language and datatype for a literal"
|
87
|
+
end
|
88
|
+
@language = language
|
89
|
+
@datatype = datatype
|
90
|
+
end
|
91
|
+
|
92
|
+
def ==(other)
|
93
|
+
if other == nil
|
94
|
+
return false
|
95
|
+
end
|
96
|
+
return @subject == other.subject &&
|
97
|
+
@predicate == other.predicate &&
|
98
|
+
@object == other.object &&
|
99
|
+
@lang == other.language &&
|
100
|
+
@datatype == other.datatype
|
101
|
+
end
|
102
|
+
|
103
|
+
protected
|
104
|
+
def write_object()
|
105
|
+
#FIXME language and datatype
|
106
|
+
"<rdf:object>#{@object}</rdf:object>"
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
class ResourceStatement < Statement
|
111
|
+
# Create a Statement referring to a resource
|
112
|
+
#
|
113
|
+
# subject:: URI of subject of triple
|
114
|
+
# predicate:: URI of predicate of triple
|
115
|
+
# object:: resource uri
|
116
|
+
def initialize(subject, predicate, object)
|
117
|
+
super(subject, predicate, object)
|
118
|
+
end
|
119
|
+
|
120
|
+
def ==(other)
|
121
|
+
if other == nil
|
122
|
+
return false
|
123
|
+
end
|
124
|
+
return @subject == other.subject &&
|
125
|
+
@predicate == other.predicate &&
|
126
|
+
@object == other.object
|
127
|
+
end
|
128
|
+
|
129
|
+
protected
|
130
|
+
def write_object()
|
131
|
+
"<rdf:object rdf:resource=\"#{@object}\"/>"
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
#The Changesets class provides utility methods for manipulating and generating
|
136
|
+
#collections of Changeset objects
|
137
|
+
class Changesets
|
138
|
+
|
139
|
+
#Convert an array of changesets into an RDF/XML document
|
140
|
+
#
|
141
|
+
# changesets:: an array of changesets
|
142
|
+
def Changesets.all_to_rdf(changesets)
|
143
|
+
rdf = "<rdf:RDF xmlns:cs=\"http://purl.org/vocab/changeset/schema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">"
|
144
|
+
changesets.each do |cs|
|
145
|
+
rdf << cs.to_rdf(false)
|
146
|
+
end
|
147
|
+
rdf << "</rdf:RDF>"
|
148
|
+
end
|
149
|
+
|
150
|
+
#Submit an array of changests to the Platform. After first converting them to
|
151
|
+
#an RDF/XML document.
|
152
|
+
#
|
153
|
+
# Note that this submits all of the changessets in a single request to the Platform
|
154
|
+
# If the changeset is too large then it may be rejected. Similarly the Platform may
|
155
|
+
# respond with a 202 Accepted status if the data is to be processed asynchronously;
|
156
|
+
# again that depends on the size of the changes.
|
157
|
+
#
|
158
|
+
# changesets:: an array of changesets
|
159
|
+
# store:: the store to submit the changesets to
|
160
|
+
# versioned:: whether this is a versioned changed. Versioned Changesets must have
|
161
|
+
# change_reason and creator_name properties.
|
162
|
+
def Changesets.submit_all(changesets, store, versioned=false)
|
163
|
+
rdf = all_to_rdf(changesets)
|
164
|
+
store.submit_changeset(rdf, versioned)
|
165
|
+
end
|
166
|
+
|
167
|
+
# Build a changeset by comparing two Ruby hashes
|
168
|
+
#
|
169
|
+
# subject_of_change:: URI of resource being changed
|
170
|
+
# before_model:: hash containing RDF before change. Organized as RDF/JSON
|
171
|
+
# after_model:: hash containing RDF after change. Organized as RDF/JSON
|
172
|
+
#def Changesets.build(before_model, after_model)
|
173
|
+
#
|
174
|
+
#end
|
175
|
+
|
176
|
+
end
|
177
|
+
|
178
|
+
#Models a Changeset: a delta to an RDF graph
|
179
|
+
#
|
180
|
+
#The RDF Schema for Changesets can be found at:
|
181
|
+
# http://vocab.org/changeset/schema
|
182
|
+
#
|
183
|
+
#Further reading:
|
184
|
+
# http://n2.talis.com/wiki/Changesets
|
185
|
+
#
|
186
|
+
#The Platform Changeset protocol is described at:
|
187
|
+
# http://n2.talis.com/wiki/Changeset_Protocol
|
188
|
+
#
|
189
|
+
#Processing of batch changesets is described at:
|
190
|
+
# http://n2.talis.com/wiki/Metabox
|
191
|
+
#
|
192
|
+
class Changeset
|
193
|
+
|
194
|
+
#URI of the subject of change for this changeset
|
195
|
+
attr_reader :subject_of_change
|
196
|
+
#Creator name
|
197
|
+
attr_accessor :creator_name
|
198
|
+
#Reason for the change being made
|
199
|
+
attr_accessor :change_reason
|
200
|
+
|
201
|
+
#Constructor. Parameter should be the URI of the subject of change
|
202
|
+
#
|
203
|
+
# subject_of_change:: the URI of the resource being changed
|
204
|
+
# creator_name:: the name of the creator of this change (optional)
|
205
|
+
# change_reason:: the reason for the change (optional)
|
206
|
+
def initialize(subject_of_change, creator_name=nil, change_reason=nil)
|
207
|
+
u = URI.parse(subject_of_change)
|
208
|
+
#this should catch literals
|
209
|
+
if u.scheme() == nil
|
210
|
+
raise URI::InvalidURIError.new("Invalid URI")
|
211
|
+
end
|
212
|
+
@subject_of_change = subject_of_change
|
213
|
+
@creator_name = creator_name
|
214
|
+
@change_reason = change_reason
|
215
|
+
@additions = Array.new
|
216
|
+
@removals = Array.new
|
217
|
+
yield self if block_given?
|
218
|
+
end
|
219
|
+
|
220
|
+
def to_s
|
221
|
+
return to_rdf
|
222
|
+
end
|
223
|
+
|
224
|
+
#Serialize this changeset as RDF/XML suitable for submitting to the Platform.
|
225
|
+
def to_rdf(include_root=true)
|
226
|
+
rdf = ""
|
227
|
+
if include_root
|
228
|
+
rdf << "<rdf:RDF xmlns:cs=\"http://purl.org/vocab/changeset/schema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">"
|
229
|
+
end
|
230
|
+
|
231
|
+
rdf << " <cs:ChangeSet>"
|
232
|
+
rdf << " <cs:subjectOfChange rdf:resource=\"#{@subject_of_change}\"/>"
|
233
|
+
if @creator_name
|
234
|
+
rdf << " <cs:creatorName>#{@creator_name}</cs:creatorName>"
|
235
|
+
end
|
236
|
+
if @change_reason
|
237
|
+
rdf << " <cs:changeReason>#{@change_reason}</cs:changeReason>"
|
238
|
+
end
|
239
|
+
@additions.each do |add|
|
240
|
+
rdf << " <cs:addition>"
|
241
|
+
rdf << add.to_rdf
|
242
|
+
rdf << " </cs:addition>"
|
243
|
+
end
|
244
|
+
@removals.each do |remove|
|
245
|
+
rdf << " <cs:removal>"
|
246
|
+
rdf << remove.to_rdf
|
247
|
+
rdf << " </cs:removal>"
|
248
|
+
end
|
249
|
+
|
250
|
+
rdf << " </cs:ChangeSet>"
|
251
|
+
|
252
|
+
if include_root
|
253
|
+
rdf << "</rdf:RDF>"
|
254
|
+
end
|
255
|
+
|
256
|
+
return rdf
|
257
|
+
end
|
258
|
+
|
259
|
+
#Return the Statement describing the addition in this Changeset
|
260
|
+
def additions()
|
261
|
+
return @additions
|
262
|
+
end
|
263
|
+
|
264
|
+
#Include a Statement in the Changeset as an addition
|
265
|
+
def add_addition(statement)
|
266
|
+
if statement.subject != @subject_of_change
|
267
|
+
raise "Subject of statement must match subject of change of changeset"
|
268
|
+
end
|
269
|
+
@additions << statement
|
270
|
+
end
|
271
|
+
|
272
|
+
#Add an array of statements as additions
|
273
|
+
def add_additions(statements)
|
274
|
+
statements.each do |statement|
|
275
|
+
add_addition(statement)
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
#Return the list of Statements describing the removals in this Changeset
|
280
|
+
def removals()
|
281
|
+
return @removals
|
282
|
+
end
|
283
|
+
|
284
|
+
#Include a Statement in the Changeset as a removal
|
285
|
+
def add_removal(statement)
|
286
|
+
if statement.subject != @subject_of_change
|
287
|
+
raise "Subject of statement must match subject of change of changeset"
|
288
|
+
end
|
289
|
+
@removals << statement
|
290
|
+
end
|
291
|
+
|
292
|
+
#Add an array of statements as removals
|
293
|
+
def add_removals(statements)
|
294
|
+
statements.each do |statement|
|
295
|
+
add_removal(statement)
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
#Submit this changeset to the specified store
|
300
|
+
#
|
301
|
+
# store:: the store to which the changeset should be applied
|
302
|
+
def submit(store, versioned=false)
|
303
|
+
return store.submit_changeset(self.to_rdf, versioned)
|
304
|
+
end
|
305
|
+
|
306
|
+
#end changeset
|
307
|
+
end
|
308
|
+
|
309
|
+
#end module
|
310
|
+
end
|
311
|
+
|
312
|
+
end
|