google_knowledge_graph 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +3 -3
- data/lib/google_knowledge_graph.rb +1 -1
- data/lib/google_knowledge_graph/version.rb +1 -1
- data/spec/google_knowledge_graph_spec.rb +1 -7
- metadata +2 -3
- data/Gemfile.lock +0 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 395cceea434b8eaee945e0dcb74a4ce8b65765e48ebe4de83e09477a372dc008
|
4
|
+
data.tar.gz: 6b82808a3c5e77a23007f1300afdc5522833dab67b1d020a152eb9846542dc72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcb1d821039f60aa855fdd200c616e0bbb0dd38941b1a68c36346ac31069d54c5d2262d612e6cf76d70f97ecfd81bf8cd73d8324db5a9b39059a5de1d272dd96
|
7
|
+
data.tar.gz: 047fdeb88587a14ab498f7de9a7ee6044f630e55137edf246c2558da676b7ccb6af8f7bbc385303ed9c821afadc7be887d2e0399fbfa77e0653dfc28e2e8906e
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -33,11 +33,11 @@ GoogleKnowledgeGraph.api_key = 'foo'
|
|
33
33
|
|
34
34
|
### getting knowledge entity by id
|
35
35
|
|
36
|
-
>
|
37
|
-
yet it expects id being `/m/0dl567` when querying the service
|
36
|
+
> Google knowledge graph responses entity result with @id like `kg:/m/0dl567`,
|
37
|
+
yet it expects id being `/m/0dl567` when querying the service. You may pass both into `get` and the prefix `kg:` will be automatically removed.
|
38
38
|
|
39
39
|
```
|
40
|
-
entity = GoogleKnowledgeGraph.get '
|
40
|
+
entity = GoogleKnowledgeGraph.get 'kg:/m/05pbsry'
|
41
41
|
|
42
42
|
# the `data` field contains the original payload
|
43
43
|
entity.data
|
@@ -32,17 +32,11 @@ describe GoogleKnowledgeGraph do
|
|
32
32
|
}.to raise_error 'EmptyAPIKey'
|
33
33
|
end
|
34
34
|
|
35
|
-
it 'raise error for id starting with `kg:`' do
|
36
|
-
expect {
|
37
|
-
GoogleKnowledgeGraph.get 'kg:/m/05pbsry'
|
38
|
-
}.to raise_error 'InvalidIdStartingWithKG'
|
39
|
-
end
|
40
|
-
|
41
35
|
it 'returns an entity' do
|
42
36
|
stub_request(:get, 'https://kgsearch.googleapis.com/v1/entities:search?ids=/m/05pbsry&key=foo&limit=1')
|
43
37
|
.to_return(status: 200, body: File.read('spec/fixtures/getting_entity.json'))
|
44
38
|
|
45
|
-
entity = GoogleKnowledgeGraph.get '
|
39
|
+
entity = GoogleKnowledgeGraph.get 'kg:/m/05pbsry'
|
46
40
|
expect(entity).to be_a GoogleKnowledgeGraph::Entity
|
47
41
|
expect(entity.name).to eq 'Community'
|
48
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_knowledge_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nami WANG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -89,7 +89,6 @@ files:
|
|
89
89
|
- ".gitignore"
|
90
90
|
- ".rspec"
|
91
91
|
- Gemfile
|
92
|
-
- Gemfile.lock
|
93
92
|
- README.md
|
94
93
|
- google_knowledge_graph.gemspec
|
95
94
|
- lib/google_knowledge_graph.rb
|
data/Gemfile.lock
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
google_knowledge_graph (0.1.0)
|
5
|
-
http (~> 4.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
addressable (2.7.0)
|
11
|
-
public_suffix (>= 2.0.2, < 5.0)
|
12
|
-
codecov (0.1.16)
|
13
|
-
json
|
14
|
-
simplecov
|
15
|
-
url
|
16
|
-
crack (0.4.3)
|
17
|
-
safe_yaml (~> 1.0.0)
|
18
|
-
diff-lcs (1.3)
|
19
|
-
docile (1.3.2)
|
20
|
-
domain_name (0.5.20190701)
|
21
|
-
unf (>= 0.0.5, < 1.0.0)
|
22
|
-
ffi (1.12.2)
|
23
|
-
ffi-compiler (1.0.1)
|
24
|
-
ffi (>= 1.0.0)
|
25
|
-
rake
|
26
|
-
hashdiff (1.0.1)
|
27
|
-
http (4.4.1)
|
28
|
-
addressable (~> 2.3)
|
29
|
-
http-cookie (~> 1.0)
|
30
|
-
http-form_data (~> 2.2)
|
31
|
-
http-parser (~> 1.2.0)
|
32
|
-
http-cookie (1.0.3)
|
33
|
-
domain_name (~> 0.5)
|
34
|
-
http-form_data (2.3.0)
|
35
|
-
http-parser (1.2.1)
|
36
|
-
ffi-compiler (>= 1.0, < 2.0)
|
37
|
-
json (2.3.0)
|
38
|
-
public_suffix (4.0.5)
|
39
|
-
rake (13.0.1)
|
40
|
-
rspec (3.9.0)
|
41
|
-
rspec-core (~> 3.9.0)
|
42
|
-
rspec-expectations (~> 3.9.0)
|
43
|
-
rspec-mocks (~> 3.9.0)
|
44
|
-
rspec-core (3.9.2)
|
45
|
-
rspec-support (~> 3.9.3)
|
46
|
-
rspec-expectations (3.9.2)
|
47
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.9.0)
|
49
|
-
rspec-mocks (3.9.1)
|
50
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.9.0)
|
52
|
-
rspec-support (3.9.3)
|
53
|
-
safe_yaml (1.0.5)
|
54
|
-
simplecov (0.18.5)
|
55
|
-
docile (~> 1.1)
|
56
|
-
simplecov-html (~> 0.11)
|
57
|
-
simplecov-html (0.12.2)
|
58
|
-
unf (0.1.4)
|
59
|
-
unf_ext
|
60
|
-
unf_ext (0.0.7.7)
|
61
|
-
url (0.3.2)
|
62
|
-
webmock (3.8.3)
|
63
|
-
addressable (>= 2.3.6)
|
64
|
-
crack (>= 0.3.2)
|
65
|
-
hashdiff (>= 0.4.0, < 2.0.0)
|
66
|
-
|
67
|
-
PLATFORMS
|
68
|
-
ruby
|
69
|
-
|
70
|
-
DEPENDENCIES
|
71
|
-
codecov
|
72
|
-
google_knowledge_graph!
|
73
|
-
rspec (~> 3.0)
|
74
|
-
simplecov (~> 0.18)
|
75
|
-
webmock (~> 3.0)
|
76
|
-
|
77
|
-
BUNDLED WITH
|
78
|
-
2.1.4
|