Created
February 6, 2023 11:58
-
-
Save cosmin-marginean/af18f8c985fa0698ba8a62aa46858e8d to your computer and use it in GitHub Desktop.
BODS RDF - Ultimate parents ownership chain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX bods: <http://bods.openownership.org/vocabulary/> | |
PREFIX bods-res: <http://bods.openownership.org/resource/> | |
SELECT ?parentName ?childName | |
WHERE { | |
?ultimateParent bods:ownsOrControls* ?parent . | |
?ultimateParent rdf:type bods:Entity . | |
?parent foaf:name ?parentName . | |
?parent bods:ownsOrControls ?child . | |
?child foaf:name ?childName . | |
?child bods:ownsOrControls* bods-res:openownership-register-12337862642105981237. | |
FILTER NOT EXISTS { | |
?s bods:ownsOrControls ?ultimateParent . | |
?s rdf:type bods:Entity . | |
} | |
} | |
GROUP BY ?parentName ?childName # To avoid duplicate entries |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment