Class: ODRL::Profile::Rule
- Inherits:
-
ProfileElement
- Object
- ProfileElement
- ODRL::Profile::Rule
- Defined in:
- lib/odrl/profile/builder.rb
Overview
This class MUST NOT be used to add custom ODRL Rules. Instead, sublcasses of this class offered by the builder must be used. This class is used to define the common properties of ODRL rules. E.g: In a Policy, the newly CustomPermission has been created and can be used as follows: ex:myPolicy odrl:permission ex:myPermission . ex:myPermission a ex-profile:CustomPermission ; odrl:target <example.com/asset_01> …
Direct Known Subclasses
Instance Attribute Summary collapse
-
#disjoints ⇒ Object
Returns the value of attribute disjoints.
Attributes inherited from ProfileElement
#definition, #label, #parent_class, #parent_property, #uri
Instance Method Summary collapse
- #build(repo:) ⇒ Object
-
#initialize(disjoints: [], **args) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(disjoints: [], **args) ⇒ Rule
Returns a new instance of Rule.
215 216 217 218 219 |
# File 'lib/odrl/profile/builder.rb', line 215 def initialize(disjoints: [], **args) @disjoints = disjoints super(**args) end |
Instance Attribute Details
#disjoints ⇒ Object
Returns the value of attribute disjoints.
213 214 215 |
# File 'lib/odrl/profile/builder.rb', line 213 def disjoints @disjoints end |
Instance Method Details
#build(repo:) ⇒ Object
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/odrl/profile/builder.rb', line 221 def build(repo:) ODRL::Profile::Builder.triplify(uri, RDF.type, RDFS.Class, repo) ODRL::Profile::Builder.triplify(uri, RDF.type, OWL.Class, repo) ODRL::Profile::Builder.triplify(uri, RDF.type, SKOS.Concept, repo) ODRL::Profile::Builder.triplify(uri, RDFS.label, label, repo) ODRL::Profile::Builder.triplify(uri, SKOS.defintion, definition, repo) @disjoints.each do |disjoint| ODRL::Profile::Builder.triplify(uri, OWL.disjointWith, disjoint, repo) end end |