Skip to content

Instantly share code, notes, and snippets.

View cosmin-marginean's full-sized avatar

Cosmin Marginean cosmin-marginean

View GitHub Profile
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?companyName ?accountsDueDate
WHERE {
bodsr:openownership-register-11417256786033716182 bods:ownsOrControls+ ?company .
?company cht:AccountsNextDueDate ?accountsDueDate .
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?companyName ?commonSicCode (GROUP_CONCAT(DISTINCT ?sicText;SEPARATOR="; ") AS ?sicInfo)
WHERE {
?parent bods:ownsOrControls+ ?company .
?parent bods:ownsOrControls+ bodsr:openownership-register-13475426836689652051 .
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?companyName (GROUP_CONCAT(?sicText) AS ?sicInfo)
WHERE {
?parent bods:ownsOrControls+ ?company .
?parent bods:ownsOrControls+ bodsr:openownership-register-14662912447190623115 .
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?sic (GROUP_CONCAT(?companyName;SEPARATOR="; ") as ?companies)
WHERE {
bodsr:openownership-register-14662912447190623115 bods:ownsOrControls+ ?company .
?company cht:SicText ?sic .
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?companyName (GROUP_CONCAT(?sic;SEPARATOR=",") as ?sicData)
WHERE {
bodsr:openownership-register-14662912447190623115 bods:ownsOrControls+ ?company .
?company foaf:name ?companyName .
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?companyName ?accountsDueDate
WHERE {
bodsr:openownership-register-14662912447190623115 bods:ownsOrControls+ ?company .
?company foaf:name ?companyName .
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?companyName ?mortgages
WHERE {
?parent bods:ownsOrControls+ ?company .
?parent bods:ownsOrControls+ bodsr:openownership-register-8251351163712700915 .
@cosmin-marginean
cosmin-marginean / query.sparql
Last active February 19, 2023 20:14
BODS RDF - Outstanding mortgages for a UBO's companies
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 bodsr: <http://bods.openownership.org/resource/>
PREFIX cht: <http://www.companieshouse.gov.uk/terms/>
SELECT DISTINCT ?companyName ?mortgages ?directControl ?directControlShares
WHERE {
bodsr:openownership-register-10981547892767219580 bods:ownsOrControls+ ?company .
?company foaf:name ?companyName .
@cosmin-marginean
cosmin-marginean / query.sparql
Created February 17, 2023 13:39
BODS RDF - Common ownership or control
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 ?name ?type
WHERE {
?entity bods:ownsOrControls+ bods-res:openownership-register-227513236687367494 .
?entity bods:ownsOrControls+ bods-res:openownership-register-11346547788507289239 .
?entity foaf:name ?name .
@cosmin-marginean
cosmin-marginean / query.sparql
Created February 17, 2023 13:33
BODS RDF - All the companies that an individual controls directly
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 ?companyName ?interestType ?minShares
WHERE {
?ctrlStatement bods:hasInterestedParty bods-res:openownership-register-13699371219421575920 .
?ctrlStatement bods:hasSubject ?company .
?ctrlStatement bods:statesInterest ?interest .