-
Notifications
You must be signed in to change notification settings - Fork 1
Data classification
The second part of the data conversion is to classify the data types. When the user has done this we know which columns contain URI's and which columns contain literal values.
- As a user, I want to be able to assign classes to my data in order to let the computer know what we are 'talking' about.
- As a user, I want to specify a base URI if my data doesn't contain URI's yet in order to create valid Linked Data.
- As a user, I want to use common vocabularies to classify my columns in order to create better linkable data.
- As a user, I want a way to undo my classification if I made an error.
- A Literal cannot have a base URI or a type
- When a base-URI is specified a new column of data needs to created containing these URI's
- At least one column must be classified as a URI before the user is able to continue
This component exists of three components
- Interaction bar
- Table representation
- Classification Dialog
The interactions bar only contain the continue button which is by default disabled until the user has at least one URI classification.
The table contains the following data from each row
- Column header
- First value of the column
- URI check box
- Current classification
- Base URI
- reset
The interaction the user has is to click on a URI check box. When the user clicks on it the dialog opens. When the user confirms his classification of the column the check box gets filled in and disabled. Furthermore, the reset button appears. When the user clicks on the reset button the data gets reset to the original state.
The purpose of this dialog is that the user is able to specify a base URI and a classification for a column.
The dialog exists of two steps. In the first step, the user is able to specify a Base URI. When the Base URI field is filled in, new columns will be created with the URI-data.
The second step forces the user to pick a classification from the vocabulary library. The user types a search-term which when hitting enter or clicking the search button will fire a query to the API. The user then gets a maximum of ten options. After that, the user is able to commit the classification and the dialog closes.
This component requires only some data from the previous step. In order to create the structure needed the application uses the following function in the Data creation
setData(data, filename) {
let dataClassifications; // Create an empty object
if (data.length > 1) { // If there is data
dataClassifications = data[0].map((column, index) => ({ // For each column header (first row of data)
columnName: column, // Name it after the first value in the column
exampleValue: data[1][index], // Set the actual first value (second row)
class: { name: 'Literal' }, // Everything is literal by default.
uri: false, // See above
}));
} else { // If no data was found
dataClassifications = []; // There are no values examlevalues
}
this.setState({// Update the state
data,
dataClassifications,
filename,
});
}
name | type | required | description |
---|---|---|---|
data | Array | ✔️ | An array of data descriptions objects as seen in the code example above |
setClass | function | ✔️ | function called with the column index and the new class object of this column |
setURI | function | ✔️ | function called with the column index and the new state of the URI flag of the data-object |
setBaseUri | function | ✔️ | function called with the column index and the new base-URI of the object |
nextPage | function | ✔️ | A Callback function which is called when a user clicks on continue |
RDF-PAQT is the result of the bachelor thesis of Gerwin Bosch commissioned by the Kadaster