Skip to content

Commit 570e8c9

Browse files
committed
feat: unlink resolved reified definitions and drop Class#definitionXl
1 parent a267aef commit 570e8c9

8 files changed

Lines changed: 76 additions & 384 deletions

File tree

lib/ontologies_linked_data/config/config.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ def goo_namespaces
198198
conf.add_namespace(:cclicense, RDF::Vocabulary.new("http://creativecommons.org/licenses/"))
199199
conf.add_namespace(:nkos, RDF::Vocabulary.new("http://w3id.org/nkos#"))
200200
conf.add_namespace(:skosxl, RDF::Vocabulary.new("http://www.w3.org/2008/05/skos-xl#"))
201-
conf.add_namespace(:vocbench, RDF::Vocabulary.new("http://art.uniroma2.it/ontologies/vocbench#"))
202201
conf.add_namespace(:dcterms, RDF::Vocabulary.new("http://purl.org/dc/terms/"))
203202
conf.add_namespace(:uneskos, RDF::Vocabulary.new("http://purl.org/umu/uneskos#"))
204203

lib/ontologies_linked_data/models/class.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ def self.urn_id(acronym,classId)
9292
# Hypermedia settings
9393
embed :children, :ancestors, :descendants, :parents, :prefLabelXl, :altLabelXl, :hiddenLabelXl
9494
serialize_default :prefLabel, :synonym, :definition, :cui, :semanticType, :obsolete, :matchType, :ontologyType, :provisional, :created, :modified, :memberOf, :inScheme # an attribute used in Search (not shown out of context)
95-
serialize_methods :properties, :childrenCount, :hasChildren, :definitionXl
95+
serialize_methods :properties, :childrenCount, :hasChildren
9696
serialize_never :submissionAcronym, :submissionId, :submission, :descendants
9797
aggregates childrenCount: [:count, :children]
9898
links_load submission: [ontology: [:acronym]]
9999
do_not_load :descendants, :ancestors
100-
prevent_serialize_when_nested :properties, :parents, :children, :ancestors, :descendants, :memberOf, :definitionXl
100+
prevent_serialize_when_nested :properties, :parents, :children, :ancestors, :descendants, :memberOf
101101
link_to LinkedData::Hypermedia::Link.new("self", lambda {|s| "ontologies/#{s.submission.ontology.acronym}/classes/#{CGI.escape(s.id.to_s)}"}, self.uri_type),
102102
LinkedData::Hypermedia::Link.new("ontology", lambda {|s| "ontologies/#{s.submission.ontology.acronym}"}, Goo.vocabulary["Ontology"]),
103103
LinkedData::Hypermedia::Link.new("children", lambda {|s| "ontologies/#{s.submission.ontology.acronym}/classes/#{CGI.escape(s.id.to_s)}/children"}, self.uri_type),
@@ -386,20 +386,6 @@ def properties(*args)
386386
properties
387387
end
388388

389-
# Expose the content of reified skos:definition nodes (text + provenance).
390-
# `definition` (the flat attribute) is unchanged: for reified definitions
391-
# its entries are the bare node URIs; this method resolves those URIs into
392-
# structured objects. Plain-literal definitions have no URI entries, so
393-
# this returns an empty array and the flat `definition` still carries them.
394-
def definitionXl
395-
self.bring(:definition) if self.bring?(:definition)
396-
uris = Array(self.definition).select { |d| d.is_a?(RDF::URI) }
397-
return [] if uris.empty?
398-
399-
self.bring(:submission) if self.bring?(:submission)
400-
LinkedData::Models::SKOS::Definition.reified(uris, self.submission)
401-
end
402-
403389
def self.partially_load_children(models, threshold, submission)
404390
ld = [:prefLabel, :definition, :synonym]
405391
ld << :subClassOf if submission.hasOntologyLanguage.obo?

lib/ontologies_linked_data/models/mod/semantic_artefact.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
require 'ontologies_linked_data/models/skos/scheme'
44
require 'ontologies_linked_data/models/skos/collection'
55
require 'ontologies_linked_data/models/skos/skosxl'
6-
require 'ontologies_linked_data/models/skos/definition'
76

87

98
module LinkedData

lib/ontologies_linked_data/models/ontology.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
require 'ontologies_linked_data/models/skos/scheme'
1010
require 'ontologies_linked_data/models/skos/collection'
1111
require 'ontologies_linked_data/models/skos/skosxl'
12-
require 'ontologies_linked_data/models/skos/definition'
1312
require 'ontologies_linked_data/models/notes/note'
1413
require 'ontologies_linked_data/purl/purl_client'
1514

lib/ontologies_linked_data/models/skos/definition.rb

Lines changed: 0 additions & 171 deletions
This file was deleted.

0 commit comments

Comments
 (0)