Skip to content

Commit 6149728

Browse files
add label and prefLabel to instances model
1 parent ca53d40 commit 6149728

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/ontologies_linked_data/models/instance.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ class Instance < LinkedData::Models::Base
77
namespace: :owl, :schemaless => :true , rdf_type: lambda { |*x| RDF::OWL[:NamedIndividual]}
88

99

10+
attribute :label, namespace: :rdfs, enforce: [:list]
11+
attribute :prefLabel, namespace: :skos, enforce: [:existence], alias: true
12+
1013
attribute :types, :namespace => :rdf, enforce: [:list], property: :type
1114
attribute :submission, :collection => lambda { |s| s.resource_id }, :namespace => :metadata
1215

@@ -21,6 +24,7 @@ def properties
2124

2225
end
2326
end
27+
2428
module InstanceLoader
2529
def self.count_instances_by_class(submission_id,class_id)
2630
## TODO: pass directly an LinkedData::Models::OntologySubmission instance in the arguments instead of submission_id

0 commit comments

Comments
 (0)