request_handlers

package
v0.0.0-...-584605b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

#Generic utility functions

Add a list of entities as links to a parent entity and save them to GIG

AddEntityAsAttribute

Add a list of entities as attribute to a parent entity and save them to GIG
Add one entity as a link to a parent entity and save them to GIG

CreateEntities

Save a list of entities to the server

CreateEntity

Save an entity to the server

CreateEntityFromText

Create entity from text content and save an entity to the server    

ExtractEntityNames

Given a text content extract Named Entities and their type using NER.

GetEntity

Get a entity by name from the server

GetRequest

Get the response string for a given url    

PostRequest

Post to an url with data

UploadImage

Post a file to server using file source url. The server will download and store the file in local servers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEntitiesAsLinks(entity models.Entity, linkEntities []models.Entity) (models.Entity, error)

* Add list of related entities to a given entity

func AddEntityAsAttribute

func AddEntityAsAttribute(entity models.Entity, attributeName string, attributeEntity models.Entity) (models.Entity, models.Entity, error)

* Add entity as an attribute to a given entity

func AddEntityAsLink(entity models.Entity, linkEntity models.Entity) (models.Entity, models.Entity, error)

* Add entity as an link to a given entity

func CreateEntities

func CreateEntities(entities []models.Entity) ([]models.Entity, error)

* Create a list of new entities and save to GIG

func CreateEntity

func CreateEntity(entity models.Entity) (models.Entity, error)

* Create a new entity and save to GIG

func CreateEntityFromText

func CreateEntityFromText(textContent string, title string, categories []string, entityTitles []models.NERResult) error

func ExtractEntityNames

func ExtractEntityNames(textContent string) ([]models.NERResult, error)

* NER extraction

func GetEntity

func GetEntity(title string) (models.Entity, error)

* GetEntity

func GetRequest

func GetRequest(uri string) (string, error)

*

get the response string for a given url

func NormalizeName

func NormalizeName(title string) (string, error)

* normalize entity title before appending

func PostRequest

func PostRequest(uri string, data interface{}) (string, error)

* Post to an url with data

func UploadImage

func UploadImage(payload models.Upload) error

* Upload an image through API

Types

type Response

type Response struct {
	Status  int    `json:"status"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL