Class: RoadForest::RDF::UpdateManager
Constant Summary
Normalization::Vocabs
Instance Attribute Summary collapse
Attributes inherited from SplitManager
#target_graph
#resource, #rigor, #source_graph
Instance Method Summary
collapse
#relevant_prefixes
#build_query, #each, #query_execute, #query_pattern, #relevant_prefixes
#expand_curie, #expand_curie_pair, #interned_uri, #literal, #normalize_context, #normalize_property, #normalize_resource, #normalize_statement, #normalize_term, #normalize_tuple, #normalize_uri, #relevant_prefixes_for_graph, #root_url, #uri, #vocabularies_in_graph
Constructor Details
Returns a new instance of UpdateManager.
96
97
98
|
# File 'lib/roadforest/rdf/access-manager.rb', line 96
def initialize
@copied_contexts = {}
end
|
Instance Attribute Details
#copied_contexts ⇒ Object
Returns the value of attribute copied_contexts.
100
101
102
|
# File 'lib/roadforest/rdf/access-manager.rb', line 100
def copied_contexts
@copied_contexts
end
|
Instance Method Details
#copy_context ⇒ Object
136
137
138
139
140
141
142
143
|
# File 'lib/roadforest/rdf/access-manager.rb', line 136
def copy_context
return if copied_contexts[resource]
parceller.graph_for(resource).each_statement do |statement|
statement.context = resource
destination_graph << statement
end
copied_contexts[resource] = true
end
|
#delete(statement) ⇒ Object
122
123
124
125
|
# File 'lib/roadforest/rdf/access-manager.rb', line 122
def delete(statement)
copy_context
super
end
|
#dup ⇒ Object
102
103
104
105
106
|
# File 'lib/roadforest/rdf/access-manager.rb', line 102
def dup
other = super
other.copied_contexts = self.copied_contexts
return other
end
|
#execute_search(search, &block) ⇒ Object
108
109
110
111
112
113
114
115
|
# File 'lib/roadforest/rdf/access-manager.rb', line 108
def execute_search(search, &block)
enum = search.execute(destination_graph)
if enum.any?{ true }
enum.each(&block)
return enum
end
search.execute(origin_graph, &block)
end
|
#insert(statement) ⇒ Object
117
118
119
120
|
# File 'lib/roadforest/rdf/access-manager.rb', line 117
def insert(statement)
copy_context
super
end
|
#parceller ⇒ Object
127
128
129
130
131
132
133
134
|
# File 'lib/roadforest/rdf/access-manager.rb', line 127
def parceller
@parceller ||=
begin
parceller = Parcel.new
parceller.graph = source_graph
parceller
end
end
|