Class: PubliSci::Prov::Plan

Inherits:
Object
  • Object
show all
Includes:
Element
Defined in:
lib/bio-publisci/metadata/prov/plan.rb

Instance Method Summary collapse

Methods included from Element

#__label, #__label=, #subject, #subject=, #subject_id

Methods included from CustomPredicate

#add_custom, #custom, #has

Methods included from Vocabulary

#vocabulary

Instance Method Details

#steps(steps = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/bio-publisci/metadata/prov/plan.rb', line 6

def steps(steps=nil)
  if steps
    if File.exist? steps
      steps = Array[IO.read(steps).split("\n")]
    end
    @steps = Array[steps]
  else
    @steps
  end
end

#to_n3Object



17
18
19
20
21
22
23
24
25
# File 'lib/bio-publisci/metadata/prov/plan.rb', line 17

def to_n3
  str = "<#{subject}> a prov:Plan ;\n"
  if steps
    str << "\trdfs:comment (\"#{steps.join('" "')}\") ;\n"
  end
  add_custom(str)

  str << "\trdfs:label \"#{__label}\" .\n\n"
end

#to_sObject



27
28
29
# File 'lib/bio-publisci/metadata/prov/plan.rb', line 27

def to_s
  subject
end