# 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" # 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 activity :triplify do generated :triplified_example associated_with :publisci used do entity :original role :generation_input, comment: "source data for triplification" end end activity :use_R do generated :original # 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