Submit Feedback/Bug Report

myExperiment Logo How To SPARQL

            Back to Contents Page

1. Using the SPARQL Endpoint

1.1. Useful Prefixes

The myExperiment SPARQL endpoint has a number of features to assist in its use. As explained in the PREFIX page, both the PREFIX and BASE clauses facilitate writing more succinct and easier to follow queries. If you need to include any prefixes in your query just use the PREFIX as defined in Useful Prefixes (e.g. rdfs, mebase etc.) and the PREFIX line will be prepended to the query before it is executed.

1.2. Formatting

myExperiment's triplestore to which the SPARQL endpoint queries is updated with the previous day's data between 08:10 and 08:30 each morning UK time. The endpoint provides information about the time the latest snapshot was taken and the number of triples, so you can be sure how current the data is.

SPARQL results can be rendered in a number of formats:

An example of a use for the CSV Matrix format is for friendships:

PREFIX mebase: <>
PREFIX rdf: <>
SELECT ?requester ?accepter
  ?friendship rdf:type mebase:Friendship ;
    mebase:accepted-at ?accepted_time ;
    mebase:has-requester ?requester ;
    mebase:has-accepter ?accepter .
[Hide Example Results]
Friendship CVS Matrix Results

1.3. Soft Limit

The Soft Limit option determines the amount of resources dedicated to returning all the matching results. In general 1% is sufficient. However, if all the results are not returned then a warning message will be displayed and you can try re-running the query with a greater Soft Limit percentage.

1.4. Reasoning

The Enable RDFS Reasoning option allows you to make use of 4Store Reasoner, an RDFS reasoner addition to 4Store. This will perform query-time RDFS reasoning on RDFS subClassOf, subPropertyOf, domain and range properties. The following query will return more results if RDFS reasoning is enabled because all the super classes of Workflow:

PREFIX rdf: <>
  <> rdf:type ?type 
[Run (Without Reasoning)] [Run (With Reasoning)]
[Hide Example Results]

Without Reasoning


With Reasoning


1.5. Automated Querying

If you wish to write automated queries rather than using the endpoint form you can insert the query (in URL encoded format) into the URL as the query parameter in the HTTP GET header. If you have built a query using the endpoint form and want to use it as an automated service in something such as a workflow, instead of clicking "Submit Query", click on "Generate Service from Query". This will take you to a page with a link something like the one below, that you can copy and paste into your workflow or HTTP request capable application.

As you will notice is you click on the link above this will return results is raw SPARQL results XML format. If you wish to get the results in a different format you can also set the formatting parameter in the GET header: Table

The options for the formatting parameter are:

The Soft Limit can also be set as an integer between 1 (default) and 100 by using the GET header parameter softlimit: Table&softlimit=5

Finally reasoning can be enabled by setting the reasoning parameter to 1, yes, or true in the GET header: Table&reasoning=1

            Back to Contents Page