Skip to content

Instantly share code, notes, and snippets.

@slarson
Created March 16, 2013 17:34
Show Gist options
  • Save slarson/5177419 to your computer and use it in GitHub Desktop.
Save slarson/5177419 to your computer and use it in GitHub Desktop.
SPARQL query for HeatMap
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX property:<http://neurolex.org/wiki/Special:URIResolver/Property-3A>
##########################################################################
## Get me all neurons and print out "true" if a property a neuron should have
## is filled in. Print out "false" if that property is not filled in.
###########################################################################
select DISTINCT (str(?name) as ?names) (bound(?def) as ?defs)
(bound(?syn) as ?syns)
(bound(?role) as ?roles) (bound(?abbrev) as ?abbrevs)
(bound(?cat) as ?cats) (bound(?dc) as ?dcs)
(bound(?id) as ?ids) (bound(?pmid) as ?pmids) (bound(?org) as ?orgs)
(bound(?cssh) as ?csshs) (bound(?cssi) as ?csshi) (bound(?loc) as ?locs)
(bound(?dl) as ?dls) (bound(?sdod) as ?sdods) (bound(?bt) as ?bts)
(bound(?am) as ?ams) (bound(?apl) as ?apls) (bound(?lodaa) as ?lodaas)
(bound(?lolaa) as ?lolaas)
(bound(?oa) as ?oas) (bound(?nt) as ?nts) (bound(?ntr) as ?ntrs)
(bound(?mc) as ?mcs) (bound(?fp) as ?fps) (bound(?sfr) as ?sfrs)
(bound(?sfp) as ?sfps)
where {
?x property:Id "sao1417703748"^^xsd:string . #x is a node w/ id matching our class
?y rdfs:subClassOf* ?x . #y are all transitive subclasses of x
?y property:Label ?name . #put all the names of all y in name
OPTIONAL {
?y property:Definition ?def}.
OPTIONAL {
?y property:Synonym ?syn } .
OPTIONAL {
?y property:Has_role ?role } .
OPTIONAL {
?y property:Abbrev ?abbrev } .
OPTIONAL {
?y rdfs:subClassOf ?cat } .
OPTIONAL {
?y property:DefiningCitation ?dc } .
OPTIONAL {
?y property:Id ?id } .
OPTIONAL {
?y property:PMID ?pmid } .
OPTIONAL {
?y property:Species ?org } .
OPTIONAL {
?y property:CellSomaShape ?cssh } .
OPTIONAL {
?y property:CellSomaSize ?cssi } .
OPTIONAL {
?y property:Located_in ?loc} .
OPTIONAL {
?y property:DendriteLocation ?dl } .
OPTIONAL {
?y property:SpineDensityOnDendrites ?sdod } .
OPTIONAL {
?y property:BranchingMetrics ?bt } .
OPTIONAL {
?y property:AxonMyelination ?am } .
OPTIONAL {
?y property:AxonProjectionLaterality ?apl } .
OPTIONAL {
?y property:LocationOfAxonArborization ?lodaa } .
OPTIONAL {
?y property:LocationOfLocalAxonArborization ?lolaa } .
OPTIONAL {
?y property:OriginOfAxon ?oa } .
OPTIONAL {
?y property:Neurotransmitter ?nt } .
OPTIONAL {
?y property:NeurotransmitterReceptors ?ntr } .
OPTIONAL {
?y property:MolecularConstituents ?mc } .
OPTIONAL {
?y property:FiringPatterns ?fp } .
OPTIONAL {
?y property:SpontaneousFiringRate ?sfr } .
OPTIONAL {
?y property:SpontaneousFiringPatterns ?sfp } .
} ORDER BY ?name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment