basic filtering - view-a-LOD/Valeros GitHub Wiki

Terminology

Each filter option (e.g., "license") can filter search results based on pre-defined fields (e.g., "sdo:license"), looking at corresponding node values (e.g., "public domain").

Adding/removing filter options

Important

The values field is retrieved automatically, and can remain empty in the settings file.

Add/remove filter options in config/settings.ts (under filtering/filterOptions):

filtering: {  
  filterOptions: {  
	type: {  
	  label: 'Soort',  
	  fieldIds: typePredicates,  
	  values: [],  
	  hideValueIds: [...hideFilterOptionValueIds],  
	},  
	parents: {  
	  label: 'Is onderdeel van',  
	  fieldIds: [  
		...parentPredicates,  
		'https://hetutrechtsarchief.nl/def/isDescendentOf',  
	  ],  
	  values: [],  
	  hideValueIds: [...hideFilterOptionValueIds],  
	},  
	license: {  
	  label: 'Licentie',  
	  fieldIds: ['https://schema.org/license'],  
	  values: [],  
	},  
  },  
}

Filter field IDs

The fieldIds value is used to consider multiple predicates for a single filter.

As an example: the "Type" filter might refer to both the rdf:type and wd:P31 node fields.

Shown filter values

The potential values for each filter are automatically retrieved using elastic in the Filter Service (services/search/filter.service.ts), which is why the values field in the Settings file is empty by default.

Hiding filter values

If there are certain values you want to prevent from showing up, please add the IRIs in the hideValueIds field.

As an example, to hide mdto:ChecksumGegevens in the image below: hideValueIds: ['http://www.nationaalarchief.nl/mdto#ChecksumGegevens']

Showing only certain filter values

Alternatively, if you know of a limited set of filter values that you want to display ahead of time (thereby hiding all other values), please use the showOnlyValueIds field.

As an example, to exclusively show the 'Agenda' value for the 'Classificatie' filter:

classificatie: {
	label: 'Classificatie',
	fieldIds: ['classificatie'],
	values: [],
	showOnlyValueIds: ['Agenda']
}

Note

In the example above, you might have noticed that fieldIds does not refer to linked data IRIs as in other examples. This is because in this Valeros instance, a custom elastic endpoint was configured with human readable field names instead of IRIs. For Valeros, this doesn't really matter, as long as the IDs are unique.

⚠️ **GitHub.com Fallback** ⚠️