Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Xquery for DRB

This xquery module allows execute xquery on DRB nodes.

Using this module

To include this module into your project, the drb-xquery module shall be referenced into requirement.txt file, or the following pip line can be run:

pip install drb-xquery

Example for execute a query on xml node:

    node_file = DrbFileFactory().create("/path_xml_file/namefile.xml")
    node = XmlNodeFactory().create(node_file)

    # request node named 2A_Tile_ID with ns as namespace
    query = DrbXQuery("/ns:Level-2A_Tile_ID")
    result = query.execute(node)

Result is always a list of value or dynamic context

Example with external variables:

    # create the query from  String   
    query = DrbXQuery("declare variable $x external; "
                     "declare variable $y external := 5; $x+$y")

    list_var = {'x': 9, 'y': 12}

    result = query.execute(node, list_var)

    # result[0] == 21

Limitations and differences with W3C standard

The data() function return only the value of elt

for example :

 data(element root {element foo {"child"}, " parent" })

return in W3C standard:

child parent

return in this implementation:

parent

The infinity value is allowed for Decimal as for float: In W3C infinity is only allowed for float or double.

The type xs:double is identical to xs:float The type xs:long, xs:short, xs:byte are identical to xs:integer

Other limitations

Some types are not defined like: xs:anyURI xs:untypedAtomic ...

Some functions are not yet implemented like: yearMonthDuration deep-equal remove processing-instruction exactly-one ...

Some expressions are not (yet) implemented like: group by order by typeswitch treat as map and array are not defined too

Warning for user using drb java implementation of Xquery

When using positional predicates, you should be aware that the to keyword does not work as you might expect when used in predicates. If you want the first three products, it may be tempting to use the syntax:

doc("catalog.xml")/catalog/product[1 to 3]

However, this will raise an error[*] because the predicate evaluates to multiple numbers instead of a single one. You can, however, use the syntax:

doc("catalog.xml")/catalog/product[position() = (1 to 3)]

For compare function the result is only -1,0, 1 , in java thi function return a negative value that can be different to -1 or a positive value that represent a difference between the two string...

Metadata

Release files for drb-xquery 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drb-xquery 1.0.0
File Size Uploaded Provenance Actions
drb-xquery-1.0.0.tar.gz 3.3 MB Without provenance Details for drb-xquery-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for drb-xquery 1.0.0
File Interpreter ABI Platform Actions
drb_xquery-1.0.0-py3-none-any.whl Python 3 none any Details for drb_xquery-1.0.0-py3-none-any.whl

Total release size: 3.5 MB

Release files / drb-xquery-1.0.0.tar.gz

Download URL drb-xquery-1.0.0.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
22b19ea8a77e4af6bfe8e31b8d618cdd438a79ffe9148b0b71cc2a23d9a04836
BLAKE2b-256 checksum
How to use checksums
cffd825604d245fc71bfb1c63f965eced599795ca4e9eaad43be5d5f9a5614e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.11.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.12

Release files / drb_xquery-1.0.0-py3-none-any.whl

Download URL drb_xquery-1.0.0-py3-none-any.whl
Size 177.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d12c12e4f97a2d3b06b9601130efc5b1c85a6f68fa9836dc70c9c422b9176d8
BLAKE2b-256 checksum
How to use checksums
6532e50462d4bcfe912fb910584a81e832d85d55a0588aca6ac68b53e1baf859
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.11.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.12

Security for drb-xquery 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page