Bike Ontology
BikeOntology
The Idea

BikeOntology is an ontology exploring the world of bicycles.
It was born by the work of three bike lovers living in the city of Bologna. The purpose was to create a useful tool describing the characteristics of bikes in general, deepening the mechanical structure mutual to every model.
Then, the project evolved through the implementation of some problems that could affect a bike and how they can be fixed by changing or adjusting some pieces. Surfing the web there were some interesting ontologies on vehicles in general, but nothing bike specific.
Automotive ontology, Schema, and The Vehicles Sales Ontology were very useful sources for taking inspiration and reusing some existing data.
Due to the absence of an existing ontology on this matter and thinking about the usefulness of a new environment built from scratch, the project began.

Development
The Workflow

First steps
The first step consisted of the elaboration of some Competency Questions in natural language, trying to cover the most popular aspects to analyze when dealing with a bike in general.CQs represent a starting and an ending point: they are the questions to ask for shaping the first draft of the ontology and the questions the ontology should be able to answer at the end through SPARQL.
Initial CQs:
-
#1
What are the most common problems of a city bike?
-
#2
How do I fix a flat tire?
-
#3
Which are the main elements of a mountain bike?
-
#4
Which elements are common to all types of bikes?
-
#5
What are the different types of bikes?
-
#6
Which tools do I need to fix a chain that slips?
-
#7
Which types of bikes have an electric motor?
-
#8
What is the heaviest type of bike?
-
#9
How many types of wheels exist?
-
#10
Which size of wheel does a citybike need?
Documentation
The development started with the creation of a Conceptual Map, focusing on the generic structure of the bike, trying to abstract all the most frequent types of bikes and all the pieces mutually present in every bicycle.
From a non-specific sketch of the idea, we rendered and then populated the map with finer details, it has been regularly modified, extended, and readapted during a step-by-step process.
E/R Model

First sketch of the Theoretical model

Final Theoretical model


Editing with Protégé
Once the map was completed, it was possible to edit with WebProtégé co-working on the population of classes, data and object properties, obtaining in this way the T-Box, the terminology component serving the future knowledge base.
Our work, therefore, initially followed a Top-down approach: from a definition of all the terminology to the overlapping with an already existing database. The selected sample of bikes provides us a big list of items, necessary for the A-Box implementation, which means the assertions using the vocabulary defined by the T-Box and populating the ontology.
The sample proved to be fully described in many characteristics, such as brand, weight, type of bike, year of production, measures of the tires, measures of the shifters, and so on. The database comes from a bike shop online and is available at the following link.
Coming across these data we realized our T-box could be improved and enriched with some details missed before, in order to be compliant with the sample, such as the three data properties classes of
hasChainRing, hasGearing , hasSize, the classes Motor and Battery and we moved the individual describing the concept “type of bike” into the class TypeOfBike, in order to be able to directly extract this information from the database.
In summary, Bike Ontology is the result of a balanced mix of the Bottom-Up and the Top-Down approaches: its general structure allows the ontology to dialogue with different databases, but its level of details unveils the practical nature of the ontology. The T-Box is downloadable as an owl file.
Redrafting the Competency Questions
As a result of this process, we returned to our first competency questions and adapted them to fit our ontology. For example, the sample only contains two different types of bikes and some questions didn’t make sense with the data available to us. On the other side, we included some questions relevant to the dataset that could arise for bike specialists out there.
-
#1
What is the most common brand for bike cranks?
-
#2
How many bikes are there for each type in the dataset?
-
#3
What are the different size of tires?
-
#4
Which is the heaviest bike?
-
#5
Which motor is the most used for electric bikes?
-
#6
How many bikes are there for each gearing?
-
#7
Which brand produced more bikes in 2021?
-
#8
How many pieces produced by Shimano are there in a Cannondale bike model Synapse Carbon 4 2022?
-
#9
Which is the average weight of the bikes for each brand?
-
#10
Which bikes use the biggest chain ring ?
Populating the A-Box
Once we downloaded the free sample from the 99spokes website, we used a python script available at this Link to extract information and populate our ontology.
Each row of the dataset instantiates a bike and the columns describe the bike parts, as well as the brands producing these parts, or some other characteristics of the bike such as its weight. We used the Python library Pandas to process the dataset and the Library rdflib to create the knowledge graph. Then from each row of the dataset, we extracted the instance of the bike by attributing URIs and modeling the data according to the ontology for each part of the bike. The result is a Turtle file (abox_bikeo.ttl), which we joined with the T-Box on Protégé to produce the final graph final_bikeo.owl.
The Ontology
Publication
After the ontology population, each element within Protégé was commented to obtain a finished and fully described documentation through WIDOCO, enabling both text and visual representation of the ontology in a W3C fashion. The documentation page published online is available at this link.
The ontology was then ready and downloadable as an owl file.
SPARQL queries
The best source to query the database about the preliminary Competency Questions, translated into SPARQL language, proved to be the Apache Jena Fuseki tool: an already developed endpoint and SPARQL server.
It provides REST-style SPARQL HTTP Update, SPARQL Query, and SPARQL Update using the SPARQL protocol over HTTP.
This environment loads the owl file or, otherwise, the ontology file through the reference link and enables one to work on the triples, making queries and verifying the correctness of the answer.
In the case of BikeOntology 15687 triples were available.
Results and testing
We worked on the 9 Competency Questions re-drafted during the work and the result can be seen here below.
What is the most common brand for bike cranks?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT ?brandlabel (COUNT (DISTINCT ?crank) AS ?count)
WHERE {?brand bikeo:produces ?crank.
?crank a bikeo:Crank.
?brand rdfs:label ?brandlabel}
GROUP BY ?brand ?brandlabel
ORDER BY DESC(?count)
LIMIT 1
Result
brandlabel | count | |
---|---|---|
1 | Shimano |
How many bikes are there for each type in the dataset?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT ?type (COUNT (DISTINCT ?bike) AS ?count)
WHERE { ?bike a bikeo:Bike.
?type a bikeo:TypeOfBike;
bikeo:isTypeOf ?bike.}
GROUP BY ?type
ORDER BY DESC(?count)
Result
What are the different size of tires?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT DISTINCT ?size
WHERE { ?tire a bikeo:Tire.
?tire bikeo:hasSize ?size.}
Result
size | |
---|---|
1 | 40c |
2 | 47c |
3 | 45c |
4 | 37c |
5 | 50c |
6 | 30c |
7 | 28c |
8 | 38c |
9 | 26c |
10 | 44c |
11 | 32c |
12 | 42c |
13 | 3" |
14 | 25c |
15 | 35c |
Which is the heaviest bike?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT ?weight ?bike ?bikelabel
WHERE { ?bike a bikeo:Bike;
rdfs:label ?bikelabel.
?bike vso:weight ?weight.}
ORDER BY DESC(?weight)
LIMIT 1
Result
weight | bike | bikelabel | |
---|---|---|---|
1 | "18.2"^^<http://www.w3.org/2001/XMLSchema#float> | Giant Road E+ 1 Pro 2021 |
Which motor is the most used for electric bikes?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT ?motor ?motorlabel (COUNT (DISTINCT ?bike) AS ?count)
WHERE {?bike a bikeo:Bike;
bikeo:hasType bikeo:electricRoad;
bikeo:hasPart ?motor.
?motor a bikeo:Motor;
rdfs:label ?motorlabel}
GROUP BY ?motor ?motorlabel
ORDER BY DESC(?count)
LIMIT 1
Result
motor | motorlabel | count | |
---|---|---|---|
1 | Specialized SL 1.1 |
How many bikes are there for each gearing?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT ?gearing (COUNT (DISTINCT ?bike) AS ?count)
WHERE {?bike a bikeo:Bike;
bikeo:hasGearing ?gearing.}
GROUP BY ?gearing
ORDER BY DESC(?count)
Result
gearing | count | |
---|---|---|
1 | 2 × 11 | |
2 | 2 × 10 | |
3 | 2 × 12 | |
4 | 1 × 11 | |
5 | 1 × 12 | |
6 | 2 × 9 | |
7 | 2 × 8 | |
8 | 3 × 9 | |
9 | 1 × 10 | |
10 | 1 × 13 |
Which brand produced more bikes in 2021?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT ?brandlabel ?brand ?year (COUNT (DISTINCT ?bike) AS ?count)
WHERE {?brand a bikeo:Brand;
bikeo:isBrandOf ?bike;
rdfs:label ?brandlabel.
?bike vso:modelDate ?year.
FILTER (?year = 2021)}
GROUP BY ?brandlabel ?brand ?year
ORDER BY DESC(?count)
LIMIT 1
Result
brandlabel | brand | year | count | |
---|---|---|---|---|
1 | Cannondale | "2021"^^<http://www.w3.org/2001/XMLSchema#integer> |
How many pieces produced by Shimano are there in a Cannondale bike model Synapse Carbon 4 2022?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT (COUNT(*) AS ?count){
SELECT ?bikePart
WHERE {bikeo:cannondale-synapse-carbon-4-2022 bikeo:hasPart ?bikePart.
?bikePart bikeo:producedBy bikeo:shimano.
}
GROUP BY ?bikePart
}
Result
count | |
---|---|
1 |
Which is the average weight of the bikes for each brand?
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo: <http://purl.org/ontology/bikeo#>
SELECT (AVG(xsd:float(?weight)) AS ?average) ?brand ?brandlabel
WHERE {
?bike bikeo:hasBrand ?brand.
?bike vso:weight ?weight.
?brand rdfs:label ?brandlabel.
}
GROUP BY ?brand
ORDER BY DESC(?average)
Result
average | brand | brandlabel | |
---|---|---|---|
1 | "18.2"^^<http://www.w3.org/2001/XMLSchema#float> | Giant | |
2 | "10.583125"^^<http://www.w3.org/2001/XMLSchema#float> | Trek | |
3 | "9.865383"^^<http://www.w3.org/2001/XMLSchema#float> | CUBE | |
4 | "9.865383"^^<http://www.w3.org/2001/XMLSchema#float> | Cube | |
5 | "9.587434"^^<http://www.w3.org/2001/XMLSchema#float> | Canyon | |
6 | "9.17"^^<http://www.w3.org/2001/XMLSchema#float> | Cannondale |
Which bikes use the biggest chain ring ?
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vso: <http://purl.org/vso/ns#>
PREFIX bikeo:<http://purl.org/ontology/bikeo#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?bike ?bikelabel ?chainring
WHERE {?bike a bikeo:Bike;
rdfs:label ?bikelabel.
?bike bikeo:hasPart ?crank.
?crank bikeo:hasChainRing ?chainring.
{SELECT DISTINCT ?chainring
WHERE {
?crank a bikeo:Crank;
bikeo:hasChainRing ?chainring.
}
ORDER BY DESC(?chainring)
LIMIT 1}.
}
Result
bike | bikelabel | chainring | |
---|---|---|---|
1 | Canyon Endurace CF 7 2022 | ||
2 | Canyon Endurace 7 2022 | ||
3 | Specialized Roubaix Sport 2022 | ||
4 | Canyon Endurace 7 WMN Disc 2022 | ||
5 | Canyon Endurace CF SL 8 Aero 2022 | ||
6 | Trek Domane AL 5 Disc 2022 | ||
7 | Canyon Endurace CF SLX 9 Disc Di2 2022 | ||
8 | Trek Domane SLR 9 2022 | ||
9 | Canyon Endurace CF SL 8 2022 | ||
10 | Trek Domane SL 5 2022 | ||
11 | Specialized S-Works Roubaix – Shimano Dura-Ace Di2 2022 | ||
12 | Canyon Endurace CF SL 7 Disc 2022 | ||
13 | Canyon Endurace CF SL 8 WMN Disc Di2 2022 | ||
14 | Canyon Endurace CF SLX Disc 9.0 Di2 2022 | ||
15 | Specialized Aethos Pro - Ultegra Di2 2022 | ||
16 | Trek Domane SL 6 2022 | ||
17 | Trek Domane SL 7 2022 | ||
18 | Canyon Endurace 7 Disc 2022 | ||
19 | Canyon Endurace 8 Disc 2022 | ||
20 | Canyon Endurace CF SL 8 Disc AERO 2022 | ||
21 | Specialized Roubaix Expert 2022 | ||
22 | Canyon Endurace CF SL 8 Disc Di2 2022 | ||
23 | Specialized S-Works Aethos - Dura-Ace Di2 2022 | ||
24 | Canyon Endurace CF SLX 9 Di2 2022 | ||
25 | Canyon Endurace CF SL 8 Disc 2022 | ||
26 | Canyon Endurace CF SL 8 Di2 2022 | ||
27 | Trek Domane SLR 7 2022 | ||
28 | Specialized Aethos Expert 2022 | ||
29 | Canyon Endurace WMN CF SL Disc 7.0 2022 | ||
30 | Cannondale Synapse Carbon 1 RLE 2022 | ||
31 | Canyon Endurace CF 8 2022 | ||
32 | Canyon Endurace WMN AL Disc 7.0 2022 | ||
33 | Canyon Endurace CF SL 8 WMN Disc 2022 | ||
34 | Canyon Endurace 7 RB 2022 |
Possible future developments
We found really interesting the idea to include in our ontology about bikes some information on how to fix some common bike problems that could occur.
Obviously, it wasn’t possible to cover so many issues and we decided to include the terminology within the T-Box but not populate the cases with pragmatic examples in the A-Box.
So, this implementation is only partial in order to give an idea of how the ontology could be in the future with further implementations, modeling the ontology not only as tool of knowledge representation but also as valid source for solving doubts and questions in case of problems with a bicycle.
On a Jupyter notebook we collected 7 types of problems that could affect a bike, which are Broken Part, Flat Tire, Puncture, Snapped Chain, Worn Brakes, Seat Height and Missing Spokes and connected them to their possible solutions into a Json file.
The creation of the class of Tools was the natural next step to complete this extension of BikeO. Then we added all of them on Protégé, integrating the structure with the properties isProblemOf/hasProblem, isSolutionOf/hasSolution,
isRequestedFor/requests.
The team
Luisa Ammirati

Napoli, Italy
I graduated in Humanities (Modern Curriculum) at Federico II in Naples. I’m currently attending Digital Humanities and Digital Knowledge at the Alma Mater Studiorum University in Bologna. I am a huge fan of photography: after studying and practicing digital photography (and postproduction in Photoshop) for years, I have also extended my knowledge to analogic photography. The image-based modelling, the 3d modelling and the graphic design represent fields of knowledge that I would have a sincere pleasure to deepen.


Constance Dami

Genève, Switzerland
After graduating in General History and Computer Science for the Humanities at the University of my hometown Geneva, I am currently attending the Master's Degree in Digital Humanities and Digital Knowledge at the University of Bologna. I came to Italy to learn everything about Digital Humanities, but also for the amazing food, obviously! My main interests are programming, web development, digital libraries/archives, and data extraction and organization.


Giulia Menna

Isernia, Italy
I graduated in Humanities, Modern Curriculum, at the university of Milan and I am currently attending Digital Humanities and Digital Knowledge Master’s degree at the University of Bologna. I’ve been for so long mainly a Literature enthusiast, but now my personal interests expanded to Computational Linguistics, Natural Language Processing and Web technologies.

