mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-26 08:56:21 +02:00
Feature/wikipedia ddg (#185)
API-side support for Wikipedia, DBpedia and internet search functions This incorporates a refactor of the API code to break it up, separate classes for endpoints to reduce duplication
This commit is contained in:
parent
212102c61c
commit
6d200c79c5
50 changed files with 1287 additions and 826 deletions
|
|
@ -9,4 +9,6 @@ from . graph import *
|
|||
from . retrieval import *
|
||||
from . metadata import *
|
||||
from . agent import *
|
||||
from . lookup import *
|
||||
|
||||
|
||||
|
|
|
|||
42
trustgraph-base/trustgraph/schema/lookup.py
Normal file
42
trustgraph-base/trustgraph/schema/lookup.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
from pulsar.schema import Record, String
|
||||
|
||||
from . types import Error, Value, Triple
|
||||
from . topic import topic
|
||||
from . metadata import Metadata
|
||||
|
||||
############################################################################
|
||||
|
||||
# Lookups
|
||||
|
||||
class LookupRequest(Record):
|
||||
kind = String()
|
||||
term = String()
|
||||
|
||||
class LookupResponse(Record):
|
||||
text = String()
|
||||
error = Error()
|
||||
|
||||
encyclopedia_lookup_request_queue = topic(
|
||||
'encyclopedia', kind='non-persistent', namespace='request'
|
||||
)
|
||||
encyclopedia_lookup_response_queue = topic(
|
||||
'encyclopedia', kind='non-persistent', namespace='response',
|
||||
)
|
||||
|
||||
dbpedia_lookup_request_queue = topic(
|
||||
'dbpedia', kind='non-persistent', namespace='request'
|
||||
)
|
||||
dbpedia_lookup_response_queue = topic(
|
||||
'dbpedia', kind='non-persistent', namespace='response',
|
||||
)
|
||||
|
||||
internet_search_request_queue = topic(
|
||||
'internet-search', kind='non-persistent', namespace='request'
|
||||
)
|
||||
internet_search_response_queue = topic(
|
||||
'internet-search', kind='non-persistent', namespace='response',
|
||||
)
|
||||
|
||||
############################################################################
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue