Class: LinkedVocabs::Controlled::ClassMethods::QaRDF
- Inherits:
-
Object
- Object
- LinkedVocabs::Controlled::ClassMethods::QaRDF
- Defined in:
- lib/linked_vocabs/controlled.rb
Overview
Implement QuestioningAuthority API
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
Returns the value of attribute raw_response.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #get_full_record(id, sub_authority) ⇒ Object
-
#initialize(parent = nil) ⇒ QaRDF
constructor
A new instance of QaRDF.
- #results ⇒ Object
-
#search(q, sub_authority = nil) ⇒ Object
Not a very smart sparql search.
Constructor Details
#initialize(parent = nil) ⇒ QaRDF
Returns a new instance of QaRDF.
143 144 145 |
# File 'lib/linked_vocabs/controlled.rb', line 143 def initialize(parent=nil) @parent = parent end |
Instance Attribute Details
#raw_response ⇒ Object
Returns the value of attribute raw_response.
141 142 143 |
# File 'lib/linked_vocabs/controlled.rb', line 141 def raw_response @raw_response end |
#response ⇒ Object
Returns the value of attribute response.
141 142 143 |
# File 'lib/linked_vocabs/controlled.rb', line 141 def response @response end |
Instance Method Details
#get_full_record(id, sub_authority) ⇒ Object
162 163 |
# File 'lib/linked_vocabs/controlled.rb', line 162 def get_full_record(id, ) end |
#results ⇒ Object
158 159 160 |
# File 'lib/linked_vocabs/controlled.rb', line 158 def results response end |
#search(q, sub_authority = nil) ⇒ Object
Not a very smart sparql search. It’s mostly intended to be overridden in subclasses, but it could also stand to be a bit better as a baseline RDF vocab search.
151 152 153 154 155 156 |
# File 'lib/linked_vocabs/controlled.rb', line 151 def search(q, =nil) @sparql = SPARQL::Client.new(ActiveTriples::Repositories.repositories[@parent.repository]) self.response = sparql_starts_search(q) return response unless response.empty? self.response = sparql_contains_search(q) end |