Coinmarketcap ontology
The ontology will cover the domain of cryptocurrency market data, specifically focusing on aspects related to:
- Cryptocurrencies and their attributes (e.g., price, market cap, volume, etc.)
- Exchanges and market pairs
- Wallets and their reviews
- Users and their interactions (e.g., reviews)
- Developers and ICOs
- News articles related to cryptocurrencies
- Historical data and trading volumes
The ontology could be used for:
- Information Retrieval: Enabling users to query and retrieve detailed information about cryptocurrencies, exchanges, market pairs, wallets, and related news.
- Data Integration: Integrating data from various sources to provide a comprehensive view of the cryptocurrency market.
- Semantic Search: Enabling users to perform semantic searches related to cryptocurrencies, exchanges, and other related entities.
- Knowledge Discovery: Identifying relationships and patterns within the cryptocurrency market data.
- Decision Support: Assisting investors and traders in making informed decisions by providing structured and semantically enriched data.
Integrating an ontology with CoinMarketCap's API involves fetching data from the API, transforming it into a format that aligns with the ontology, and then populating the ontology with this data. Here are some steps and issues to consider:
-
Properties like
:circulatingSupply
,:totalSupply
, and:maxSupply
represent numerical values related to the supply of a cryptocurrency, hence have a range ofxsd:float
. -
Properties like
:launchDate
,:newsDate
,:icoStartDate
, and:icoEndDate
represent dates and thus have a range ofxsd:date
. -
Textual properties like
:reviewText
and:newsTitle
have a range ofxsd:string
. -
The
:reviewRating
property, which might represent a score or rating, has a range ofxsd:float
. -
15 classes
-
15 object properties
-
20 datatype properties
-
20 individuals
-
Use class constructs
- unionOf
- disjointWith
- intersectionOf
- allValuesFrom
- oneOf
-
Use property constructs
- transitive property
- symmetric property
- inverse property
- disjoint property
-
Assert the domain and rage of AT LEAST 10 properties
The ontology defines the following 27 classes:
:Blockchain
:Cryotpocurrency
- `:Coin
:Token
:Developer
:Exchange
:FinancialEntity
:Bank
:CryptocurrencyExchange
:VerifiedExchange
:HistoricalData
:ICO
:Investor
:Liquidity
:MarketCap
:MarketPair
:NewsArticle
:Person
:PopularCryptocurrency
:Review
:SecureEncryption
:TradingVolume
:User
:VerifiedEntity
:VerifiedExchange
:Wallet
:SecureWallet
The ontology defines the following 23 object properties:
:hasDeveloper
:hasExchange
:hasHistoricalData
:hasLiquidity
:hasMarketCap
:hasRoadmap
:hasToken
:hasTradingVolume
:hasUserReview
:hasWallet
:hasWebProfile
:hasWebsite
:hasWhitepaper
:investedIn
:isLinkedTo
:launchedBy
:launchedICO
:relatedToNews
:tradedInPair
:tradedOnExchange
:usesBlockchain
:usesEncryption
:writtenBy
The ontology defines the following 20 datatype properties:
:allTimeHighPrice
:allTimeLowPrice
:circulatingSupply
:currentPrice
:icoEndDate
:icoRaisedAmount
:icoStartDate
:launchDate
:marketCapValue
:maxSupply
:name
:newsDate
:newsTitle
:priceChange24h
:priceChangePercentage24h
:reviewRating
:reviewText
:symbol
:totalSupply
:volume24h
The ontology defines the following 26 individuals:
- `:AES256Encryption
- `:BasicEncryption
:Binance
:Bitcoin
:BitcoinMarketCap
:Coinbase
:Doge
:DogeMarketCap
:Ethereum
:EthereumMarketCap
:FoxToken
:FoxTokenICO
:FoxTokenMarketCap
:Investor1
:JohnDoe
:Kraken
:Litecoin
:LitecoinMarketCap
:Monero
:MoneroMarketCap
:Stellar
:StellarICO
:StellarMarketCap
:StellarToken
:ZCash
:ZCashMarketCap
The following properties have their domains and ranges defined:
-
Property:
:hasDeveloper
Domain::Cryptocurrency
Range::Developer
-
Property:
:hasExchange
Domain::Cryptocurrency
Range::Exchange
-
Property:
:hasHistoricalData
Domain::Cryptocurrency
Range::HistoricalData
-
Property:
:hasLiquidity
Domain::Cryptocurrency
Range::Liquidity
-
Property:
:hasMarketCap
Domain::Cryptocurrency
Range::MarketCap
-
Property:
:hasToken
Domain::ICO
Range::Token
-
Property:
:hasTradingVolume
Domain::Cryptocurrency
Range::TradingVolume
-
Property:
:hasUserReview
Domain::Cryptocurrency
Range::Review
-
Property:
:hasWallet
Domain::User
Range::Wallet
-
Property:
:investedIn
Domain::Investor
Range::ICO
This is used to specify that two classes have no instances in common.
:Exchange owl:disjointWith :Cryptocurrency .
This is used to define a class that is a union of two or more classes.
:FinancialEntity a owl:Class ;
owl:unionOf ( :Exchange :Cryptocurrency ) .
:FinancialEntity
could be defined as a class that includes individuals that are either of type :Bank
or :CryptocurrencyExchange
.
This is used to define a class that is an intersection of two or more classes.
:VerifiedExchange rdf:type owl:Class ;
owl:intersectionOf (:CryptocurrencyExchange :VerifiedEntity) .
:VerifiedExchange
could represent entities that are both :CryptocurrencyExchange
and :VerifiedEntity
.
This is used to define a class by explicitly listing its instances.
:PopularCryptocurrency rdf:type owl:Class ;
owl:oneOf (:Bitcoin :Ethereum :Litecoin) .
:PopularCryptocurrency
might be defined as a class that includes specific individuals, such as :Bitcoin
, :Ethereum
, and :Litecoin
.
(requires defining a restriction)
:SecureWallet rdf:type owl:Class ;
rdfs:subClassOf [ rdf:type owl:Restriction ;
owl:onProperty :usesEncryption ;
owl:allValuesFrom :SecureEncryption ] .
:SecureWallet
might be a class of wallets, all of which use a type of :SecureEncryption
for the property :usesEncryption
.
- Valid: A wallet is considered a
:SecureWallet
without having the:usesEncryption
property (it does not violate the restriction)
:MyWallet rdf:type :SecureWallet .
- Valid: A wallet is a
:SecureWallet
and uses an encryption method that is a:SecureEncryption
.
:MyWallet rdf:type :SecureWallet ;
:usesEncryption :SomeSecureEncryptionMethod .
:SomeSecureEncryptionMethod rdf:type :SecureEncryption .
- Invalid: A wallet is a
:SecureWallet
but uses an encryption method that is not a:SecureEncryption
:MyWallet rdf:type :SecureWallet ;
:usesEncryption :SomeInsecureEncryptionMethod .
:SomeInsecureEncryptionMethod rdf:type :InsecureEncryption .
:ExchangeA :isPartnerOf :ExchangeB .
:ExchangeB :isPartnerOf :ExchangeC .
- Definition:
:isPartnerOf
is defined as a transitive property. - Implication: If
:ExchangeA
is a partner of:ExchangeB
, and:ExchangeB
is a partner of:ExchangeC
, then it is inferred that:ExchangeA
is a partner of:ExchangeC
.
:CoinA :isCompetitorOf :CoinB .
- Definition:
:isCompetitorOf
is defined as a symmetric property. - Implication: If
:CoinA
is a competitor of:CoinB
, then it is automatically inferred that:CoinB
is a competitor of:CoinA
.
:InvestorA :owns :WalletA .
- Definition:
:owns
and:isOwnedBy
are defined as inverse properties of each other. - Implication: If
:InvestorA
owns:WalletA
, then it is automatically inferred that:WalletA
is owned by:InvestorA
. Conversely, if we state that:WalletA :isOwnedBy :InvestorA
, it is inferred that:InvestorA :owns :WalletA
.
:InvestorB :investsIn :CoinC .
- Definition:
:investsIn
and:divestsIn
are defined as disjoint properties. - Implication: If
:InvestorB
invests in:CoinC
, it cannot be true that:InvestorB
divests in:CoinC
at the same time (and vice versa). The ontology will be inconsistent if both statements are true for the same individuals.
I used Protege reasoner HermiT 1.4.3.x
to check for consistency in the code. This helped to isolate a number of mistakes.
One example are the Object Properties :hasWhitepaper :hasWebsite :hasRoadmap
which were each described as Datatype properties, throwing an error in the console:
ERROR 15:46:36 Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {hasWhitepaper=hasWhitepaper, hasWebsite=hasWebsite, hasRoadmap=hasRoadmap}, axiom: <http://www.example.org/ontology#StellarICO> hasRoadmap <http://www.stellarico.com/roadmap.pdf>, error: class org.semanticweb.owlapi.model.IRI cannot be cast to class
Other errors occurred during development, but I did not capture them.