Keys

All API requests must have a HTTP header with one of your API keys enabled for the intended operation (SPARQL access or API access).

You can manage your API keys from the dedicated panel, in your account: create as many keys as you want, and grant them the proper access for each.

SPARQL

To programmatically perform your queries on the SPARQL endpoint, send a GET request to https://query.semantic.builders/sparql adding the header api-key with a key enabled for "Access to SPARQL endpoint".

Here you find a few samples, in different languages:

API

Semantic Builders exposed a simple API to access your Saved Queries and Extractions.

All requests must have a X-SB-Key header with a key enabled for "Access to API".

Available endpoints:

  • GET https://semantic.builders/api/saved

    To access the list of your saved queries. This returns a JSON array, containing a JSON object for each query.

    [
      {
        "id": "ef7d45c0-a13a-4795-9503-64521a5b6f5d",
        "title": "My Saved Query",
        "access": "private",
        "created_at": "2022-12-24T13:29:24",
        "size": 1463071
      },
      {
        "id": "6d8dbba4-22b0-47c0-89df-b479c287ad1f",
        "title": "My Other Saved Query",
        "access": "private",
        "created_at": "2022-12-20T12:23:24",
        "size": 4014811
      }
    ]

    Each saved query is described by:

    • id - the unique identifier of the element; use it to retrive contents with the related API endpoint
    • title - the title assigned to the element
    • access - public or private, accordly to the settings
    • created_at - date of creation of the element
    • size - filesize, in bytes

    Error codes:

    • 401 no key has been provided, or the provided one is invalid.
    • 403 the provided key is not enabled for API access.
  • GET https://semantic.builders/api/saved/ID

    To access the actual contents of a given saved query, identified by the id (provided by the listing endpoint).

    Contents are returned in standard SPARQL Query Results JSON.

    {
      "head": {
        "vars": ["item", "itemLabel"]
      },
      "results": {
        "bindings": [
          {
            "item": {
              "type": "uri",
              "value": "http://www.wikidata.org/entity/Q378619"
            },
            "itemLabel": {
              "xml:lang": "en",
              "type": "literal",
              "value": "CC"
            }
          },
          {
            "item": {
              "type": "uri",
              "value": "http://www.wikidata.org/entity/Q498787"
            },
            "itemLabel": {
              "xml:lang": "en",
              "type": "literal",
              "value": "Muezza"
            }
          }
        ]
      }
    }

    Error codes:

    • 401 no key has been provided, or the provided one is invalid.
    • 403 the provided key is not enabled for API access.
    • 404 the required ID does not exists, or is not accessible with the given key.
  • GET https://semantic.builders/api/extracts

    To access the list of your extractions. This returns a JSON array, containing a JSON object for each query.

    [
      {
        "id": "b2454d94-a44e-403d-aa38-ee21512d7db6",
        "title": "My Extraction",
        "created_at": "2022-12-24T13:29:24",
        "size": 3991013
      },
      {
        "id": "5353ad62-dfb9-4721-826a-01cc51710287",
        "title": "My Other Extraction",
        "created_at": "2022-12-20T12:23:24",
        "size": 2712268
      }
    ]

    Each extraction is described by:

    • id - the unique identifier of the element; use it to retrive contents with the related API endpoint
    • title - the title assigned to the element
    • created_at - date of creation of the element
    • size - filesize, in bytes

    Error codes:

    • 401 no key has been provided, or the provided one is invalid.
    • 403 the provided key is not enabled for API access.
  • GET https://semantic.builders/api/extracts/ID

    To access the actual contents of a given extraction, identified by the id (provided by the listing endpoint).

    Contents are returned in CSV.

    Q1868,"Paul Otlet",+1868-08-23T00:00:00Z,+1944-12-10T00:00:00Z
    Q23,"George Washington",+1732-02-22T00:00:00Z,+1799-12-14T00:00:00Z
    Q42,"Douglas Adams",+1952-03-11T00:00:00Z,+2001-05-11T00:00:00Z
    Q368,"Augusto Pinochet",+1915-11-25T00:00:00Z,+2006-12-10T00:00:00Z

    Error codes:

    • 401 no key has been provided, or the provided one is invalid.
    • 403 the provided key is not enabled for API access.
    • 404 the required ID does not exists, or is not accessible with the given key.