sub:assertion {
sub:get-urban-organism-associations dct:description "This query returns all organism associations to the environment of \"city\"." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get urban organism associations" ;
<
https://w3id.org/kpxl/grlc/endpoint> <
https://w3id.org/np/l/nanopub-query-1.1/repo/type/c00cb1067aea80b382c09acc506ffa422a016b2ec3354bd6fc77335a44b1b4b5> ;
<
https://w3id.org/kpxl/grlc/sparql> """prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix biolink: <https://w3id.org/biolink/vocab/>
prefix biodiv: <https://w3id.org/kpxl/biodiv/terms/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
select ?relation ?relation_label ?taxon_name ?taxon_name_label ?creator ?date ?np (\"^\" as ?np_label) where {
graph npa:graph {
?np npx:hasNanopubType biodiv:OrganismToEnvironmentAssociation .
?np npa:hasValidSignatureForPublicKey ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
?np dct:created ?date .
?np dct:creator ?creator .
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?i .
optional { ?np rdfs:label ?label }
}
graph ?a {
?association a biodiv:OrganismToEnvironmentAssociation .
?association biolink:subject ?organism .
?organism a ?taxonConcept .
?taxonConcept biodiv:hasTaxonName ?taxon_name .
?association biolink:predicate ?relation .
?association biolink:object <http://purl.obolibrary.org/obo/ENVO_00000856> .
}
optional { graph ?i { ?taxon_name nt:hasLabelFromApi ?taxon_name_label . } }
optional { graph ?i { ?relation nt:hasLabelFromApi ?relation_label . } }
optional { graph ?i { values (?relation ?relation_label) { ( <http://purl.obolibrary.org/obo/RO_0002303> \"has habitat\" ) } } }
}
order by desc(?date)""" .
}