SPARQL Builder API Specification

This page introduces the specification of SPARQL Builder API used by SPARQL Builder GUI.

Endpoint list

You can get the list of SPARQL endpoints as a json array as follows:


Class list

If you input the  URL of sparql endpoint with parameter “ep”, the class list will return as a json array of json objects including “uri” for a class and a string “display” of a label and the number of instances as follows:

[{"uri":"","label":"Gene","number":"11252"},{"uri":"","label":"Protein","number":"3528"},{"uri":"","label":"Compound","number": 8235"}

Path list

For the  URL of sparql endpoint with parameter “ep”, the URL of a class with parameter “startClass”, and the URL of a class with parameter “endClass”, you can get the list of paths between the two classes  sorted by the number of triples as json object as follows:


Note that parameter “direction'” can be “forward” or “reverse”. To know details for paths and class links, please see here.

SPARQL generation from a path

For a path with a parameter “path” described as a json object as shown in the example of Path list, you can get a SPARQL query as a string.

Output: A SPARQL query