Filter content by observation(s) in your Graphlit project.
As content is processed through the configured workflow, Graphlit observes entities such as labels, categories, persons or organizations in the text of your documents, the transcripts of your audio or video files, or even within images.
We call these observations of observables (i.e. observed entities).
You can filter for content which has observed one or more entities, such as a specific person and label and organization. These queries leverage the knowledge graph to find connections between these observed entities and across your content.
Filter By Category
In this example, we will query for the observed categories in the knowledge graph, which contain the word Phone.
Query Categories
Query:
query QueryCategories($filter: CategoryFilter!) {
categories(filter: $filter) {
results {
id
name
}
}
}
Then, by specifying the observations field in the GraphQL content filter object, you can filter your content by this category. (You can provide one or more observations in the array.)
For the observation, you will specify the observableType field as CATEGORY and the observable reference, which takes the ID of the category above.
In the observations field of the GraphQL response, you will find a list of occurrences, which specific the type and location where the category was found.
In this case, it was found multiple times, across multiple pages, of this document. Each occurrence contains a confidence score (between 0.0 and 1.0) of how confident the AI was in observing this entity.
Query Contents
Query:
query QueryContents($filter: ContentFilter!) {
contents(filter: $filter) {
results {
id
name
creationDate
state
owner {
id
}
originalDate
finishedDate
workflowDuration
uri
text
type
fileType
mimeType
fileName
fileSize
masterUri
mezzanineUri
transcriptUri
observations {
id
observableType
observable {
id
name
}
occurrences {
occurrenceType
confidence
startTime
endTime
pageIndex
boundingBox {
left
top
width
height
}
}
}
}
}
}