Searching the VKG: metadataFilter
When searching the VKG, there is an option to provide metadataFilters that will allow you to narrow down search results to nodes with desired metadata. The supported filters are:
oneOfmoreThanmoreThanEqlessThanlessThanEq
These should be specified the same way default and type are specified, inside a wrapped metadataFilter JSON:
{
"metadataFilter": {
"artist": {
"oneOf": ["billie eilish", "metallica", "the weeknd", "michael jackson"]
},
"year": {
"moreThanEq": "2005"
}
}
}
All the filters are key-value pairs with the exception of oneOf which takes in a list of values. Nodes pass when they contain "one of" the list of values in their metadata.
Note that comparisons with numbers that are typed to string or any may not be what you expect for the comparison filters moreThan, moreThanEq, lessThan, and lessThanEq:
2 > 10is True, because2appears ahead of10alphanumerically.a > 1is True, becauseaappears ahead of1alphanumerically.
Due to the ISO standard, datetimes will compare normally. However, as best practice, avoid using the any type and doing comparisions on strings or anys.