Created
February 6, 2023 11:56
-
-
Save cosmin-marginean/db21b51e88841c5848580584d286dbcc to your computer and use it in GitHub Desktop.
BODS RDF - Identifying ultimate parents for a target
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 ?ultimateParent ?ultimateParentName | |
WHERE { | |
?ultimateParent bods:ownsOrControls+ bods-res:openownership-register-12337862642105981237 . | |
?ultimateParent foaf:name ?ultimateParentName . | |
?ultimateParent rdf:type bods:Entity . | |
# An ultimate parent is an entity that isn't controlled by another entity | |
FILTER NOT EXISTS { | |
?s bods:ownsOrControls ?ultimateParent . | |
?s rdf:type bods:Entity . | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment