[WIP] update loc_full_config fixture to only use ldpath#290
[WIP] update loc_full_config fixture to only use ldpath#290
Conversation
| # @return [True|False] true if sorting of search results is supported; otherwise, false | ||
| def supports_sort? | ||
| return true unless results_sort_ldpath.present? || !results_sort_predicate.present? | ||
| return true if results_sort_ldpath.present? || results_sort_predicate.present? |
There was a problem hiding this comment.
Shifting lod_full_config fixture to specify ldpath for sort instead of a predicate revealed the logic on this was incorrect. The test now verifies that if sort ldpath is present, then sorting is supported.
| "property_label_i18n": "qa.linked_data.authority.locnames_ld4l_cache.birth_date", | ||
| "property_label_default": "Birth", | ||
| "ldpath": "madsrdf:identifiesRWO/madsrdf:birthDate/schema:label", | ||
| "ldpath": "madsrdf:identifiesRWO/madsrdf:birthDate/rdfs:label", |
There was a problem hiding this comment.
ldpath predefine RDF Schema using rdfs as the namespace. Updated the config to follow this precedence.
| altlabel_ldpath: 'skos:altLabel', | ||
| broader_ldpath: 'skos:broader', | ||
| narrower_ldpath: 'skos:narrower', | ||
| sameas_ldpath: 'skos:exactMatch' |
There was a problem hiding this comment.
This is the primary change for the PR. The config specified results as ldpaths instead of predicates.
| id_ldpath: 'dcterms:identifier', | ||
| label_ldpath: 'skos:prefLabel', | ||
| altlabel_ldpath: 'skos:altLabel', | ||
| sort_ldpath: 'skos:prefLabel' |
There was a problem hiding this comment.
This is the primary change for the PR. The config now specifies results as ldpaths instead of predicates.
| { | ||
| schema: "http://www.w3.org/2000/01/rdf-schema#", | ||
| skos: "http://www.w3.org/2004/02/skos/core#" | ||
| dcterms: "http://purl.org/dc/terms/" |
There was a problem hiding this comment.
rdfs (previously prefixed as schema) and skos are predefined in the ldpath gem and do not need to be defined here. dcterms is not predefined and needs to be defined here to be used in the config.
|
|
||
| let(:ldpath_results_config) do | ||
| let(:predicate_results_config) do | ||
| { |
There was a problem hiding this comment.
ldpath_results_config is no longer needed because lod_full_config fixture now defines them. The predicate definitions were removed from the fixture, so they are defined here for the predicate tests to be able to continue to pass. They will eventually be removed when support for predicates is removed from the config processing classes.
2bbf2fc to
0492e2d
Compare
| before { allow(full_config).to receive(:results).and_return(ldpath_results_config) } | ||
| it 'returns the ldpath' do | ||
| expect(full_config.results_id_ldpath).to eq 'schema:identifier ::xsd:string' | ||
| expect(full_config.results_id_ldpath).to eq 'dcterms:identifier' |
There was a problem hiding this comment.
Matches the change to the lod_full_config fixture ldpaths.
| before { allow(full_config).to receive(:results).and_return(ldpath_results_config) } | ||
| it 'returns the ldpath' do | ||
| expect(full_config.results_label_ldpath).to eq 'skos:prefLabel ::xsd:string' | ||
| expect(full_config.results_label_ldpath).to eq 'skos:prefLabel' |
There was a problem hiding this comment.
The ldpaths in loc_full_config fixture do not have ::xsd:string on the ldpaths. It is optional. The ldpath service already tests paths with and without the type (not in this PR).
|
|
||
| let(:ldpath_results_config) do | ||
| let(:predicate_results_config) do | ||
| { |
There was a problem hiding this comment.
ldpath_results_config is no longer needed because lod_full_config fixture now defines them. The predicate definitions were removed from the fixture, so they are defined here for the predicate tests to be able to continue to pass. They will eventually be removed when support for predicates is removed from the config processing classes.
| narrower_predicate: 'http://www.w3.org/2004/02/skos/core#narrower', | ||
| sameas_predicate: 'http://www.w3.org/2004/02/skos/core#exactMatch' | ||
| id_ldpath: 'dcterms:identifier', | ||
| label_ldpath: 'skos:prefLabel', |
There was a problem hiding this comment.
This is the primary change for the PR. The config now specifies results as ldpaths instead of predicates.
**[WIP] Step 1 in removing deprecated predicate support** ---- Partially addresses #289 * changes loc_full_config fixture to only use ldpath * updates config specs to check for ldpath * temporarily update predicate tests in config specs to test against hardcoded predicate hash (This will be removed when the config processing code no longer supports predicates.)
0492e2d to
2574dad
Compare
[WIP] Part of the process to remove deprecated predicate support
No prerequisites for this PR. It will be a prerequisite for other PRs related to removal of deprecated code.
Partially addresses #289