tripod 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/tripod.rb +2 -1
- data/lib/tripod/components.rb +1 -0
- data/lib/tripod/eager_loading.rb +54 -0
- data/lib/tripod/errors.rb +1 -0
- data/lib/tripod/errors/graph_uri_not_set.rb +9 -0
- data/lib/tripod/finders.rb +80 -76
- data/lib/tripod/persistence.rb +2 -0
- data/lib/tripod/repository.rb +18 -14
- data/lib/tripod/resource.rb +2 -3
- data/lib/tripod/version.rb +1 -1
- data/spec/app/models/resource.rb +7 -0
- data/spec/tripod/eager_loading_spec.rb +103 -0
- data/spec/tripod/persistence_spec.rb +9 -0
- data/spec/tripod/repository_spec.rb +0 -26
- metadata +26 -20
data/lib/tripod.rb
CHANGED
@@ -68,10 +68,11 @@ require "tripod/sparql_client"
|
|
68
68
|
require "tripod/predicates"
|
69
69
|
require "tripod/attributes"
|
70
70
|
require "tripod/errors"
|
71
|
+
require "tripod/repository"
|
71
72
|
require "tripod/fields"
|
72
73
|
require "tripod/finders"
|
73
74
|
require "tripod/persistence"
|
74
|
-
require "tripod/
|
75
|
+
require "tripod/eager_loading"
|
75
76
|
require "tripod/serialization"
|
76
77
|
require "tripod/state"
|
77
78
|
require "tripod/version"
|
data/lib/tripod/components.rb
CHANGED
@@ -0,0 +1,54 @@
|
|
1
|
+
module Tripod::EagerLoading
|
2
|
+
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
# array of resources that represent the predicates of the triples of this resource
|
6
|
+
attr_reader :predicate_resources
|
7
|
+
|
8
|
+
# array of resources that represent the objects of the triples of this resource
|
9
|
+
attr_reader :object_resources
|
10
|
+
|
11
|
+
# get all the triples in the db where the predicate uri is their subject
|
12
|
+
# stick the results in this resource's repo
|
13
|
+
def eager_load_predicate_triples!
|
14
|
+
graph_of_triples = self.class.describe_uris(predicates)
|
15
|
+
self.class.add_data_to_repository(graph_of_triples, self.repository)
|
16
|
+
end
|
17
|
+
|
18
|
+
# get all the triples in the db where the object uri is their subject
|
19
|
+
# stick the results in this resource's repo
|
20
|
+
def eager_load_object_triples!
|
21
|
+
object_uris = []
|
22
|
+
|
23
|
+
self.repository.query( [RDF::URI.new(self.uri), :predicate, :object] ) do |statement|
|
24
|
+
object_uris << statement.object if statement.object.uri?
|
25
|
+
end
|
26
|
+
|
27
|
+
object_uris = object_uris.uniq # in case an object appears > once.
|
28
|
+
graph_of_triples = self.class.describe_uris(object_uris)
|
29
|
+
self.class.add_data_to_repository(graph_of_triples, self.repository)
|
30
|
+
end
|
31
|
+
|
32
|
+
# get the resource that represents a particular uri. If there's triples in our repo where that uri
|
33
|
+
# is the subject, use that to hydrate a resource, otherwise justdo a find against the db.
|
34
|
+
def get_related_resource(resource_uri, class_of_resource_to_create)
|
35
|
+
data_graph = RDF::Graph.new
|
36
|
+
|
37
|
+
self.repository.query( [ RDF::URI.new(resource_uri.to_s), :predicate, :object] ) do |stmt|
|
38
|
+
data_graph << stmt
|
39
|
+
end
|
40
|
+
|
41
|
+
if data_graph.empty?
|
42
|
+
# this means that we've not already looked it up
|
43
|
+
r = class_of_resource_to_create.find(resource_uri)
|
44
|
+
else
|
45
|
+
# it's in our eager loaded repo
|
46
|
+
r = class_of_resource_to_create.new(resource_uri)
|
47
|
+
r.hydrate!(:graph => data_graph)
|
48
|
+
r.new_record = false
|
49
|
+
r
|
50
|
+
end
|
51
|
+
r
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
data/lib/tripod/errors.rb
CHANGED
data/lib/tripod/finders.rb
CHANGED
@@ -4,81 +4,6 @@
|
|
4
4
|
module Tripod::Finders
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
|
-
# FOLLOWING METHODS NOT PART OF THE PUBLIC API:
|
8
|
-
## private methods
|
9
|
-
def self.included(base)
|
10
|
-
|
11
|
-
class << base
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def select_uris_and_graphs(criteria, opts)
|
16
|
-
select_results = Tripod::SparqlClient::Query.select(criteria)
|
17
|
-
|
18
|
-
# data will contain a map of uris against graphs.
|
19
|
-
data = {}
|
20
|
-
|
21
|
-
select_results.each do |r|
|
22
|
-
uri_variable = opts[:uri_variable] || 'uri'
|
23
|
-
graph_variable = opts[:graph_variable] || 'graph'
|
24
|
-
data[ r[uri_variable]["value"] ] = r[graph_variable]["value"]
|
25
|
-
end
|
26
|
-
|
27
|
-
data
|
28
|
-
end
|
29
|
-
|
30
|
-
def create_and_hydrate_resources(uris_and_graphs, opts={})
|
31
|
-
|
32
|
-
triples_repository = create_resources(uris_and_graphs)
|
33
|
-
resources = hydrate_resources(uris_and_graphs, triples_repository, opts)
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
def create_resources(uris_and_graphs)
|
38
|
-
|
39
|
-
triples_repository = RDF::Repository.new()
|
40
|
-
|
41
|
-
if uris_and_graphs.keys.length > 0
|
42
|
-
uris_sparql_str = uris_and_graphs.keys.map{ |u| "<#{u}>" }.join(" ")
|
43
|
-
|
44
|
-
# Do a big describe statement, and read the results into an in-memory repo
|
45
|
-
triples = Tripod::SparqlClient::Query::describe("DESCRIBE #{uris_sparql_str}")
|
46
|
-
RDF::Reader.for(:ntriples).new(triples) do |reader|
|
47
|
-
reader.each_statement do |statement|
|
48
|
-
triples_repository << statement
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
triples_repository
|
54
|
-
end
|
55
|
-
|
56
|
-
def hydrate_resources(uris_and_graphs, triples_repository, opts={})
|
57
|
-
|
58
|
-
resources =[]
|
59
|
-
|
60
|
-
uris_and_graphs.each_pair do |u,g|
|
61
|
-
r = self.new(u,g)
|
62
|
-
data_graph = RDF::Graph.new
|
63
|
-
triples_repository.query( [RDF::URI.new(u), :predicate, :object] ) do |statement|
|
64
|
-
data_graph << statement
|
65
|
-
end
|
66
|
-
|
67
|
-
hydrate_opts = {:graph => data_graph}
|
68
|
-
hydrate_opts[:only] = opts[:only_hydrate]
|
69
|
-
|
70
|
-
r.hydrate!(:graph => data_graph)
|
71
|
-
r.new_record = false
|
72
|
-
resources << r
|
73
|
-
end
|
74
|
-
|
75
|
-
resources
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
7
|
module ClassMethods
|
83
8
|
|
84
9
|
# Find a +Resource+ by its uri (and, optionally, by its graph if there are more than one).
|
@@ -139,7 +64,86 @@ module Tripod::Finders
|
|
139
64
|
# @return [ Array ] An array of hydrated resources of this class's type.
|
140
65
|
def where(criteria, opts={})
|
141
66
|
uris_and_graphs = select_uris_and_graphs(criteria, opts)
|
142
|
-
create_and_hydrate_resources(uris_and_graphs
|
67
|
+
create_and_hydrate_resources(uris_and_graphs)
|
68
|
+
end
|
69
|
+
|
70
|
+
# returns a graph of triples which describe the uris passed in.
|
71
|
+
def describe_uris(uris)
|
72
|
+
graph = RDF::Graph.new
|
73
|
+
|
74
|
+
if uris.length > 0
|
75
|
+
uris_sparql_str = uris.map{ |u| "<#{u.to_s}>" }.join(" ")
|
76
|
+
|
77
|
+
# Do a big describe statement, and read the results into an in-memory repo
|
78
|
+
triples_string = Tripod::SparqlClient::Query::describe("DESCRIBE #{uris_sparql_str}")
|
79
|
+
|
80
|
+
RDF::Reader.for(:ntriples).new(triples_string) do |reader|
|
81
|
+
reader.each_statement do |statement|
|
82
|
+
graph << statement
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
graph
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
# FOLLOWING METHODS NOT PART OF THE PUBLIC API:
|
95
|
+
def self.included(base)
|
96
|
+
|
97
|
+
class << base
|
98
|
+
|
99
|
+
private
|
100
|
+
|
101
|
+
# create and hydrate the resources identified in uris_and_graphs.
|
102
|
+
# Note: if any of the graphs are not set, those resources can still be constructed, but not persisted back to DB.
|
103
|
+
def create_and_hydrate_resources(uris_and_graphs)
|
104
|
+
|
105
|
+
graph = describe_uris(uris_and_graphs.keys)
|
106
|
+
repo = add_data_to_repository(graph)
|
107
|
+
|
108
|
+
resources = []
|
109
|
+
|
110
|
+
uris_and_graphs.each_pair do |u,g|
|
111
|
+
|
112
|
+
# instantiate a new resource
|
113
|
+
r = self.new(u,g)
|
114
|
+
|
115
|
+
# make a graph of data for this resource's uri
|
116
|
+
data_graph = RDF::Graph.new
|
117
|
+
repo.query( [RDF::URI.new(u), :predicate, :object] ) do |statement|
|
118
|
+
data_graph << statement
|
119
|
+
end
|
120
|
+
|
121
|
+
# use it to hydrate this resource
|
122
|
+
r.hydrate!(:graph => data_graph)
|
123
|
+
r.new_record = false
|
124
|
+
resources << r
|
125
|
+
end
|
126
|
+
|
127
|
+
resources
|
128
|
+
end
|
129
|
+
|
130
|
+
|
131
|
+
# based on the query passed in, build a hash of uris->graphs
|
132
|
+
def select_uris_and_graphs(criteria, opts)
|
133
|
+
select_results = Tripod::SparqlClient::Query.select(criteria)
|
134
|
+
|
135
|
+
uris_and_graphs = {}
|
136
|
+
|
137
|
+
select_results.each do |r|
|
138
|
+
uri_variable = opts[:uri_variable] || 'uri'
|
139
|
+
graph_variable = opts[:graph_variable] || 'graph'
|
140
|
+
uris_and_graphs[ r[uri_variable]["value"] ] = r[graph_variable]["value"]
|
141
|
+
end
|
142
|
+
|
143
|
+
uris_and_graphs
|
144
|
+
end
|
145
|
+
|
146
|
+
|
143
147
|
end
|
144
148
|
|
145
149
|
end
|
data/lib/tripod/persistence.rb
CHANGED
@@ -68,6 +68,8 @@ module Tripod::Persistence
|
|
68
68
|
# @return [ true, false ] True is success, false if not.
|
69
69
|
def save(opts={})
|
70
70
|
|
71
|
+
raise Tripod::Errors::GraphUriNotSet.new() unless @graph_uri
|
72
|
+
|
71
73
|
transaction = Tripod::Persistence::Transaction.get_transcation(opts[:transaction])
|
72
74
|
|
73
75
|
if self.valid?
|
data/lib/tripod/repository.rb
CHANGED
@@ -15,16 +15,11 @@ module Tripod::Repository
|
|
15
15
|
# @example Hydrate the resource from a passed in graph
|
16
16
|
# person.hydrate!(:graph => my_graph)
|
17
17
|
#
|
18
|
-
# @example Only hydrate certain predicates (ignored if a graph is passde in)
|
19
|
-
# person.hydrate!(:only => ["http://foo", "http://bar"])
|
20
|
-
# person.hydrate!(:only => "http://foo")
|
21
|
-
#
|
22
18
|
#
|
23
19
|
# @return [ RDF::Repository ] A reference to the repository for this instance.
|
24
20
|
def hydrate!(opts = {})
|
25
21
|
|
26
22
|
graph = opts[:graph]
|
27
|
-
only_hydrate_predicates = [opts[:only]].flatten # allow
|
28
23
|
|
29
24
|
# we require that the uri is set.
|
30
25
|
raise Tripod::Errors::UriNotSet.new() unless @uri
|
@@ -40,15 +35,7 @@ module Tripod::Repository
|
|
40
35
|
end
|
41
36
|
else
|
42
37
|
|
43
|
-
|
44
|
-
triples = Tripod::SparqlClient::Query::describe("DESCRIBE <#{uri}>")
|
45
|
-
else
|
46
|
-
query = "CONSTRUCT { <#{uri}> ?p ?o } WHERE { <#{uri}> ?p ?o . FILTER ("
|
47
|
-
query += only_hydrate_predicates.map { |p| "?p = <#{p.to_s}>" }.join(" || ")
|
48
|
-
query += ")}"
|
49
|
-
triples = Tripod::SparqlClient::Query::construct(query)
|
50
|
-
end
|
51
|
-
|
38
|
+
triples = Tripod::SparqlClient::Query::describe("DESCRIBE <#{uri}>")
|
52
39
|
@repository = RDF::Repository.new
|
53
40
|
RDF::Reader.for(:ntriples).new(triples) do |reader|
|
54
41
|
reader.each_statement do |statement|
|
@@ -59,4 +46,21 @@ module Tripod::Repository
|
|
59
46
|
|
60
47
|
end
|
61
48
|
|
49
|
+
module ClassMethods
|
50
|
+
|
51
|
+
# for triples in the graph passed in, add them to the passed in repository obj, and return the repository objects
|
52
|
+
# if no repository passed, make a new one.
|
53
|
+
def add_data_to_repository(graph, repo=nil)
|
54
|
+
|
55
|
+
repo ||= RDF::Repository.new()
|
56
|
+
|
57
|
+
graph.each_statement do |statement|
|
58
|
+
repo << statement
|
59
|
+
end
|
60
|
+
|
61
|
+
repo
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
62
66
|
end
|
data/lib/tripod/resource.rb
CHANGED
@@ -27,6 +27,7 @@ module Tripod::Resource
|
|
27
27
|
# Person.new('http://swirrl.com/ric.rdf#me')
|
28
28
|
#
|
29
29
|
# @param [ String, RDF::URI ] uri The uri of the resource.
|
30
|
+
# @param [ String, RDF::URI ] graph_uri The graph_uri where this resource will be saved to. If ommitted, this resource cannot be persisted.
|
30
31
|
#
|
31
32
|
# @return [ Resource ] A new +Resource+
|
32
33
|
def initialize(uri, graph_uri=nil)
|
@@ -34,9 +35,7 @@ module Tripod::Resource
|
|
34
35
|
@uri = RDF::URI(uri.to_s)
|
35
36
|
|
36
37
|
graph_uri ||= self.class._GRAPH_URI if self.class._GRAPH_URI
|
37
|
-
|
38
|
-
@graph_uri = RDF::URI(graph_uri)
|
39
|
-
|
38
|
+
@graph_uri = RDF::URI(graph_uri) if graph_uri
|
40
39
|
@repository = RDF::Repository.new
|
41
40
|
@new_record = true
|
42
41
|
self.rdf_type = self.class._RDF_TYPE if respond_to?(:rdf_type=)
|
data/lib/tripod/version.rb
CHANGED
@@ -0,0 +1,103 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Tripod::EagerLoading do
|
4
|
+
|
5
|
+
before do
|
6
|
+
|
7
|
+
@name = Resource.new('http://name', 'http://names')
|
8
|
+
@name.label = "Name"
|
9
|
+
@name.save!
|
10
|
+
|
11
|
+
@peter = Person.new('http://peter')
|
12
|
+
@peter.name = "Peter"
|
13
|
+
@peter.save!
|
14
|
+
|
15
|
+
@john = Person.new('http://john')
|
16
|
+
@john.name = "john"
|
17
|
+
@john.knows = @peter.uri
|
18
|
+
@john.save!
|
19
|
+
end
|
20
|
+
|
21
|
+
describe "#eager_load_predicate_triples!" do
|
22
|
+
|
23
|
+
before do
|
24
|
+
@peter.eager_load_predicate_triples!
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should add triples to the repository for the predicates" do
|
28
|
+
triples = @peter.repository.query([ RDF::URI.new('http://name'), :predicate, :object] )
|
29
|
+
triples.to_a.length.should_not == 0
|
30
|
+
triples.first.predicate.should == RDF::RDFS.label
|
31
|
+
triples.first.object.to_s.should == "Name"
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "#eager_load_object_triples!" do
|
37
|
+
|
38
|
+
before do
|
39
|
+
@john.eager_load_object_triples!
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should add triples to the repository for the objects" do
|
43
|
+
triples = @john.repository.query([ @peter.uri, :predicate, :object] )
|
44
|
+
triples.to_a.length.should_not == 0
|
45
|
+
|
46
|
+
triples.first.predicate.should == RDF.type
|
47
|
+
triples.first.object.to_s.should == RDF::URI('http://person')
|
48
|
+
|
49
|
+
triples.to_a[1].predicate.should == RDF::URI('http://name')
|
50
|
+
triples.to_a[1].object.to_s.should == "Peter"
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "#get_related_resource" do
|
56
|
+
|
57
|
+
context "when eager load not called" do
|
58
|
+
it "should do a find on the right class to get the right instance of the resource class passed in" do
|
59
|
+
Person.should_receive(:find).with( @peter.uri ).and_call_original
|
60
|
+
res = @john.get_related_resource(@peter.uri, Person)
|
61
|
+
res.should == @peter
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context "when eager_load_object_triples has been called" do
|
66
|
+
before do
|
67
|
+
@john.eager_load_object_triples!
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should not call find" do
|
71
|
+
Person.should_not_receive(:find)
|
72
|
+
@john.get_related_resource(@peter.uri, Person)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should get the right instance of the resource class passed in" do
|
76
|
+
res = @john.get_related_resource(@peter.uri, Person)
|
77
|
+
res.should == @peter
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
context "when eager_load_predicate_triples has been called" do
|
82
|
+
before do
|
83
|
+
@john.eager_load_predicate_triples!
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should not call find" do
|
87
|
+
Person.should_not_receive(:find)
|
88
|
+
@john.get_related_resource(RDF::URI.new('http://name'), Resource)
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should get the right instance of the resource class passed in" do
|
92
|
+
res = @john.get_related_resource(RDF::URI.new('http://name'), Resource)
|
93
|
+
res.should == @name
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should be possible to call methods on the returned object" do
|
97
|
+
@john.get_related_resource(RDF::URI.new('http://name'), Resource).label.should == @name.label
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
@@ -32,6 +32,14 @@ describe Tripod::Persistence do
|
|
32
32
|
|
33
33
|
|
34
34
|
describe ".save" do
|
35
|
+
|
36
|
+
context "with no graph_uri set" do
|
37
|
+
it 'should raise a GraphUriNotSet error' do
|
38
|
+
p = Resource.new('http://arbitrary/resource')
|
39
|
+
lambda { p.save }.should raise_error(Tripod::Errors::GraphUriNotSet)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
35
43
|
it 'saves the contents to the db' do
|
36
44
|
unsaved_person.save.should be_true
|
37
45
|
|
@@ -45,6 +53,7 @@ describe Tripod::Persistence do
|
|
45
53
|
repo_statements.first.object.should == RDF::URI.new('http://obj')
|
46
54
|
end
|
47
55
|
|
56
|
+
|
48
57
|
it 'should leave other people untouched' do
|
49
58
|
# save the unsaved person
|
50
59
|
unsaved_person.save.should be_true
|
@@ -33,32 +33,6 @@ describe Tripod::Repository do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
36
|
-
|
37
|
-
context 'single predicate restriction passed' do
|
38
|
-
it 'calls the right CONSTRUCT query' do
|
39
|
-
Tripod::SparqlClient::Query.should_receive(:construct).with("CONSTRUCT { <http://foobar> ?p ?o } WHERE { <http://foobar> ?p ?o . FILTER (?p = <http://pred>)}").and_call_original
|
40
|
-
person.hydrate!(:only => 'http://pred')
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'only populates the right predicates' do
|
44
|
-
person.hydrate!(:only => 'http://pred')
|
45
|
-
person.predicates.length.should ==1
|
46
|
-
person.predicates.should == [RDF::URI('http://pred')]
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
context 'multiple predicate restrictions passed' do
|
51
|
-
it 'calls the right CONSTRUCT query' do
|
52
|
-
Tripod::SparqlClient::Query.should_receive(:construct).with("CONSTRUCT { <http://foobar> ?p ?o } WHERE { <http://foobar> ?p ?o . FILTER (?p = <http://pred> || ?p = <http://anotherpred>)}").and_call_original
|
53
|
-
person.hydrate!(:only => ['http://pred', 'http://anotherpred'])
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'only populates the right predicates' do
|
57
|
-
person.hydrate!(:only => ['http://pred2', 'http://pred'])
|
58
|
-
person.predicates.length.should == 2
|
59
|
-
person.predicates.should == [RDF::URI('http://pred'), RDF::URI('http://pred2')]
|
60
|
-
end
|
61
|
-
end
|
62
36
|
end
|
63
37
|
|
64
38
|
context 'graph passed' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tripod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-02-
|
14
|
+
date: 2013-02-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|
18
|
-
requirement: &
|
18
|
+
requirement: &70274473451860 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70274473451860
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activemodel
|
29
|
-
requirement: &
|
29
|
+
requirement: &70274473450860 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: '3.1'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70274473450860
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: equivalent-xml
|
40
|
-
requirement: &
|
40
|
+
requirement: &70274473466560 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: '0'
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70274473466560
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rdf
|
51
|
-
requirement: &
|
51
|
+
requirement: &70274473465400 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ~>
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '1.0'
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70274473465400
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: rdf-rdfxml
|
62
|
-
requirement: &
|
62
|
+
requirement: &70274473464180 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: '0'
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70274473464180
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rdf-n3
|
73
|
-
requirement: &
|
73
|
+
requirement: &70274473463580 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: '0'
|
79
79
|
type: :runtime
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *70274473463580
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: rdf-json
|
84
|
-
requirement: &
|
84
|
+
requirement: &70274473462900 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *70274473462900
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: json-ld
|
95
|
-
requirement: &
|
95
|
+
requirement: &70274473462160 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ! '>='
|
@@ -100,10 +100,10 @@ dependencies:
|
|
100
100
|
version: '0'
|
101
101
|
type: :runtime
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *70274473462160
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: guid
|
106
|
-
requirement: &
|
106
|
+
requirement: &70274473461300 !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
109
|
- - ! '>='
|
@@ -111,7 +111,7 @@ dependencies:
|
|
111
111
|
version: '0'
|
112
112
|
type: :runtime
|
113
113
|
prerelease: false
|
114
|
-
version_requirements: *
|
114
|
+
version_requirements: *70274473461300
|
115
115
|
description: RDF ruby ORM
|
116
116
|
email:
|
117
117
|
- ric@swirrl.com
|
@@ -127,8 +127,10 @@ files:
|
|
127
127
|
- lib/tripod.rb
|
128
128
|
- lib/tripod/attributes.rb
|
129
129
|
- lib/tripod/components.rb
|
130
|
+
- lib/tripod/eager_loading.rb
|
130
131
|
- lib/tripod/errors.rb
|
131
132
|
- lib/tripod/errors/field_not_present.rb
|
133
|
+
- lib/tripod/errors/graph_uri_not_set.rb
|
132
134
|
- lib/tripod/errors/resource_not_found.rb
|
133
135
|
- lib/tripod/errors/uri_not_set.rb
|
134
136
|
- lib/tripod/errors/validations.rb
|
@@ -146,8 +148,10 @@ files:
|
|
146
148
|
- lib/tripod/state.rb
|
147
149
|
- lib/tripod/version.rb
|
148
150
|
- spec/app/models/person.rb
|
151
|
+
- spec/app/models/resource.rb
|
149
152
|
- spec/spec_helper.rb
|
150
153
|
- spec/tripod/attributes_spec.rb
|
154
|
+
- spec/tripod/eager_loading_spec.rb
|
151
155
|
- spec/tripod/fields_spec.rb
|
152
156
|
- spec/tripod/finders_spec.rb
|
153
157
|
- spec/tripod/persistence_spec.rb
|
@@ -183,8 +187,10 @@ specification_version: 3
|
|
183
187
|
summary: Active Model style RDF ORM
|
184
188
|
test_files:
|
185
189
|
- spec/app/models/person.rb
|
190
|
+
- spec/app/models/resource.rb
|
186
191
|
- spec/spec_helper.rb
|
187
192
|
- spec/tripod/attributes_spec.rb
|
193
|
+
- spec/tripod/eager_loading_spec.rb
|
188
194
|
- spec/tripod/fields_spec.rb
|
189
195
|
- spec/tripod/finders_spec.rb
|
190
196
|
- spec/tripod/persistence_spec.rb
|