Viewing a saved revision (read-only)
c37cde9d85e042b6aa1e5faf74b8a6ac
Transforming data using d3
This example demonstrates how D3's `nest()` function and custom mapping can transform SPARQL query results about ethnographic artefacts into a hierarchical, country-based dataset with calculated counts. The visualization first loads data from a SPARQL endpoint using `d3.json`, cleans the raw bindings by extracting property values, then groups entries by country label and computes each country’s total number of artefacts. The code uses D3 v5’s `nest().key().entries()` API to perform the grouping, and logs the raw, cleaned, and transformed data to the console for inspection.
AI-generated descriptionTransforming data using d3
Concept
I'm going to group data using nest() and to add some calculated values. I'll try to do this based on SPARQL data about ethnographic artefacts