Query system: How to look for annotations in the text?

0 views
Skip to first unread message

Samuela Begaj

unread,
Feb 23, 2026, 10:12:43 AM (2 days ago) Feb 23
to inception-users
Hello everyone

I have a question concerning the annotation query system.
I would like to look for annotations at the feature level, specifically, I would like to look for those elements that belong to a tagset, which is then connected to a specific feature. 
Until know I managed only to find out how to look for the overarching layer with the function <LayerX.FeatureX/>. I would be interested in looking for both single-token and multi-token items.

I would really appreciate your help and thank you in advance!
Best regards
Samuela Begaj


Richard Eckart de Castilho

unread,
Feb 24, 2026, 1:19:16 AM (23 hours ago) Feb 24
to incepti...@googlegroups.com
Hello Samuela,

> On 23. Feb 2026, at 16:12, Samuela Begaj <samuela...@gmail.com> wrote:
>
> I have a question concerning the annotation query system.
> I would like to look for annotations at the feature level, specifically, I would like to look for those elements that belong to a tagset, which is then connected to a specific feature.
> Until know I managed only to find out how to look for the overarching layer with the function <LayerX.FeatureX/>. I would be interested in looking for both single-token and multi-token items.

The "pointy bracket" syntax your are using (`<LayerX.FeatureX/>`) matches single- and multi-token items.
If you wanted to match only single tokens, you'd use the "square bracket" syntax (`[LayerX.FeatureX/]`).

In order to match only annotations where a given feature has a given value, you add `="XXX"`, e.g.
`<LayerX.FeatureX="XXX"/>`. Note that the values are case sensitive.

Does that solve your problem?

Cheers,

-- Richard

Samuela Begaj

unread,
Feb 24, 2026, 3:00:50 AM (21 hours ago) Feb 24
to incepti...@googlegroups.com
Hello Richard

I thank you for your prompt answer.
I was aware of the query string <LayerX.FeatureX="XXX"/> and I had already tried it, but it does not seem to work. 

My layer A contains a feature B and this feature is connected with a tagset C. So, I would assume "XXX" should be the tagset C? What I want to search though are the specific items that are entailed in the tagset C. I hope I am explaining this in a correct way.

Let me know if you need more information
Thanks a lot and have a nice day!
Best regards
Samuela Begaj

--
You received this message because you are subscribed to a topic in the Google Groups "inception-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/inception-users/t75WalKfA9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to inception-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/inception-users/403D2B74-01ED-4787-A893-33AEDF58711A%40gmail.com.

Richard Eckart de Castilho

unread,
Feb 24, 2026, 3:10:33 AM (21 hours ago) Feb 24
to incepti...@googlegroups.com
Hi,

> On 24. Feb 2026, at 09:00, Samuela Begaj <samuela...@gmail.com> wrote:
>
> My layer A contains a feature B and this feature is connected with a tagset C. So, I would assume "XXX" should be the tagset C? What I want to search though are the specific items that are entailed in the tagset C. I hope I am explaining this in a correct way.

XXX would be a tag from the tagset.

Here is an actual example.

1) Create a new project using the template "Entity annotation" and ensure that the "Include example documents" is turned on in the "Create new project..." dialog.
2) Open the first document in the annotation page
3) Open the search sidebar and search for `<Named_entity.value="Location"/>`

So the layer here is "Named entity" which needs to become "Named_entity" for the query.
The feature is "value".
The tag to search for is "Location".

I hope that makes it explicit.

Cheers,

-- Richard


Samuela Begaj

unread,
Feb 24, 2026, 3:27:10 AM (21 hours ago) Feb 24
to incepti...@googlegroups.com
Dear Richard

Thanks, yes this corresponds exactly to what I need. 
So, since the query string is correct, I started thinking that the problem might concern the way the tagset items are named. In fact, some of them are called for example gram_corr_err="case". I am thinking now if maybe the presence of quotation marks creates problems in the search. In fact, if I try with other annotation items like gram_unknown, which do not have these quotation marks in the name, then it works! 

Also, I noticed that not all texts are shown and I was wondering why. We are working with approximately 1000 texts and the annotations displayed when searching concern only one third of the whole corpus. Is there a reason for this? I tried to click on "low-level paging", but if I do that no annotation at all is displayed.

I am sorry for all of these questions and I thank you in advance!

Best regards
Samuela Begaj

--
You received this message because you are subscribed to a topic in the Google Groups "inception-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/inception-users/t75WalKfA9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to inception-use...@googlegroups.com.

Richard Eckart de Castilho

unread,
Feb 24, 2026, 3:39:08 AM (20 hours ago) Feb 24
to incepti...@googlegroups.com
Hi,

> On 24. Feb 2026, at 09:26, Samuela Begaj <samuela...@gmail.com> wrote:
>
> So, since the query string is correct, I started thinking that the problem might concern the way the tagset items are named. In fact, some of them are called for example gram_corr_err="case". I am thinking now if maybe the presence of quotation marks creates problems in the search. In fact, if I try with other annotation items like gram_unknown, which do not have these quotation marks in the name, then it works!

If you have quotes in the tags themselves, you need to escape them in the query using backslashes, e.g.:

`<Named_entity.value="x=\"y\""/>`

> Also, I noticed that not all texts are shown and I was wondering why. We are working with approximately 1000 texts and the annotations displayed when searching concern only one third of the whole corpus. Is there a reason for this? I tried to click on "low-level paging", but if I do that no annotation at all is displayed.

That is a good question. So assuming the documents are not "locked" for the user doing the query, results from them should appear.
It is possible that there were indexing errors with certain documents, then those might end up not being searchable.
You could watch the log and then trigger an index rebuild on the "annotation" page in the project settings to see if that is the case.
Can you share the corpus for debugging? Or can you reproduce the problem with a freely sharable corpus?

Cheers,

-- Richard

Samuela Begaj

unread,
Feb 24, 2026, 4:19:23 AM (20 hours ago) Feb 24
to incepti...@googlegroups.com
Dear Richard,

thanks for your answers.
Backlashes were definitely the solution! We have some tags also with spaces between the words and I used an underscore for them. The problem is when I start the search it says that no annotation is found (so the string is correct), which is weird because I look for annotations of which I know that they occur often. Do I have to add also for the underscore something else?

As to the other problem, I am not sure what do I have to do. What do you mean exactly by "watch the log"? 
Anyway, I would have to ask my team regarding the sharing of the corpus. I will come back at you as soon as possible.

But I am really really grateful for your help!

Best regards
Samuela

--
You received this message because you are subscribed to a topic in the Google Groups "inception-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/inception-users/t75WalKfA9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to inception-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages