POST sparql-endpoint/query

Get a DataSet with the result of the query

Request Information

Headers

HTTP_AUTHORIZATION: Required. OAuth 1.0 parameters with the OAuth signature of the url you are going to request. The consumer keys and access token can be obtained from the community administration.

Sample:
        HTTP_AUTHORIZATION:
            OAuth oauth_token="CObXqjfOisVh9%2F2GjC7NNd8BCzY%3D",
            oauth_consumer_key="clGACsiGaMp%2FD%2BUwkSvRBxA1k50%3D",
            oauth_nonce="VqKza6d5x1HpPQWFe08spbdOnkTQpfaLfD9Oeuyg",
            oauth_signature_method="HMAC-SHA1",
            oauth_timestamp="1462882011",
            oauth_signature="RH5aKKKJaEvK5cIsZZzXtFh7cCk%3D"
    

Body Parameters

NameDescriptionTypeAdditional information
ontology

Ontology name or community identificator to query. It will be used in the form clause

string

Required

community_short_name

Community short name

string

Required

query_select

Select clause of the sparql query

string

Required

query_where

Where clause of the sparql query

string

Required

Request Formats

application/json, text/json

Sample:
{
  "ontology": "application",
  "community_short_name": "developers",
  "query_select": "SELECT ?s ?title",
  "query_where": "WHERE{ ?s <http://purl.org/dc/elements/1.1/title> ?title bif:contains(?title, \"'tutorial'\")}"
}

Response Information

Resource Description

NameDescriptionTypeAdditional information
head

Head of the sparql query

Head

Optional

results

Results of the sparql query

Results

Optional

Response Formats

application/json, text/json

Sample:
{
  "head": {
    "link": [],
    "vars": [
      "s",
      "title"
    ]
  },
  "results": {
    "distinct": false,
    "ordered": true,
    "bindings": [
      {
        "s": {
          "type": "uri",
          "value": "http://gnoss/DE3B6C31-0575-4453-8F1E-4DEA56E72C73"
        },
        "title": {
          "type": "literal",
          "value": "MVC 5 advanced tutorial"
        }
      },
      {
        "s": {
          "type": "uri",
          "value": "http://gnoss/F3E4126A-998C-4FE6-90F2-2965F8FF766A"
        },
        "title": {
          "type": "literal",
          "value": "Entity Framework advanced tutorial"
        }
      }
    ]
  }
}

Response HTTP status code

On success, the response contains 200 code.

On fail, throws a WebException with code:

  • 401 Unauthorized if the OAuth signature is invalid
  • 400 Bad Request if the params are invalid
  • 500 Internal server error if something goes wrong...