Determining Object Properties

The relevance language has some features built into it that help you to determine the object properties you can query. For example, suppose we evaluate the following relevance expression:

Q: folder "c:\"
E: The operator "string" is not defined.

This error message means that the relevance expression evaluated successfully, but the relevance language doesn’t know how to display a folder. In order to get some information out of the folder, we’re going to have to query its properties. To do this, we can use the relevance language ‘Introspectors’. The Introspectors return information about the Inspectors currently being used by the relevance debugger and QnA. They contain all the information about what properties of an object can be queried. In essence, they are Inspector Inspectors. For example, to find out the properties of a folder, we use the query:

Q: properties of type "folder"
A: descendants of <folder>: file
A: file <string> of <folder>: file
A: folder <string> of <folder>: folder
A: application <string> of <folder>: application
A: files of <folder>: file
A: find files <string> of <folder>: file
A: folders of <folder>: folder
A: security descriptor of <folder>: security descriptor

However, this is not an exhaustive list of folder properties. A folder type also has a parent type, the filesystem object type. We can query all the properties of a filesystem object as well. For example, pathname is a property of a filesystem object, but it didn’t show up in the properties query above. However, since folder is a subtype of a filesystem object, we can query the pathname of a folder:

Q: pathname of folder "c:\"
A: c:

In order to find out whether the folder type has a parent type, use the following relevance query:

Q: parent of type "folder"
A: filesystem object

Most types do not have a parent type. For example, filesystem object types don’t have a parent type.

Q: parent of type "filesystem object"
A: Singular expression refers to nonexistent object.

Thus, all of the properties that can be queried of a folder are either properties of folder or filesystem, and so the following relevance expression will list both:

Q: properties of type "folder"; properties of type "filesystem object"
A: descendants of <folder>: file
A: file <string> of <folder>: file
A: folder <string> of <folder>: folder
...
A: normal of <filesystem object>: boolean
A: temporary of <filesystem object>: boolean
A: compressed of <filesystem object>: boolean
A: offline of <filesystem object>: boolean
...

An even more thorough list of properties can be discovered using the following expression:

Q: properties whose ( it as string contains "folder" )
A: ancestors of <filesystem object>: folder
A: descendants of <folder>: file
A: parent folder of <filesystem object>: folder
...
A: application folder <string> of <registry>: folder
A: application folder of <registry key>: folder
A: application folder <string> of <registry key>: folder
A: install folder <integer>: folder