Skip to content

Commit 7ba63e2

Browse files
[alchemy] Added support for typed relations
1 parent 9e8644d commit 7ba63e2

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

lib/alchemy_endpoints.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,11 @@
117117
"title": {
118118
"url": "/url/URLGetTitle",
119119
"html": "/html/HTMLGetTitle"
120+
},
121+
122+
"typed_relations": {
123+
"url": "/url/URLGetTypedRelations",
124+
"text": "/text/TextGetTypedRelations",
125+
"html": "/html/HTMLGetTypedRelations"
120126
}
121127
}

services/alchemy_language/v1.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,11 @@ AlchemyLanguage.prototype.combined = createRequest('combined');
177177
*/
178178
AlchemyLanguage.prototype.emotion = createRequest('emotion');
179179

180+
/**
181+
* Finds entities and their relationships
182+
* for text, HTML, or a URL.
183+
*/
184+
AlchemyLanguage.prototype.typedRelations = createRequest('typed_relations');
185+
186+
180187
module.exports = AlchemyLanguage;

test/test.integration-all-services.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,19 @@ describe(MAX_RETRIES, 'integration-all-services', function() {
557557
text: text
558558
}, failIfError.bind(failIfError, done));
559559
});
560+
561+
it('typedRelationsWithHtml()', function(done) {
562+
alchemy_language.typedRelations({
563+
html: text
564+
}, failIfError.bind(failIfError, done));
565+
});
566+
567+
it('typedRelationsWithText()', function(done) {
568+
alchemy_language.typedRelations({
569+
text: text
570+
}, failIfError.bind(failIfError, done));
571+
});
572+
560573
});
561574

562575
describe('functional_alchemy_data_news', function() {

0 commit comments

Comments
 (0)