Skip to content

Commit

Permalink
Remove schemas from app
Browse files Browse the repository at this point in the history
Replaces `app` schemas with those in `lib`. This breaks backward
compatibility for any clients referring directly to the schema
constants. It's otherwise a simple refactor.
  • Loading branch information
Tom Johnson committed Feb 2, 2017
1 parent f8ed4d0 commit 52c72c5
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 40 deletions.
2 changes: 1 addition & 1 deletion app/models/control.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Control
include ActiveTriples::RDFSource
apply_schema ControlSchema
apply_schema LinkedDataFragments::ControlSchema
end
3 changes: 2 additions & 1 deletion app/models/dataset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ class Dataset
RDF::URI.intern("http://www.w3.org/ns/hydra/core#Collection"),
RDF::Vocab::VOID.Dataset
]
apply_schema DatasetSchema

apply_schema LinkedDataFragments::DatasetSchema
end
2 changes: 1 addition & 1 deletion app/models/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class Result
RDF::URI("http://www.w3.org/ns/hydra/core#Collection"),
RDF::URI("http://www.w3.org/ns/hydra/core#PagedCollection")
]
apply_schema ResultSchema

apply_schema LinkedDataFragments::ResultSchema
end
3 changes: 2 additions & 1 deletion app/models/template.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Template < ActiveTriples::Resource
include ActiveTriples::RDFSource
apply_schema TemplateSchema

apply_schema LinkedDataFragments::TemplateSchema
end
4 changes: 0 additions & 4 deletions app/schemas/control_schema.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/schemas/dataset_schema.rb

This file was deleted.

14 changes: 0 additions & 14 deletions app/schemas/result_schema.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/schemas/template_schema.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/models/control_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
subject { described_class.new }

it "should apply the control schema" do
ControlSchema.properties.each do |property|
LinkedDataFragments::ControlSchema.properties.each do |property|
expect(subject.class.properties[property.name.to_s].predicate).to eq property.predicate
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/dataset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
end

it "should apply the dataset schema" do
DatasetSchema.properties.each do |property|
LinkedDataFragments::DatasetSchema.properties.each do |property|
expect(subject.class.properties[property.name.to_s].predicate).to eq property.predicate
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
end

it "should apply the Result schema" do
ResultSchema.properties.each do |property|
LinkedDataFragments::ResultSchema.properties.each do |property|
expect(subject.class.properties[property.name.to_s].predicate).to eq property.predicate
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let(:uri) { RDF::Node.new("triplePattern") }

it "should apply the template schema" do
TemplateSchema.properties.each do |property|
LinkedDataFragments::TemplateSchema.properties.each do |property|
expect(subject.class.properties[property.name.to_s].predicate).to eq property.predicate
end
end
Expand Down

0 comments on commit 52c72c5

Please sign in to comment.