query

package module
v0.0.0-...-bd8d8dc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

README

License

Project icon

Query Converter

This is the query-conversion package. It holds the code that translates the JSON of the visual query to the selected database language. There are currently three implementations, one for the Arango Query Language, one for Cypher and finally one for SPARQL.

Creating a new AQL converter

import "git.science.uu.nl/graphpolaris/query-conversion"

queryservice := aql.NewService()

Creating a new Cypher converter

import "git.science.uu.nl/graphpolaris/query-conversion"

queryservice := cypher.NewService()

Creating a new SPARQL converter

import "git.science.uu.nl/graphpolaris/query-conversion"

queryservice := sparql.NewService()

Converting a query

A query can be made by providing the JSON of the visual query and feeding it into the ConvertQuery function.

query, err := queryservice.ConvertQuery(JSONquery)

Creating a mock converter

import "git.science.uu.nl/graphpolaris/query-conversion"

mockService := NewMockService()
Dependencies

This service depends on RabbitMQ

Testing and Coverage

To test the make test command can be used. It will run every test in the repo. To get the code coverage the command make coverage can be used. This command will run all tests and display total coverage over all files. It will also generate a html file which displays exactly which lines have been covered.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalJSON

func UnmarshalJSON(msg *[]byte) (*entityv2.IncomingQueryJSON, error)

UnmarshalJSON takes an incoming message and unmarshals it

msg: *[]byte, the incoming message
Returns: *entity.IncomingQueryJSON, the unmarshalled message and a possible error

Types

type Converter

type Converter interface {
	ConvertQuery(JSONQuery *entityv2.IncomingQueryJSON) (*string, *[]byte, error)
}

A Converter converts an incoming message in our JSON format to a format like AQL or Cypher

Directories

Path Synopsis
This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course.
This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course.

Jump to

Keyboard shortcuts

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