Skip to content

Instantly share code, notes, and snippets.

@cosmin-marginean
Created February 10, 2023 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosmin-marginean/cfad1aaa3af85851f7338ce0469e16cc to your computer and use it in GitHub Desktop.
Save cosmin-marginean/cfad1aaa3af85851f7338ce0469e16cc to your computer and use it in GitHub Desktop.
BODS RDF - All the entities connected to a target: entities with control over the target or which the target controls (directly or indirectly)
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bods: <http://bods.openownership.org/vocabulary/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX bods-res: <http://bods.openownership.org/resource/>
SELECT ?companyName ?relationship
WHERE {
?company rdf:type bods:Entity .
?company foaf:name ?companyName .
{
?company bods:ownsOrControls+ bods-res:openownership-register-227513236687367494 .
BIND("Controls target" AS ?relationship)
}
UNION
{
bods-res:openownership-register-227513236687367494 bods:ownsOrControls+ ?company .
BIND("Is controlled by target" AS ?relationship)
}
}
ORDER BY ?companyName
companyName relationship
EDEN PLANT ROAD LIMITED Is controlled by target
EMENSE INVESTMENTS LIMITED Controls target
WELLPOND INVESTMENT HOLDINGS LTD Controls target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment