odrl-ruby 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +16 -16
- data/CHANGELOG.md +5 -5
- data/Gemfile +12 -12
- data/Gemfile.lock +249 -249
- data/LICENSE.txt +21 -21
- data/README.md +128 -127
- data/Rakefile +8 -8
- data/bin/console +15 -15
- data/bin/setup +8 -8
- data/examples/biohackathon-output.ttl +63 -63
- data/examples/build_profile.rb +48 -47
- data/examples/create-biohackathon-offer.rb +44 -44
- data/examples/create-nagoya-es-offer.rb +54 -54
- data/examples/nagoya-output.ttl +66 -66
- data/launch.json +10 -10
- data/lib/odrl/action.rb +106 -106
- data/lib/odrl/asset.rb +77 -77
- data/lib/odrl/base.rb +230 -230
- data/lib/odrl/constraint.rb +110 -110
- data/lib/odrl/odrl/version.rb +7 -7
- data/lib/odrl/party.rb +97 -97
- data/lib/odrl/policy.rb +97 -97
- data/lib/odrl/profile/builder.rb +348 -186
- data/lib/odrl/ruby.rb +26 -26
- data/lib/odrl/rule.rb +116 -116
- metadata +8 -6
data/README.md
CHANGED
@@ -1,127 +1,128 @@
|
|
1
|
-
# ODRL::Ruby
|
2
|
-
|
3
|
-
This is a gem to build ODRL records, and serialize them. Does not cover the full ODRL model (yet!)
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```
|
10
|
-
gem 'odrl-ruby'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
#
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
permission.
|
61
|
-
permission.
|
62
|
-
permission.
|
63
|
-
permission.
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
1
|
+
# ODRL::Ruby
|
2
|
+
|
3
|
+
This is a gem to build ODRL records, and serialize them. Does not cover the full ODRL model (yet!)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```sh
|
10
|
+
gem 'odrl-ruby'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```sh
|
16
|
+
$ bundle install
|
17
|
+
|
18
|
+
# Or install it yourself as:
|
19
|
+
$ gem install odrl-ruby
|
20
|
+
```
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
# Two functionalities: Build ODRL Policies; Build ODRL Profiles to extend the core ODRL vocabulary
|
25
|
+
|
26
|
+
# Build Policy:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'odrl/ruby'
|
30
|
+
|
31
|
+
# an offer to toshiaki from mark to use the polyA resource during the biohackathon
|
32
|
+
|
33
|
+
# core annotatons are: :title, :creator, :description, :subject :baseURI, :uid, :type
|
34
|
+
policy = ODRL::Offer.new(
|
35
|
+
title: "Offer to Toshiaki-san",
|
36
|
+
creator: "https://orcid.org/0000-0001-6960-357X",
|
37
|
+
description: "An offer for Toshiaki-san to use the polyA data during the hackathon",
|
38
|
+
subject: "collaboration", # this is the CCE category - useful for EJP-RD ONLYU
|
39
|
+
)
|
40
|
+
|
41
|
+
asset = ODRL::Asset.new(uid: "http://mark.wilkinson.org/data/polyA", title: "Mark's PolyA Database")
|
42
|
+
|
43
|
+
# you indicate the type of party by assigning the predicate (either assigner or assignee)
|
44
|
+
# ODRLV is the RDF::Vocabulary for ODRL, exported to this namespace
|
45
|
+
mark = ODRL::Party.new(uid: "https://orcid.org/0000-0001-6960-357X", predicate: ODRLV.assigner, title: "Mark D Wilkinson" )
|
46
|
+
toshiaki = ODRL::Party.new(uid: "https://orcid.org/0000-0003-2391-0384", predicate: ODRLV.assignee, title: "Toshiaki Katayama")
|
47
|
+
|
48
|
+
# Rules
|
49
|
+
permission = ODRL::Permission.new(title: "Permission to use")
|
50
|
+
|
51
|
+
use = ODRL::Use.new(value: "use") # subclass of ODRL::Action
|
52
|
+
|
53
|
+
# Constraints: :uid, :rightOperand, :leftOperand, :operator, :rightOperandReference, :dataType, :unit, :status
|
54
|
+
constraint = ODRL::Constraint.new(
|
55
|
+
title: "Only during the hackathon",
|
56
|
+
leftOperand: "event",
|
57
|
+
operator: "eq",
|
58
|
+
rightOperand: "https://2023.biohackathon.org"
|
59
|
+
)
|
60
|
+
permission.addConstraint(constraint: constraint)
|
61
|
+
permission.addAsset(asset: asset)
|
62
|
+
permission.addAssigner(party: toshiaki)
|
63
|
+
permission.addAssignee(party: mark)
|
64
|
+
permission.addAction(action: use)
|
65
|
+
|
66
|
+
policy.addPermission(rule: permission)
|
67
|
+
|
68
|
+
policy.load_graph # this brings the triples into memory, cascading down all objects conneted to "policuy"
|
69
|
+
result = policy.serialize(format: 'turtle') # get the RDF string
|
70
|
+
puts result
|
71
|
+
```
|
72
|
+
|
73
|
+
# Build Profile:
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
require 'odrl/profile/builder'
|
77
|
+
|
78
|
+
p = ODRL::Profile::Builder.new(
|
79
|
+
uri: "https://example.org/myprofiles/grp",
|
80
|
+
title: "ODRL Profile for Germplasm resources",
|
81
|
+
description: "There are some properties and comparisons that only make sense in the Germplasm expert domain",
|
82
|
+
authors: ["Mark D Wilkinson"],
|
83
|
+
version: 0.1,
|
84
|
+
license: "https://creativecommons.org/licenses/by/4.0/"
|
85
|
+
)
|
86
|
+
|
87
|
+
p.asset_relations << ODRL::Profile::AssetRelation.new(
|
88
|
+
uri: "https://example.org/myprofiles/grp#nagoya_permission",
|
89
|
+
label: "Permission under Nagoya protocol",
|
90
|
+
definition: "Permission is a special thing in the Nagoya protocol")
|
91
|
+
|
92
|
+
|
93
|
+
p.party_functional_roles << ODRL::Profile::PartyFunction.new(
|
94
|
+
uri: "https://example.org/myprofiles/grp#nagoya_assigner",
|
95
|
+
label: "Assigner with Nagoya authority to assign",
|
96
|
+
definition: "Assigners have special responsibilities in the Nagoya protocol")
|
97
|
+
|
98
|
+
p.actions << ODRL::Profile::Action.new(
|
99
|
+
uri: "https://example.org/myprofiles/grp#nagoya_propogate",
|
100
|
+
label: "Plant and Harvest",
|
101
|
+
definition: "the action of planting and harvesting the seed",
|
102
|
+
included_in: ODRLV.use,
|
103
|
+
implies: ODRLV.distribute)
|
104
|
+
|
105
|
+
|
106
|
+
p.leftOperands << ODRL::Profile::LeftOperand.new(
|
107
|
+
uri: "https://example.org/myprofiles/grp#at_risk_species",
|
108
|
+
label: "At Risk Species",
|
109
|
+
definition: "A species that has been flagged as at-risk of extinction")
|
110
|
+
|
111
|
+
p.rightOperands << ODRL::Profile::RightOperand.new(
|
112
|
+
uri: "https://example.org/myprofiles/grp#on_watchlist",
|
113
|
+
label: "On Watchlist",
|
114
|
+
definition: "A species whose risk of extinction is on a watchlist")
|
115
|
+
|
116
|
+
p.operators << ODRL::Profile::Operator.new(
|
117
|
+
uri: "https://example.org/myprofiles/grp#within_risk_boundary",
|
118
|
+
label: "Within Bounds",
|
119
|
+
definition: "comparison of risk boundaries")
|
120
|
+
|
121
|
+
|
122
|
+
p.build()
|
123
|
+
puts p.serialize
|
124
|
+
```
|
125
|
+
|
126
|
+
## License
|
127
|
+
|
128
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
require "rubocop/rake_task"
|
5
|
-
|
6
|
-
RuboCop::RakeTask.new
|
7
|
-
|
8
|
-
task default: :rubocop
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rubocop/rake_task"
|
5
|
+
|
6
|
+
RuboCop::RakeTask.new
|
7
|
+
|
8
|
+
task default: :rubocop
|
data/bin/console
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "bundler/setup"
|
5
|
-
require "odrl/ruby"
|
6
|
-
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
9
|
-
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
# require "pry"
|
12
|
-
# Pry.start
|
13
|
-
|
14
|
-
require "irb"
|
15
|
-
IRB.start(__FILE__)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "odrl/ruby"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -euo pipefail
|
3
|
-
IFS=$'\n\t'
|
4
|
-
set -vx
|
5
|
-
|
6
|
-
bundle install
|
7
|
-
|
8
|
-
# Do any other automated setup that you need to do here
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
bundle install
|
7
|
+
|
8
|
+
# Do any other automated setup that you need to do here
|
@@ -1,63 +1,63 @@
|
|
1
|
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
2
|
-
|
3
|
-
<http://example.org#constraint_68811358965684>
|
4
|
-
<http://purl.org/dc/terms/identifier> <http://example.org#constraint_68811358965684> ;
|
5
|
-
<http://purl.org/dc/terms/title> "Only during the hackathon"@en ;
|
6
|
-
a <http://www.w3.org/ns/odrl/2/Constraint> ;
|
7
|
-
<http://www.w3.org/2000/01/rdf-schema#label> "Only during the hackathon"@en ;
|
8
|
-
<http://www.w3.org/ns/odrl/2/leftOperand> <http://www.w3.org/ns/odrl/2/event> ;
|
9
|
-
<http://www.w3.org/ns/odrl/2/operator> <http://www.w3.org/ns/odrl/2/eq> ;
|
10
|
-
<http://www.w3.org/ns/odrl/2/rightOperand> <https://2023.biohackathon.org> ;
|
11
|
-
<http://www.w3.org/ns/odrl/2/uid> <http://example.org#constraint_68811358965684> .
|
12
|
-
|
13
|
-
<http://example.org#policy_68811358965627>
|
14
|
-
<http://purl.org/dc/terms/creator> <https://orcid.org/0000-0001-6960-357X> ;
|
15
|
-
<http://purl.org/dc/terms/description> "An offer for Toshiaki-san to use the polyA data during the hackathon"@en ;
|
16
|
-
<http://purl.org/dc/terms/identifier> <http://example.org#policy_68811358965627> ;
|
17
|
-
<http://purl.org/dc/terms/subject> "collaboration"@en ;
|
18
|
-
<http://purl.org/dc/terms/title> "Offer to Toshiaki-san"@en ;
|
19
|
-
a <http://www.w3.org/ns/odrl/2/Offer> ;
|
20
|
-
<http://www.w3.org/2000/01/rdf-schema#label> "Offer to Toshiaki-san"@en ;
|
21
|
-
<http://www.w3.org/ns/odrl/2/permission> <http://example.org#rule_68811358965667> ;
|
22
|
-
<http://www.w3.org/ns/odrl/2/uid> <http://example.org#policy_68811358965627> .
|
23
|
-
|
24
|
-
<http://example.org#rule_68811358965667>
|
25
|
-
<http://purl.org/dc/terms/identifier> <http://example.org#rule_68811358965667> ;
|
26
|
-
<http://purl.org/dc/terms/title> "Permission to use"@en ;
|
27
|
-
a <http://www.w3.org/ns/odrl/2/Permission> ;
|
28
|
-
<http://www.w3.org/2000/01/rdf-schema#label> "Permission to use"@en ;
|
29
|
-
<http://www.w3.org/ns/odrl/2/action> <http://www.w3.org/ns/odrl/2/use> ;
|
30
|
-
<http://www.w3.org/ns/odrl/2/assignee> <https://orcid.org/0000-0001-6960-357X> ;
|
31
|
-
<http://www.w3.org/ns/odrl/2/assigner> <https://orcid.org/0000-0003-2391-0384> ;
|
32
|
-
<http://www.w3.org/ns/odrl/2/constraint> <http://example.org#constraint_68811358965684> ;
|
33
|
-
<http://www.w3.org/ns/odrl/2/target> <http://mark.wilkinson.org/data/polyA> ;
|
34
|
-
<http://www.w3.org/ns/odrl/2/uid> <http://example.org#rule_68811358965667> .
|
35
|
-
|
36
|
-
<http://mark.wilkinson.org/data/polyA>
|
37
|
-
<http://purl.org/dc/terms/identifier> <http://mark.wilkinson.org/data/polyA> ;
|
38
|
-
<http://purl.org/dc/terms/title> "Mark's PolyA Database"@en ;
|
39
|
-
a <http://www.w3.org/ns/odrl/2/Asset> ;
|
40
|
-
<http://www.w3.org/2000/01/rdf-schema#label> "Mark's PolyA Database"@en ;
|
41
|
-
<http://www.w3.org/ns/odrl/2/uid> <http://mark.wilkinson.org/data/polyA> .
|
42
|
-
|
43
|
-
<http://www.w3.org/ns/odrl/2/use>
|
44
|
-
<http://purl.org/dc/terms/identifier> <http://www.w3.org/ns/odrl/2/use> ;
|
45
|
-
a "type"@en ;
|
46
|
-
<http://www.w3.org/2000/01/rdf-schema#label> ""@en ;
|
47
|
-
<http://www.w3.org/ns/odrl/2/uid> <http://www.w3.org/ns/odrl/2/use> ;
|
48
|
-
<https://schema.org/name> ""@en .
|
49
|
-
|
50
|
-
<https://orcid.org/0000-0001-6960-357X>
|
51
|
-
<http://purl.org/dc/terms/identifier> <https://orcid.org/0000-0001-6960-357X> ;
|
52
|
-
<http://purl.org/dc/terms/title> "Mark D Wilkinson"@en ;
|
53
|
-
a <http://www.w3.org/ns/odrl/2/Party> ;
|
54
|
-
<http://www.w3.org/2000/01/rdf-schema#label> "Mark D Wilkinson"@en ;
|
55
|
-
<http://www.w3.org/ns/odrl/2/uid> <https://orcid.org/0000-0001-6960-357X> .
|
56
|
-
|
57
|
-
<https://orcid.org/0000-0003-2391-0384>
|
58
|
-
<http://purl.org/dc/terms/identifier> <https://orcid.org/0000-0003-2391-0384> ;
|
59
|
-
<http://purl.org/dc/terms/title> "Toshiaki Katayama"@en ;
|
60
|
-
a <http://www.w3.org/ns/odrl/2/Party> ;
|
61
|
-
<http://www.w3.org/2000/01/rdf-schema#label> "Toshiaki Katayama"@en ;
|
62
|
-
<http://www.w3.org/ns/odrl/2/uid> <https://orcid.org/0000-0003-2391-0384> .
|
63
|
-
|
1
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
2
|
+
|
3
|
+
<http://example.org#constraint_68811358965684>
|
4
|
+
<http://purl.org/dc/terms/identifier> <http://example.org#constraint_68811358965684> ;
|
5
|
+
<http://purl.org/dc/terms/title> "Only during the hackathon"@en ;
|
6
|
+
a <http://www.w3.org/ns/odrl/2/Constraint> ;
|
7
|
+
<http://www.w3.org/2000/01/rdf-schema#label> "Only during the hackathon"@en ;
|
8
|
+
<http://www.w3.org/ns/odrl/2/leftOperand> <http://www.w3.org/ns/odrl/2/event> ;
|
9
|
+
<http://www.w3.org/ns/odrl/2/operator> <http://www.w3.org/ns/odrl/2/eq> ;
|
10
|
+
<http://www.w3.org/ns/odrl/2/rightOperand> <https://2023.biohackathon.org> ;
|
11
|
+
<http://www.w3.org/ns/odrl/2/uid> <http://example.org#constraint_68811358965684> .
|
12
|
+
|
13
|
+
<http://example.org#policy_68811358965627>
|
14
|
+
<http://purl.org/dc/terms/creator> <https://orcid.org/0000-0001-6960-357X> ;
|
15
|
+
<http://purl.org/dc/terms/description> "An offer for Toshiaki-san to use the polyA data during the hackathon"@en ;
|
16
|
+
<http://purl.org/dc/terms/identifier> <http://example.org#policy_68811358965627> ;
|
17
|
+
<http://purl.org/dc/terms/subject> "collaboration"@en ;
|
18
|
+
<http://purl.org/dc/terms/title> "Offer to Toshiaki-san"@en ;
|
19
|
+
a <http://www.w3.org/ns/odrl/2/Offer> ;
|
20
|
+
<http://www.w3.org/2000/01/rdf-schema#label> "Offer to Toshiaki-san"@en ;
|
21
|
+
<http://www.w3.org/ns/odrl/2/permission> <http://example.org#rule_68811358965667> ;
|
22
|
+
<http://www.w3.org/ns/odrl/2/uid> <http://example.org#policy_68811358965627> .
|
23
|
+
|
24
|
+
<http://example.org#rule_68811358965667>
|
25
|
+
<http://purl.org/dc/terms/identifier> <http://example.org#rule_68811358965667> ;
|
26
|
+
<http://purl.org/dc/terms/title> "Permission to use"@en ;
|
27
|
+
a <http://www.w3.org/ns/odrl/2/Permission> ;
|
28
|
+
<http://www.w3.org/2000/01/rdf-schema#label> "Permission to use"@en ;
|
29
|
+
<http://www.w3.org/ns/odrl/2/action> <http://www.w3.org/ns/odrl/2/use> ;
|
30
|
+
<http://www.w3.org/ns/odrl/2/assignee> <https://orcid.org/0000-0001-6960-357X> ;
|
31
|
+
<http://www.w3.org/ns/odrl/2/assigner> <https://orcid.org/0000-0003-2391-0384> ;
|
32
|
+
<http://www.w3.org/ns/odrl/2/constraint> <http://example.org#constraint_68811358965684> ;
|
33
|
+
<http://www.w3.org/ns/odrl/2/target> <http://mark.wilkinson.org/data/polyA> ;
|
34
|
+
<http://www.w3.org/ns/odrl/2/uid> <http://example.org#rule_68811358965667> .
|
35
|
+
|
36
|
+
<http://mark.wilkinson.org/data/polyA>
|
37
|
+
<http://purl.org/dc/terms/identifier> <http://mark.wilkinson.org/data/polyA> ;
|
38
|
+
<http://purl.org/dc/terms/title> "Mark's PolyA Database"@en ;
|
39
|
+
a <http://www.w3.org/ns/odrl/2/Asset> ;
|
40
|
+
<http://www.w3.org/2000/01/rdf-schema#label> "Mark's PolyA Database"@en ;
|
41
|
+
<http://www.w3.org/ns/odrl/2/uid> <http://mark.wilkinson.org/data/polyA> .
|
42
|
+
|
43
|
+
<http://www.w3.org/ns/odrl/2/use>
|
44
|
+
<http://purl.org/dc/terms/identifier> <http://www.w3.org/ns/odrl/2/use> ;
|
45
|
+
a "type"@en ;
|
46
|
+
<http://www.w3.org/2000/01/rdf-schema#label> ""@en ;
|
47
|
+
<http://www.w3.org/ns/odrl/2/uid> <http://www.w3.org/ns/odrl/2/use> ;
|
48
|
+
<https://schema.org/name> ""@en .
|
49
|
+
|
50
|
+
<https://orcid.org/0000-0001-6960-357X>
|
51
|
+
<http://purl.org/dc/terms/identifier> <https://orcid.org/0000-0001-6960-357X> ;
|
52
|
+
<http://purl.org/dc/terms/title> "Mark D Wilkinson"@en ;
|
53
|
+
a <http://www.w3.org/ns/odrl/2/Party> ;
|
54
|
+
<http://www.w3.org/2000/01/rdf-schema#label> "Mark D Wilkinson"@en ;
|
55
|
+
<http://www.w3.org/ns/odrl/2/uid> <https://orcid.org/0000-0001-6960-357X> .
|
56
|
+
|
57
|
+
<https://orcid.org/0000-0003-2391-0384>
|
58
|
+
<http://purl.org/dc/terms/identifier> <https://orcid.org/0000-0003-2391-0384> ;
|
59
|
+
<http://purl.org/dc/terms/title> "Toshiaki Katayama"@en ;
|
60
|
+
a <http://www.w3.org/ns/odrl/2/Party> ;
|
61
|
+
<http://www.w3.org/2000/01/rdf-schema#label> "Toshiaki Katayama"@en ;
|
62
|
+
<http://www.w3.org/ns/odrl/2/uid> <https://orcid.org/0000-0003-2391-0384> .
|
63
|
+
|
data/examples/build_profile.rb
CHANGED
@@ -1,47 +1,48 @@
|
|
1
|
-
require 'odrl/profile/builder'
|
2
|
-
|
3
|
-
p = ODRL::Profile::Builder.new(
|
4
|
-
uri:
|
5
|
-
title: "ODRL Profile for Germplasm resources",
|
6
|
-
description: "There are some properties and comparisons that only make sense in the Germplasm expert domain",
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
1
|
+
require '../lib/odrl/profile/builder'
|
2
|
+
|
3
|
+
p = ODRL::Profile::Builder.new(
|
4
|
+
uri: "https://example.org/myprofiles/grp",
|
5
|
+
title: "ODRL Profile for Germplasm resources",
|
6
|
+
description: "There are some properties and comparisons that only make sense in the Germplasm expert domain",
|
7
|
+
authors: ["Mark D Wilkinson"],
|
8
|
+
version: 0.1,
|
9
|
+
license: "https://creativecommons.org/licenses/by/4.0/"
|
10
|
+
)
|
11
|
+
|
12
|
+
p.asset_relations << ODRL::Profile::AssetRelation.new(
|
13
|
+
uri: "https://example.org/myprofiles/grp#nagoya_permission",
|
14
|
+
label: "Permission under Nagoya protocol",
|
15
|
+
definition: "Permission is a special thing in the Nagoya protocol")
|
16
|
+
|
17
|
+
|
18
|
+
p.party_functional_roles << ODRL::Profile::PartyFunction.new(
|
19
|
+
uri: "https://example.org/myprofiles/grp#nagoya_assigner",
|
20
|
+
label: "Assigner with Nagoya authority to assign",
|
21
|
+
definition: "Assigners have special responsibilities in the Nagoya protocol")
|
22
|
+
|
23
|
+
p.actions << ODRL::Profile::Action.new(
|
24
|
+
uri: "https://example.org/myprofiles/grp#nagoya_propogate",
|
25
|
+
label: "Plant and Harvest",
|
26
|
+
definition: "the action of planting and harvesting the seed",
|
27
|
+
included_in: ODRLV.use,
|
28
|
+
implies: ODRLV.distribute)
|
29
|
+
|
30
|
+
|
31
|
+
p.leftOperands << ODRL::Profile::LeftOperand.new(
|
32
|
+
uri: "https://example.org/myprofiles/grp#at_risk_species",
|
33
|
+
label: "At Risk Species",
|
34
|
+
definition: "A species that has been flagged as at-risk of extinction")
|
35
|
+
|
36
|
+
p.rightOperands << ODRL::Profile::RightOperand.new(
|
37
|
+
uri: "https://example.org/myprofiles/grp#on_watchlist",
|
38
|
+
label: "On Watchlist",
|
39
|
+
definition: "A species whose risk of extinction is on a watchlist")
|
40
|
+
|
41
|
+
p.operators << ODRL::Profile::Operator.new(
|
42
|
+
uri: "https://example.org/myprofiles/grp#within_risk_boundary",
|
43
|
+
label: "Within Bounds",
|
44
|
+
definition: "comparison of risk boundaries")
|
45
|
+
|
46
|
+
|
47
|
+
p.build()
|
48
|
+
puts p.serialize
|