Home » Developers »  Developer Tools - SPARQL Endpoint

Developer Tools - SPARQL Endpoint


*Tutorials for the developer tools can be found here*


What is RDF?

RDF stands for Resource Description Framework. It is a standard for including metadata and other knowledge on the semantic web. More information can be found here .

The SPARQL endpoint for NIF RDF data is hosted at http://rdf.neuinfo.org/sparql. It contains NIFSTD ontology data referenced as http://ontology.neuinfo.org as the default graph URI.  We also include RDF representations of certain NIF data sources, e.g., connectivity data. More information on the SPARQL endpoint can be found at https://confluence.crbs.ucsd.edu/display/NIF/Sparql+endpoint

 

SPARQL endpoint

The SPARQL endpoint is hosted at http://rdf.neuinfo.org/sparql. It contains NIFSTD ontology data referenced as http://ontology.neuinfo.org as the default graph URI.  We also include RDF representations of certain NIF data sources, e.g., connectivity data.

We demonstrate a simple query that retrieves all the cerebellum GABA-ergic neurons.

prefix nifstd:
prefix nm:
prefix be:
prefix nb:
prefix w3:
prefix rdfs:
prefix xsd:

select ?e,?l where {
?e rdfs:label ?l.
?e rdfs:subClassOf ?hn.
?hn rdfs:label "Cerebellum neuron"^^xsd:string.
?e rdfs:subClassOf ?o.
?o w3:onProperty nb:has_neurotransmitter.
?o w3:someValuesFrom ?gaba.
?gaba rdfs:label "GABA"^^xsd:string }


To execute the above query, place it in the dialog box "Query text" and press "Run Query". As mentioned before the "Default Graph URI" is http://ontology.neuinfo.org. By default the result is displayed in HTML table format as follows:

<
e l
http://ontology.neuinfo.org/NIF/BiomaterialEntities/NIF-Cell.owl#sao471801888 Cerebellum Purkinje cell
http://ontology.neuinfo.org/NIF/BiomaterialEntities/NIF-Cell.owl#sao1415726815 Cerebellum Golgi Cell
http://ontology.neuinfo.org/NIF/BiomaterialEntities/NIF-Cell.owl#sao666951243  Cerebellum basket cell
http://ontology.neuinfo.org/NIF/BiomaterialEntities/NIF-Cell.owl#nifext_130  Cerebellum stellate cell

Here column "e" shows the NIFSTD name of the entity that match the query and column "l" holds their label. Its also possible to export the result in other formats such as CSV, JSON, NTriples, RDF/XML by choosing appropriate item from the "Display Result As" drop down menu.


Transitive Query

We demonstrate a simple query that retrieves all neurons using Virtuoso's TRANSITIVE feature (a non-standard SPARQL extension). It returns all descendants (via subClassOf) of sao1417703748.

prefix rdfs:
prefix sao:
SELECT ?y, ?yl
WHERE {
{{
select *
where
{
?y rdfs:subClassOf ?n
}
}
OPTION (TRANSITIVE, t_distinct, t_in(?n), t_out(?y) )
FILTER (?n = sao:sao1417703748) . ?y rdfs:label ?yl
}
}


To execute the above query, place it in the dialog box "Query text" and press "Run Query". As mentioned before the "Default Graph URI" is http://ontology.neuinfo.org.

We demonstrate a simple query that retrieves all brain regions using Virtuoso's TRANSITIVE feature (a non-standard SPARQL extension). It returns all descendants (via subClassOf) of sao1417703748.

prefix rdfs:
prefix br:
SELECT DISTINCT ?y, ?yl
WHERE {
{{
select *
where
{
?y rdfs:subClassOf ?n
}
}
OPTION (TRANSITIVE, t_distinct, t_in(?n), t_out(?y) )
FILTER (?n = br:birnlex_1167) . ?y rdfs:label ?yl
}
}

To execute the above query, place it in the dialog box "Query text" and press "Run Query". As mentioned before the "Default Graph URI" is http://ontology.neuinfo.org.

Connectivity Query

PREFIX nif_cnxn:
select DISTINCT $Globus_pallidus_strength $Globus_pallidus_receiving $Globus_pallidus_reference
{
$Globus_pallidus nif_cnxn:sending_structure "Globus pallidus" .
$Globus_pallidus nif_cnxn:projection_strength $Globus_pallidus_strength .
$Globus_pallidus nif_cnxn:receiving_structure $Globus_pallidus_receiving .
$Globus_pallidus nif_cnxn:reference $Globus_pallidus_reference
}

 

NIF Statistics



NIF Version: 5.0

Ontology Version: 2.5

Level 2.5/3.0 Resources: 889

Registry Entries: 6,339

Total Records: 356,197,652





NIF Navigator