Skip to content

Instantly share code, notes, and snippets.

@VladimirAlexiev
Last active August 16, 2022 14:14
Show Gist options
  • Save VladimirAlexiev/4ebf7d72dac192a03adf10b6385e7ad4 to your computer and use it in GitHub Desktop.
Save VladimirAlexiev/4ebf7d72dac192a03adf10b6385e7ad4 to your computer and use it in GitHub Desktop.
Representing CrunchBase IPOs in FIBO

Representing CrunchBase IPOs in FIBO

CrunchBase has a table ipos with the following fields (see ipos-sample.csv):

field type descr
uuid string Unique identifier
name string Entity name
permalink string Suffix of url. Sometimes changes
url anyURI Full Crunchbase URL
rank integer Crunchbase rank (smaller is 'more important'). Optional since many Crunchbase entities don't have a rank (but the main ones do)
created at dateTime When the Crunchbase record was created
updated at dateTime When the Crunchbase record was updated
organization Agent Which company was listed
exchange symbol string Exchange code. Uses internal Crunchbase codes that are ambiguous, should better use MIC
stock symbol string Ticker on the exchange
went public on dateTime When the company went public (IPO date)
share price in US dollars decimal The share price for the stock at the time of IPO, in US dollars
share price in local currency decimal The share price for the stock at the time of IPO, in local currency
share price currency code string Local currency of share price
valuation price in US dollars decimal Valuation of the Organization at IPO, in US dollars
valuation price in local currency decimal Valuation of the Organization at IPO, in local currency
valuation price currency code string Local currency of the valuation
money raised in US dollars decimal Total amount raised from the IPO, in US dollars
money raised in local currency decimal Total amount raised from the IPO, in local currency
money raised currency code string Local currency of the total amount raised
  • The first 7 fields are present in pretty much any CB entity
  • The next 13 fields are specific to this entity (IPO)

In a simple semantic representation, I've represented this as one node (see CrunchBase Challenge that shows the complete CB model of 18 entities).

Now I represented IPOs in FIBO by using the 2022Q2 release (see Converting FIBO from RDF to Turtle).

The result is a complex graph:

This is generated from ipos.ttl using rdfpuml and the latest version of PlantUML 1.2022.6

  • This model has 25 nodes (of which 11 are shared with other IPOs, eg the currencies and currency codes)
  • It uses terms from 16 FIBO ontologies (see prefixes.ttl).

Why The Complexity?

  • FIBO distinguishes Issuer (role) from the agent playing that role
  • FIBO distinguishes Offering (the IPO), Share, Listing (of the share at an exchange), Ticker (a ReassignableIdentifier)
  • FIBO represents the financials as explicit nodes (and MarketCap as 2 nodes). There are 6: total Price (money raised), MarketCap (valuation), Price per share; in national currency and USD
  • FIBO represents the stock exchange and its code as two separate nodes
  • Finally, FIBO represents currencies and their codes as two nodes each. There are 4 currencies involved.

Possible Improvements

  • DONE: Asked the FIBO people to validate this representation and reflected changes suggested by Elisa Kendall and Pawel Garbacz (Mereolog).
  • DONE: Added rdfs:label to each node
  • DONE: Changed monetary node patterns in "national currency" vs in USD to be like this:
<cb/ipo/(uuid)/pricePerShare/(share_price_currency_code)>      vs <cb/ipo/(uuid)/pricePerShare/USD>
<cb/ipo/(uuid)/marketCap/(valuation_price_currency_code)>      vs <cb/ipo/(uuid)/marketCap/USD>
<cb/ipo/(uuid)/marketCapValue/(valuation_price_currency_code)> vs <cb/ipo/(uuid)/marketCapValue/USD>
  • Previously they were like this:
<cb/ipo/(uuid)/pricePerShare>                                  vs <cb/ipo/(uuid)/pricePerShareUsd>
<cb/ipo/(uuid)/marketCap>                                      vs <cb/ipo/(uuid)/marketCapUsd>
<cb/ipo/(uuid)/marketCapValue>                                 vs <cb/ipo/(uuid)/marketCapValueUsd>
  • But many IPOs are in the US, so we can save on nodes if we use URLs that incorporate the currency code. The difference is subtle but crucial: it effectively merges the monetary nodes of US IPOs.
uuid name type permalink cb_url rank created_at updated_at org_uuid org_name org_cb_url country_code state_code region city stock_exchange_symbol stock_symbol went_public_on share_price_usd share_price share_price_currency_code valuation_price_usd valuation_price valuation_price_currency_code money_raised_usd money_raised money_raised_currency_code
72d30ebd-53ef-2486-6c29-22785c5173ce ipo microsoft-ipo--72d30ebd https://www.crunchbase.com/ipo/microsoft-ipo--72d30ebd 31712 2008-02-09 05:25:18 2018-02-12 23:11:05 fd80725f-53fc-7009-9878-aeecf1e9ffbb Microsoft https://www.crunchbase.com/organization/microsoft USA WA Washington Redmond nasdaq MSFT 1986-03-13
3ad2b068-2d97-f646-0b80-1e5f3d7adfc4 ipo the-walt-disney-company-ipo--3ad2b068 https://www.crunchbase.com/ipo/the-walt-disney-company-ipo--3ad2b068 44186 2008-02-09 05:40:32 2019-02-25 22:31:49 756936c0-c335-f0ae-0a3d-fe26bdff5695 The Walt Disney Company https://www.crunchbase.com/organization/the-walt-disney-company USA CA California Burbank nyse DIS 1978-01-13 300000000 300000000 USD
a265c6f6-4b96-4079-096a-967a37f3da2b ipo divx-ipo--a265c6f6 https://www.crunchbase.com/ipo/divx-ipo--a265c6f6 14752 2008-02-25 23:52:11 2018-02-12 23:57:54 73296f0d-85a5-78d5-90b3-86c5f8981ba9 DivX https://www.crunchbase.com/organization/divx USA CA California San Diego nasdaq DIVX 2006-10-22 16.0 16.0 USD 160000000 160000000 USD 145000000 145000000 USD
ee426509-826e-5dd0-9309-e79c8f384904 ipo xo-group-ipo--ee426509 https://www.crunchbase.com/ipo/xo-group-ipo--ee426509 19369 2008-02-29 00:31:34 2018-02-12 23:41:42 ff8439cf-097c-a88a-9bb9-dd83d23aa14b XO Group https://www.crunchbase.com/organization/xo-group USA NY New York New York nyse XOXO 1999-12-02 35000000 35000000 USD
# Issuer as role of a CB agent
<cb/agent/(org_uuid)/issuer> a fibo-fbc-fi-fi:Issuer, fibo-fbc-pas-fpas:Offeror;
fibo-fnd-rel-rel:issues <cb/ipo/(uuid)/share>;
fibo-fnd-rel-rel:hasIdentity <cb/agent/(org_uuid)>.
# Offering, Share, Listing, Ticker
<cb/ipo/(uuid)/offering> a fibo-sec-sec-iss:PublicOffering;
rdfs:label "IPO (permalink)";
fibo-fbc-pas-fpas:hasOfferingPrice <cb/ipo/(uuid)/price/(money_raised_currency_code)>, <cb/ipo/(uuid)/price/USD>;
fibo-fnd-rel-rel:appliesTo <cb/ipo/(uuid)/share>;
fibo-fnd-rel-rel:isIssuedBy <cb/agent/(org_uuid)/issuer>;
fibo-sec-sec-iss:hasFirstTradeDate '(went_public_on)'^^xsd:date;
fibo-sec-sec-iss:isRegisteredWith <cb/exchange/(stock_exchange_symbol)>;
cb:uuid '(uuid)';
cb:name '(name)';
cb:permalink '(permalink)';
cb:url '(cb_url)'^^xsd:anyURI;
cb:rank '(rank)'^^xsd:integer;
cb:createdAt 'fixDate(created_at)'^^xsd:dateTime;
cb:updatedAt 'fixDate(updated_at)'^^xsd:dateTime.
<cb/ipo/(uuid)/share> a fibo-sec-sec-lst:ListedSecurity, fibo-sec-eq-eq:Share;
rdfs:label "Share/listed security '(stock_symbol)'";
fibo-sec-sec-lst:isListedVia <cb/ipo/(uuid)/listing>;
fibo-fnd-agr-ctr:hasPrincipalParty <cb/agent/(org_uuid)/issuer>;
fibo-fnd-rel-rel:isIssuedBy <cb/agent/(org_uuid)/issuer>;
fibo-fbc-fi-fi:isDenominatedIn <cb/currency/(share_price_currency_code)>;
fibo-sec-sec-lst:hasOriginalPlaceOfListing <cb/exchange/(stock_exchange_symbol)>; # don't know this but it's mandatory
fibo-sec-sec-lst:hasHomeExchange <cb/exchange/(stock_exchange_symbol)>.
<cb/ipo/(uuid)/listing> a fibo-sec-sec-lst:Listing;
rdfs:label "Listing of share/security '(stock_symbol)' on exchange '(stock_exchange_symbol)'";
fibo-sec-sec-lst:lists <cb/ipo/(uuid)/share>;
lcc-lr:isIdentifiedBy <cb/ipo/(uuid)/ticker>;
fibo-sec-sec-lst:isTradedOn <cb/exchange/(stock_exchange_symbol)>;
fibo-fnd-acc-cur:hasCurrency <cb/currency/(share_price_currency_code)>.
<cb/ipo/(uuid)/ticker> a fibo-sec-sec-id:TickerSymbol, fibo-sec-sec-id:ListedSecurityIdentifier;
rdfs:label "Ticker symbol/security identifier '(stock_exchange_symbol):(stock_symbol)'";
lcc-lr:hasTag '(stock_symbol)';
fibo-fbc-fct-ra:isRegisteredBy <cb/exchange/(stock_exchange_symbol)>;
lcc-lr:identifies <cb/ipo/(uuid)/listing>;
fibo-fnd-arr-id:hasInitialAssignmentDate '(went_public_on)'^^xsd:date.
# Financials
<cb/ipo/(uuid)/price/(money_raised_currency_code)> a fibo-fnd-acc-cur:MonetaryPrice;
rdfs:label "Total price/money raised of IPO (permalink) in local currency";
fibo-fnd-acc-cur:hasAmount '(money_raised)'^^xsd:decimal;
fibo-fnd-acc-cur:hasCurrency <cb/currency/(money_raised_currency_code)>.
<cb/ipo/(uuid)/price/USD> a fibo-fnd-acc-cur:MonetaryPrice;
rdfs:label "Total price/money raised of IPO (permalink) in USD";
fibo-fnd-acc-cur:hasAmount '(money_raised_usd)'^^xsd:decimal;
fibo-fnd-acc-cur:hasCurrency <cb/currency/USD>.
<cb/ipo/(uuid)/marketCap/(valuation_price_currency_code)> a fibo-ind-mkt-bas:MarketCapitalization;
rdfs:label "Market Cap (valuation) at the time of IPO (permalink) in local currency";
fibo-ind-mkt-bas:hasMarketCapitalizationValue <cb/ipo/(uuid)/marketCapValue/(valuation_price_currency_code)>;
fibo-fnd-utl-alx:hasArgument <cb/ipo/(uuid)/pricePerShare/(share_price_currency_code)>;
fibo-fnd-dt-fd:hasObservedDateTime '(went_public_on)'^^xsd:date;
fibo-fnd-rel-rel:appliesTo <cb/agent/(org_uuid)/issuer>.
<cb/ipo/(uuid)/marketCap/USD> a fibo-ind-mkt-bas:MarketCapitalization;
rdfs:label "Market Cap (valuation) at the time of IPO (permalink) in USD";
fibo-ind-mkt-bas:hasMarketCapitalizationValue <cb/ipo/(uuid)/marketCapValue/USD>;
fibo-fnd-utl-alx:hasArgument <cb/ipo/(uuid)/pricePerShare/USD>;
fibo-fnd-dt-fd:hasObservedDateTime '(went_public_on)'^^xsd:date;
fibo-fnd-rel-rel:appliesTo <cb/agent/(org_uuid)/issuer>.
<cb/ipo/(uuid)/marketCapValue/(valuation_price_currency_code)> a fibo-fnd-acc-cur:MonetaryAmount;
rdfs:label "Monetary amount of Market Cap (valuation) in local currency";
fibo-fnd-acc-cur:hasAmount '(valuation_price)'^^xsd:decimal;
fibo-fnd-acc-cur:hasCurrency <cb/currency/(valuation_price_currency_code)>.
<cb/ipo/(uuid)/marketCapValue/USD> a fibo-fnd-acc-cur:MonetaryAmount;
rdfs:label "Monetary amount of Market Cap (valuation) in USD";
fibo-fnd-acc-cur:hasAmount '(valuation_price_usd)'^^xsd:decimal;
fibo-fnd-acc-cur:hasCurrency <cb/currency/USD>.
<cb/ipo/(uuid)/pricePerShare/(share_price_currency_code)> a fibo-sec-eq-eq:PricePerShare;
rdfs:label "Price per share at the time of IPO (permalink) in local currency";
fibo-fnd-acc-cur:hasAmount '(share_price)'^^xsd:decimal;
fibo-fnd-acc-cur:hasCurrency <cb/currency/(share_price_currency_code)>;
fibo-fnd-dt-fd:hasObservedDateTime '(went_public_on)'^^xsd:date;
fibo-fnd-acc-cur:isPriceFor <cb/ipo/(uuid)/share>.
<cb/ipo/(uuid)/pricePerShare/USD> a fibo-sec-eq-eq:PricePerShare;
rdfs:label "Price per share at the time of IPO (permalink) in USD";
fibo-fnd-acc-cur:hasAmount '(share_price_usd)'^^xsd:decimal;
fibo-fnd-acc-cur:hasCurrency <cb/currency/USD>;
fibo-fnd-dt-fd:hasObservedDateTime '(went_public_on)'^^xsd:date;
fibo-fnd-acc-cur:isPriceFor <cb/ipo/(uuid)/share>.
# Stock exchange
<cb/exchange/(stock_exchange_symbol)> a fibo-fbc-fct-mkt:Exchange, fibo-fbc-fct-ra:RegistrationAuthority;
rdfs:label "Exchange '(stock_exchange_symbol)'";
rdfs:comment "Unfortunately CB exchange codes are ambiguous, eg 'mse' could be Metropolitan, Madrid, Mongolian, Malta";
fibo-fbc-fct-mkt:hasExchangeAcronym '(stock_exchange_symbol)';
lcc-lr:isIdentifiedBy <cb/exchange/(stock_exchange_symbol)/code>.
<cb/exchange/(stock_exchange_symbol)/code> a lcc-lr:Identifier;
rdfs:label "Identifier of exchange '(stock_exchange_symbol)'";
lcc-lr:hasTag '(stock_exchange_symbol)';
lcc-lr:identifies <cb/exchange/(stock_exchange_symbol)>;
lcc-lr:isMemberOf <cb/exchange/code>.
<cb/exchange/code> a lcc-lr:CodeSet;
rdfs:label 'CrunchBase exchange code scheme';
rdfs:comment 'Unfortunately CB Exchange codes are ambiguous, unlike ISO 10383 MIC'.
# Currencies: USD plus 3 more for the 3 financials
<cb/currency/USD> a fibo-fnd-acc-cur:Currency;
lcc-lr:hasName 'USD';
rdfs:label 'Currency USD'.
<cb/currency/USD/code> a fibo-fnd-acc-cur:CurrencyIdentifier;
rdfs:label 'Code of currency USD';
lcc-lr:hasTag 'USD';
lcc-lr:denotes <cb/currency/USD>;
lcc-lr:identifies <cb/currency/USD>;
lcc-lr:isMemberOf <cb/currency>.
<cb/currency/(share_price_currency_code)> a fibo-fnd-acc-cur:Currency;
lcc-lr:hasName '(share_price_currency_code)';
rdfs:label 'Currency (share_price_currency_code)'.
<cb/currency/(share_price_currency_code)/code> a fibo-fnd-acc-cur:CurrencyIdentifier;
rdfs:label 'Code of currency (share_price_currency_code)';
lcc-lr:hasTag '(share_price_currency_code)';
lcc-lr:denotes <cb/currency/(share_price_currency_code)>;
lcc-lr:identifies <cb/currency/(share_price_currency_code)>;
lcc-lr:isMemberOf <cb/currency>.
<cb/currency/(valuation_price_currency_code)> a fibo-fnd-acc-cur:Currency;
lcc-lr:hasName '(valuation_price_currency_code)';
rdfs:label 'Currency (valuation_price_currency_code)'.
<cb/currency/(valuation_price_currency_code)/code> a fibo-fnd-acc-cur:CurrencyIdentifier;
rdfs:label 'Code of currency (valuation_price_currency_code)';
lcc-lr:hasTag '(valuation_price_currency_code)';
lcc-lr:denotes <cb/currency/(valuation_price_currency_code)>;
lcc-lr:identifies <cb/currency/(valuation_price_currency_code)>;
lcc-lr:isMemberOf <cb/currency>.
<cb/currency/(money_raised_currency_code)> a fibo-fnd-acc-cur:Currency;
lcc-lr:hasName '(money_raised_currency_code)';
rdfs:label 'Currency (money_raised_currency_code)'.
<cb/currency/(money_raised_currency_code)/code> a fibo-fnd-acc-cur:CurrencyIdentifier;
rdfs:label 'Code of currency (money_raised_currency_code)';
lcc-lr:hasTag '(money_raised_currency_code)';
lcc-lr:denotes <cb/currency/(money_raised_currency_code)>;
lcc-lr:identifies <cb/currency/(money_raised_currency_code)>;
lcc-lr:isMemberOf <cb/currency>.
<cb/currency> a lcc-lr:IdentificationScheme, lcc-lr:CodeSet;
rdfs:label 'CrunchBase currency code set';
skos:definition 'Currency identifiers used in CrunchBase';
skos:scopeNote 'Better reconcile to fibo-fnd-acc-4217:ISO4217-CodeSet'.
# But we need to match 'USD' to https://spec.edmcouncil.org/fibo/ontology/FND/Accounting/ISO4217-CurrencyCodes/USDollar with a query, can't do it in the transformation
############ PlantUML instructions
lcc-lr:identifies puml:arrow puml:up.
fibo-fnd-rel-rel:hasIdentity puml:arrow puml:up.
fibo-fnd-utl-alx:hasArgument puml:arrow puml:up.
fibo-fnd-acc-cur:isPriceFor puml:arrow puml:up.
fibo-fnd-rel-rel:isIssuedBy puml:arrow puml:up.
fibo-fnd-rel-rel:appliesTo puml:arrow puml:up.
fibo-fbc-fi-fi:isDenominatedIn puml:arrow puml:down-4.
fibo-fbc-fct-mkt:Exchange puml:stereotype "(X,lightblue)". # also fibo-fbc-fct-ra:RegistrationAuthority
fibo-fbc-fi-fi:Issuer puml:stereotype "(I,lightblue)". # also fibo-fbc-pas-fpas:Offeror
fibo-fnd-acc-cur:Currency puml:stereotype "(C,green)".
fibo-fnd-acc-cur:CurrencyIdentifier puml:stereotype "(I,green)".
fibo-fnd-acc-cur:MonetaryAmount puml:stereotype "(A,red)".
fibo-fnd-acc-cur:MonetaryPrice puml:stereotype "(P,red)".
fibo-ind-mkt-bas:MarketCapitalization puml:stereotype "(C,red)".
fibo-sec-eq-eq:PricePerShare puml:stereotype "(P,red)".
fibo-sec-sec-id:TickerSymbol puml:stereotype "(T,lightgreen)".
fibo-sec-sec-iss:PublicOffering puml:stereotype "(O,yellow)".
fibo-sec-sec-lst:ListedSecurity puml:stereotype "(S,yellow)". # also fibo-sec-eq-eq:Share
fibo-sec-sec-lst:Listing puml:stereotype "(L,yellow)".
lcc-lr:CodeSet puml:stereotype "(C,lightgreen)".
lcc-lr:IdentificationScheme puml:stereotype "(S,lightgreen)". # also lcc-lr:CodeSet
lcc-lr:Identifier puml:stereotype "(I,lightgreen)".
@base <https://ontotext.com/crunchbase/resource/> .
@prefix CB: <https://ontotext.com/crunchbase/resource/> .
@prefix cb: <https://ontotext.com/crunchbase/ontology/> .
@prefix fibo-fbc-fct-mkt: <https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/Markets/> .
@prefix fibo-fbc-fct-ra: <https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/RegistrationAuthorities/> .
@prefix fibo-fbc-fi-fi: <https://spec.edmcouncil.org/fibo/ontology/FBC/FinancialInstruments/FinancialInstruments/> .
@prefix fibo-fbc-pas-fpas: <https://spec.edmcouncil.org/fibo/ontology/FBC/ProductsAndServices/FinancialProductsAndServices/> .
@prefix fibo-fnd-acc-cur: <https://spec.edmcouncil.org/fibo/ontology/FND/Accounting/CurrencyAmount/> .
@prefix fibo-fnd-agr-ctr: <https://spec.edmcouncil.org/fibo/ontology/FND/Agreements/Contracts/> .
@prefix fibo-fnd-arr-id: <https://spec.edmcouncil.org/fibo/ontology/FND/Arrangements/IdentifiersAndIndices/> .
@prefix fibo-fnd-dt-fd: <https://spec.edmcouncil.org/fibo/ontology/FND/DatesAndTimes/FinancialDates/> .
@prefix fibo-fnd-rel-rel: <https://spec.edmcouncil.org/fibo/ontology/FND/Relations/Relations/> .
@prefix fibo-fnd-utl-alx: <https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/Analytics/> .
@prefix fibo-ind-mkt-bas: <https://spec.edmcouncil.org/fibo/ontology/IND/MarketIndices/BasketIndices/> .
@prefix fibo-sec-eq-eq: <https://spec.edmcouncil.org/fibo/ontology/SEC/Equities/EquityInstruments/> .
@prefix fibo-sec-sec-id: <https://spec.edmcouncil.org/fibo/ontology/SEC/Securities/SecuritiesIdentification/> .
@prefix fibo-sec-sec-iss: <https://spec.edmcouncil.org/fibo/ontology/SEC/Securities/SecuritiesIssuance/> .
@prefix fibo-sec-sec-lst: <https://spec.edmcouncil.org/fibo/ontology/SEC/Securities/SecuritiesListings/> .
@prefix lcc-lr: <https://www.omg.org/spec/LCC/Languages/LanguageRepresentation/> .
@prefix puml: <http://plantuml.com/ontology#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment