• Michael DeBellis

UN Sustainable Development Goals Ontology


I've been helping a startup designed to help small NGOs get funding. We've been looking at the UN Sustainable Development Goals. I found a spreadsheet with meta-data that made building a basic ontology very simple. I put the ontology on Github because there may be significant changes in the future to incorporate the work of another team building a larger ontology and to incorporate more data from the UN SDG data hub. The Github project can be found here.


Besides the ontology itself I thought an overview of how I built it might be interesting. It shows how using tools like Cellfie and SPARQL can automate much of the development. My starting point was this spreadsheet on the UN site. There are 3 classes in the ontology: SDG_Goal, SDG_Target, and SDG_Indicator. The goals are high level goals such as to eliminate poverty (No_Poverty). The targets are more specific tangible goals. Each SDG_Goal has at least one SDG_Target. In addition, each target has at least one indicator, an indicator is a tangible metric to measure if the target is being realized.


For example the No_Poverty SDG_Goal has_Target SDG_Target_1.1: "1.1 By 2030, eradicate extreme poverty for all people everywhere, currently measured as people living on less than $1.25 a day." This target has_Indicator SDG_Indicator_1.1.1 "1.1.1 Proportion of the population living below the international poverty line by sex, age, employment status and geographic location (urban/rural)."


I took the UN spreadsheet and edited it so that it was easier for Cellfie to identify the description associated with each Goal, Target, and Indicator. Then I used Cellfie to create instances of each class and associated the appropriate description with each instance. I encountered one problem with Cellfie. It seems that if there is a ":" in strings then Cellfie assumes the character is an IRI prefix. If you get the error message: "Missing required prefix" when trying to load data into Cellfie that may be the problem. Luckily, there was only one string with a colon and it read equally well if I replaced it with a semi-colon. After I did that Cellfie worked great and created individuals for each goal, target, and indicator and associated the proper text description with each.


I added an annotation property from Dublin Core called dc:identifier. Then I used a simple SPARQL query to take the number at the beginning of each text description and put that in the dc:identifier property. Since I was trying to do everything in Protégé I used CONSTRUCT and the Snap SPARQL plugin. So to parse out the numeric identifier for all the goals the query was:

CONSTRUCT {?g dc:identifier ?i}
WHERE   {?g a :Goal;
		:goalText ?gt.
		BIND(STRBEFORE(?gt," ") as ?i)}

The logical way that the UN had numbered the goals, targets, and indicators made it easy to use SPARQL to parse the strings and create the appropriate property relations. E.g., Goal 1 has targets with numbers such as 1.1, 1.2,... and target 1.1 has indicators such as 1.1.1, 1.1.2,... For example, the following SPARQL code added the required property values to associate each SDG_Target with each of its SDG_Indicators:

CONSTRUCT {?t :has_Indicator ?i}			
WHERE {?i a :SDG_Indicator;
		dc:identifier ?ii.
       ?t a :SDG_Target;
		dc:identifier ?ti.
		BIND (CONCAT(?ti,".") AS ?tiwd)
		BIND(IF(STRSTARTS(?ii,?tiwd),"Match","NoMatch") AS ?match)
		FILTER(?match = "Match")}

This finds the identifier for each target. E.g, the first target for the first goal No_Poverty has the identifier: "1.1". and all the indicators for that target have identifiers such as 1.1.1, 1.1.2,... So I added a decimal point to the identifier for each target and then use STRSTARTS to find any identifiers for indicators that started with "1.1.". Those were all identifier for target 1.1 so I added them as values for the has_Identifier property for each target. I did the same to associate the goals with targets and the inverses were of course all computed by the reasoner. When I first looked at the UN site, I thought it would take me a while to create all the objects and links. In addition, it would be error prone (and boring!). Then I found that meta-data spreadsheet and suddenly a boring, long error prone task became a simple, quick and interesting one. This simple example shows how a non-trivial ontology can be developed very rapidly using tools and a well designed indexing system.




27 views0 comments