examples/prov_dsl.prov in bio-publisci-0.0.4 vs examples/prov_dsl.prov in bio-publisci-0.0.5

- old
+ new

@@ -1,25 +1,61 @@ -agent :publisci, type: "software" +# Made up example to show generation and customization features + +# Set subject manually (prevents automatic generation) agent :R, subject: "http://r-project.org" +agent :publisci, type: "software" + +# Define plan, load step list from file if available plan :R_steps, steps: "spec/resource/example.Rhistory" organization :sciruby, subject: "http://sciruby.com" +# The DSL is built on top Ruby, so you can assign variables if you need to +# or do any other ruby thing you might like. +# +# The vocabulary(url) method is short for RDF::Vocabulary.new(url) foaf = vocabulary "http://xmlns.com/foaf/0.1/" agent :Will do type "person" name "Will Strinz" on_behalf_of :sciruby + # Custom predicates can be added using the has(predicate, object) method. has foaf.mailbox, "wstrinz@gmail.com" - has foaf.homepage, "http://gsocsemantic.wordpress.com/" + + # Predicates must but either a vocabulary object or a valid RDF resource, + # but objects can be a resource or a literal. + # + # RDF.rb is used to assign the right type to each object (resource or literal) + has "http://xmlns.com/foaf/0.1/", "http://gsocsemantic.wordpress.com/" end +data :field_work + +data :original do + # Derivations and attributions can be generated automatically + # if their corresponding methods are called with a symbol + attributed_to :R + + # derived_from will add a prov:wasDerivedFrom predicate to this entity + # with the subject for the entity represented by :field_work + # as its object. + derived_from :field_work +end + data :triplified_example do attributed_to :Will + + # Derivations can be qualified by passing a block. + # This will add a prov:qualifiedDerivation relation + # to the resource for :triplified_example. + # (see http://www.w3.org/TR/prov-o/#Derivation) + # + # A new Derivation resource and object will also be + # created with the information in the block. derived_from do entity :original activity :triplify end end @@ -28,23 +64,18 @@ generated :triplified_example associated_with :publisci used :original end -data :original do - derived_from :field_work - attributed_to :R -end -data :field_work - activity :use_R do generated :original - associated_with { + # Qualified associations for activities can also be created using blocks + associated_with do agent :R plan :R_steps - } + end associated_with :Will end generate_n3 true \ No newline at end of file