Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pdbro2k authored Oct 30, 2023
1 parent c265add commit c8912c9
Showing 1 changed file with 30 additions and 32 deletions.
62 changes: 30 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# cql-parser-xqm
# fcs-ql-parser-xqm

This software package provides an XQuery module developed at the Digital Academy of the Academy of Sciences and Literature | Mainz that may be used to parse [FCS-QL](https://office.clarin.eu/v/CE-2017-1046-FCS-Specification-v89.pdf) and transform FCS-QL queries into a custom XML format that matches the [provided schema](schema/query.rng).

Expand Down Expand Up @@ -34,7 +34,7 @@ transforms a CLARIN FCS-QL query into a query element

### Parameters:

**$query?** a query following the syntax of FCS-QL (c.f. https://office.clarin.eu/v/CE-2017-1046-FCS-Specification-v89.pdf) - e.g. `"lorem"` or `[lemma = "ipsum"/l & pos='ADJ']`
**$query?** a query following the syntax of FCS-QL (c.f. https://office.clarin.eu/v/CE-2017-1046-FCS-Specification-v89.pdf) - e.g. `"lorem"` or `[lemma = "ipsum"/id & pos != 'NOUN']` or `[word='test'] within s`

### Returns:

Expand All @@ -53,39 +53,37 @@ transforms a CLARIN FCS-QL query into a query element
```
or
```xml
<searchClause xmlns="http://www.loc.gov/zing/cql/xcql/">
<index>c.title</index>
<relation>
<value>any</value>
</relation>
<term>fish frog</term>
</searchClause>
<query>
<segment>
<boolean>
<operator>and</operator>
<expression>
<attribute>lemma</attribute>
<operator>=</operator>
<regexp flags="id">ipsum</regexp>
</expression>
<expression>
<attribute>pos</attribute>
<operator>!=</operator>
<regexp>NOUN</regexp>
</expression>
</boolean>
</segment>
</query>
</query>
```
or
```xml
<triple xmlns="http://www.loc.gov/zing/cql/xcql/">
<Boolean>
<value>or</value>
</Boolean>
<leftOperand>
<searchClause>
<index>cql.serverChoice</index>
<relation>
<value>=</value>
</relation>
<term>cat</term>
</searchClause>
</leftOperand>
<rightOperand>
<searchClause>
<index>cql.serverChoice</index>
<relation>
<value>=</value>
</relation>
<term>dog</term>
</searchClause>
</rightOperand>
</triple>
<query>
<segment>
<expression>
<attribute>word</attribute>
<operator>=</operator>
<regexp>test</regexp>
</expression>
</segment>
<scope>s</scope>
</query>
```

---
Expand Down

0 comments on commit c8912c9

Please sign in to comment.