Class: Lbp::Manifestation

Inherits:
Resource show all
Defined in:
lib/lbp/manifestation.rb

Instance Attribute Summary

Attributes inherited from Resource

#resource_shortId, #resource_url, #results

Instance Method Summary collapse

Methods inherited from Resource

#convert, #initialize, #structureType, #structureType_shortId, #title, #type, #type_shortId

Constructor Details

This class inherits a constructor from Lbp::Resource

Instance Method Details

#canonicalTranscriptionObject



28
29
30
31
32
# File 'lib/lbp/manifestation.rb', line 28

def canonicalTranscription
	url = self.canonicalTranscriptionUrl
	transcriptionObj = Transcription.new(url)
	return transcriptionObj
end

#canonicalTranscriptionUrlObject



19
20
21
22
23
24
25
26
27
# File 'lib/lbp/manifestation.rb', line 19

def canonicalTranscriptionUrl
	# TODO this check against an empty array should
	# occur everywhere the filter is used
	# maybe we need a helper function that does this once
	unless self.results.count == 0 
		transcriptionUrl = self.results.dup.filter(:p => RDF::URI("http://scta.info/property/hasCanonicalTranscription")).first[:o].to_s
		return transcriptionUrl
	end
end

#transcriptionUrlsObject

inherits initialization from Resource



14
15
16
17
18
# File 'lib/lbp/manifestation.rb', line 14

def transcriptionUrls
	results = self.results.dup.filter(:p => RDF::URI("http://scta.info/property/hasTranscription"))
	transcriptions = results.map {|m| m[:o].to_s}
	return transcriptions
end