Class: PubliSci::Prov::Entity
- Inherits:
-
Object
- Object
- PubliSci::Prov::Entity
- Includes:
- Element
- Defined in:
- lib/bio-publisci/metadata/prov/entity.rb
Defined Under Namespace
Classes: Derivations
Instance Attribute Summary collapse
-
#attributed_to(agent = nil) ⇒ Object
Returns the value of attribute attributed_to.
-
#derived_from(entity = nil, &block) ⇒ Object
Returns the value of attribute derived_from.
Instance Method Summary collapse
Methods included from Element
#__label, #__label=, #subject, #subject=, #subject_id
Methods included from CustomPredicate
Methods included from Vocabulary
Instance Attribute Details
#attributed_to(agent = nil) ⇒ Object
Returns the value of attribute attributed_to.
7 8 9 |
# File 'lib/bio-publisci/metadata/prov/entity.rb', line 7 def attributed_to @attributed_to end |
#derived_from(entity = nil, &block) ⇒ Object
Returns the value of attribute derived_from.
6 7 8 |
# File 'lib/bio-publisci/metadata/prov/entity.rb', line 6 def derived_from @derived_from end |
Instance Method Details
#generated_by(activity = nil) ⇒ Object
25 26 27 |
# File 'lib/bio-publisci/metadata/prov/entity.rb', line 25 def generated_by(activity=nil) basic_keyword(:generated_by,:activities,activity) end |
#source(s = nil) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/bio-publisci/metadata/prov/entity.rb', line 17 def source(s=nil) if s (@sources ||= []) << s else @sources end end |
#to_n3 ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/bio-publisci/metadata/prov/entity.rb', line 58 def to_n3 str = "<#{subject}> a prov:Entity ;\n" str << "\tprov:wasGeneratedBy <#{generated_by}> ;\n" if generated_by str << "\tprov:wasAttributedTo <#{attributed_to}> ;\n" if attributed_to if derived_from derived_from.size.times.each{|k| der = derived_from[k] # if der.is_a?(Symbol) && Prov.entities[der] if der.is_a? Derivation str << "\tprov:wasDerivedFrom <#{der.entity}> ;\n" str << "\tprov:qualifiedDerivation <#{der.subject}> ;\n" else str << "\tprov:wasDerivedFrom <#{der}> ;\n" end } end add_custom(str) str << %Q(\trdfs:label "#{__label}" .\n\n) end |
#to_s ⇒ Object
80 81 82 |
# File 'lib/bio-publisci/metadata/prov/entity.rb', line 80 def to_s subject end |