For a given organization code, this query will return the URI for the organization, its name and, where available references to its homepage, RSS feed, Facebook page, Flickr and Twitter accounts.

Query: 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX sioc: <http://rdfs.org/sioc/ns#> PREFIX nhs: <http://data.kasabi.com/dataset/nhs-organization/def/> PREFIX org: <http://www.w3.org/ns/org#> SELECT ?org ?name ?homepage ?facebook ?flickr ?twitter ?rss WHERE { ?org rdfs:label ?name; org:identifier "5A4"^^nhs:odsCode. OPTIONAL { ?org foaf:homepage ?homepage. } OPTIONAL { ?org foaf:isPrimaryTopicOf ?facebook. FILTER( regex(str(?facebook), "facebook") ) } OPTIONAL { ?org foaf:holdsAccount ?flickr. ?flickr foaf:accountServiceHomepage <http://flickr.com>. } OPTIONAL { ?org foaf:holdsAccount ?twitter. ?twitter foaf:accountServiceHomepage <http://twitter.com>. } OPTIONAL { ?org sioc:feed ?rss. } }
Login to test this query using our experimental API explorer