ds-caselaw-marklogic-api-client 43.1.0__tar.gz → 44.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/PKG-INFO +3 -3
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/pyproject.toml +8 -8
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/Client.py +38 -5
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/factories.py +1 -1
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/__init__.py +13 -1
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/body.py +7 -14
- ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/models/documents/stub.py +50 -0
- ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/models/documents/templates/judgment.xml +67 -0
- ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/models/documents/templates/original.xml +68 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/transforms/html.xsl +1 -1
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/utilities/aws.py +7 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/types.py +42 -0
- ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/xquery/check_content_hash_unique_by_uri.xqy +18 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_judgment.xqy +2 -12
- ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/xquery/get_locked_documents.xqy +10 -0
- ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/xquery/get_pending_parse_for_version_count.xqy +27 -0
- ds_caselaw_marklogic_api_client-43.1.0/src/caselawclient/xquery/get_pending_parse_for_version.xqy → ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/xquery/get_pending_parse_for_version_documents.xqy +3 -2
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_metadata_jurisdiction.xqy +1 -1
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/xslt_transform.xqy +4 -28
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery_type_dicts.py +8 -2
- ds_caselaw_marklogic_api_client-43.1.0/src/caselawclient/xquery/check_content_hash_unique_by_uri.xqy +0 -15
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/LICENSE.md +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/README.md +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/client_helpers/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/client_helpers/search_helpers.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/content_hash.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/errors.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/identifier_resolution.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/managers/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/managers/merge/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/managers/merge/checks.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/comparison.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/exceptions.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/statuses.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/versions.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/documents/xml.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/identifiers/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/identifiers/collection.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/identifiers/exceptions.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/identifiers/fclid.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/identifiers/neutral_citation.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/identifiers/press_summary_ncn.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/identifiers/unpacker.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/judgments.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/neutral_citation_mixin.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/parser_logs.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/press_summaries.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/utilities/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/utilities/dates.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/models/utilities/move.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/py.typed +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/responses/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/responses/search_response.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/responses/search_result.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/responses/xsl/search_match.xsl +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/search_parameters.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xml_helpers.py +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/break_judgment_checkout.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/checkin_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/checkout_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/copy_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/delete_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/document_collections.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/document_exists.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_combined_stats_table.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_components_for_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_highest_enrichment_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_highest_parser_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_judgment_checkout_status.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_judgment_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_last_modified.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_missing_fclid.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_next_document_sequence_number.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_pending_enrichment_for_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_properties_for_search_results.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_property.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_property_as_node.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_recently_enriched.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_recently_parsed.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_version_annotation.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/get_version_created.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/insert_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/list_judgment_versions.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/resolve_from_identifier_slug.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/resolve_from_identifier_value.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_boolean_property.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_datetime_property.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_metadata_citation.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_metadata_court.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_metadata_name.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_metadata_this_uri.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_metadata_work_expression_date.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_property.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/set_property_as_node.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/update_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/update_locked_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/user_has_privilege.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/user_has_role.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/validate_all_documents.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/validate_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xquery/xslt.xqy +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xslt/modify_xml_live.xsl +0 -0
- {ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/src/caselawclient/xslt/sample.xsl +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: ds-caselaw-marklogic-api-client
|
|
3
|
-
Version:
|
|
3
|
+
Version: 44.4.1
|
|
4
4
|
Summary: An API client for interacting with the underlying data in Find Caselaw.
|
|
5
5
|
Keywords: national archives,caselaw
|
|
6
6
|
Author: The National Archives
|
|
@@ -9,11 +9,11 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.12
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.13
|
|
11
11
|
Requires-Dist: boto3 (>=1.26.112,<2.0.0)
|
|
12
|
-
Requires-Dist: certifi (>=2025.
|
|
12
|
+
Requires-Dist: certifi (>=2025.11.12,<2025.12.0)
|
|
13
13
|
Requires-Dist: charset-normalizer (>=3.0.0,<4.0.0)
|
|
14
14
|
Requires-Dist: defusedxml (>=0.7.1,<0.8.0)
|
|
15
15
|
Requires-Dist: django-environ (>=0.12.0)
|
|
16
|
-
Requires-Dist: ds-caselaw-utils (>=2.
|
|
16
|
+
Requires-Dist: ds-caselaw-utils (>=2.10.0,<3.0.0)
|
|
17
17
|
Requires-Dist: idna (>=3.4,<4.0)
|
|
18
18
|
Requires-Dist: lxml (>=6.0.0,<7.0.0)
|
|
19
19
|
Requires-Dist: memoization (>=0.4.0,<0.5.0)
|
{ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/pyproject.toml
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "ds-caselaw-marklogic-api-client"
|
|
3
|
-
version = "
|
|
3
|
+
version = "44.4.1"
|
|
4
4
|
description = "An API client for interacting with the underlying data in Find Caselaw."
|
|
5
5
|
authors = ["The National Archives"]
|
|
6
6
|
homepage = "https://github.com/nationalarchives/ds-caselaw-custom-api-client"
|
|
@@ -12,7 +12,7 @@ packages = [
|
|
|
12
12
|
|
|
13
13
|
[tool.poetry.dependencies]
|
|
14
14
|
python = "^3.12.0"
|
|
15
|
-
certifi = ">=2025.
|
|
15
|
+
certifi = ">=2025.11.12,<2025.12.0"
|
|
16
16
|
charset-normalizer = "^3.0.0"
|
|
17
17
|
django-environ = ">=0.12.0"
|
|
18
18
|
idna = "^3.4"
|
|
@@ -20,7 +20,7 @@ requests = "^2.28.2"
|
|
|
20
20
|
requests-toolbelt = ">=0.10.1,<1.1.0"
|
|
21
21
|
memoization = "^0.4.0"
|
|
22
22
|
lxml = "^6.0.0"
|
|
23
|
-
ds-caselaw-utils = "^2.
|
|
23
|
+
ds-caselaw-utils = "^2.10.0"
|
|
24
24
|
boto3 = "^1.26.112"
|
|
25
25
|
typing-extensions = "^4.7.1"
|
|
26
26
|
mypy-boto3-s3 = "^1.26.104"
|
|
@@ -33,14 +33,14 @@ defusedxml = "^0.7.1"
|
|
|
33
33
|
pydantic = "^2.12.3"
|
|
34
34
|
|
|
35
35
|
[tool.poetry.group.dev.dependencies]
|
|
36
|
-
coverage = "7.
|
|
37
|
-
pytest = "
|
|
36
|
+
coverage = "7.13.1"
|
|
37
|
+
pytest = "9.0.2"
|
|
38
38
|
pytest-cov = "7.0.0"
|
|
39
|
-
beautifulsoup4 = "4.14.
|
|
39
|
+
beautifulsoup4 = "4.14.3"
|
|
40
40
|
responses = "0.25.8"
|
|
41
41
|
python-dotenv = "1.2.1"
|
|
42
|
-
time-machine = "2.
|
|
43
|
-
moto = {version = "5.1.
|
|
42
|
+
time-machine = "3.2.0"
|
|
43
|
+
moto = {version = "5.1.19", extras = ["all"]}
|
|
44
44
|
|
|
45
45
|
[tool.poetry.group.docs]
|
|
46
46
|
optional = true
|
|
@@ -32,7 +32,7 @@ from caselawclient.models.judgments import Judgment
|
|
|
32
32
|
from caselawclient.models.press_summaries import PressSummary
|
|
33
33
|
from caselawclient.models.utilities import move
|
|
34
34
|
from caselawclient.search_parameters import SearchParameters
|
|
35
|
-
from caselawclient.types import DocumentIdentifierSlug, DocumentIdentifierValue, DocumentURIString
|
|
35
|
+
from caselawclient.types import DocumentIdentifierSlug, DocumentIdentifierValue, DocumentLock, DocumentURIString
|
|
36
36
|
from caselawclient.xquery_type_dicts import (
|
|
37
37
|
CheckContentHashUniqueByUriDict,
|
|
38
38
|
MarkLogicDocumentURIString,
|
|
@@ -1222,13 +1222,13 @@ class MarklogicApiClient:
|
|
|
1222
1222
|
|
|
1223
1223
|
return (int(table[1][1]), int(table[1][2]))
|
|
1224
1224
|
|
|
1225
|
-
def
|
|
1225
|
+
def get_documents_pending_parse_for_version(
|
|
1226
1226
|
self,
|
|
1227
1227
|
target_version: tuple[int, int],
|
|
1228
1228
|
maximum_records: int = 1000,
|
|
1229
1229
|
) -> list[list[Any]]:
|
|
1230
|
-
"""Retrieve documents which are not yet parsed with a given version."""
|
|
1231
|
-
vars: query_dicts.
|
|
1230
|
+
"""Retrieve a list of documents which are not yet parsed with a given version."""
|
|
1231
|
+
vars: query_dicts.GetPendingParseForVersionDocumentsDict = {
|
|
1232
1232
|
"target_major_version": target_version[0],
|
|
1233
1233
|
"target_minor_version": target_version[1],
|
|
1234
1234
|
"maximum_records": maximum_records,
|
|
@@ -1237,13 +1237,33 @@ class MarklogicApiClient:
|
|
|
1237
1237
|
get_single_string_from_marklogic_response(
|
|
1238
1238
|
self._send_to_eval(
|
|
1239
1239
|
vars,
|
|
1240
|
-
"
|
|
1240
|
+
"get_pending_parse_for_version_documents.xqy",
|
|
1241
1241
|
),
|
|
1242
1242
|
),
|
|
1243
1243
|
)
|
|
1244
1244
|
|
|
1245
1245
|
return results
|
|
1246
1246
|
|
|
1247
|
+
def get_count_pending_parse_for_version(
|
|
1248
|
+
self,
|
|
1249
|
+
target_version: tuple[int, int],
|
|
1250
|
+
) -> int:
|
|
1251
|
+
"""Get the total number of documents which are not yet parsed with a given version."""
|
|
1252
|
+
vars: query_dicts.GetPendingParseForVersionCountDict = {
|
|
1253
|
+
"target_major_version": target_version[0],
|
|
1254
|
+
"target_minor_version": target_version[1],
|
|
1255
|
+
}
|
|
1256
|
+
results = json.loads(
|
|
1257
|
+
get_single_string_from_marklogic_response(
|
|
1258
|
+
self._send_to_eval(
|
|
1259
|
+
vars,
|
|
1260
|
+
"get_pending_parse_for_version_count.xqy",
|
|
1261
|
+
),
|
|
1262
|
+
),
|
|
1263
|
+
)
|
|
1264
|
+
|
|
1265
|
+
return int(results[1][0])
|
|
1266
|
+
|
|
1247
1267
|
def get_recently_parsed(
|
|
1248
1268
|
self,
|
|
1249
1269
|
) -> list[list[Any]]:
|
|
@@ -1259,6 +1279,19 @@ class MarklogicApiClient:
|
|
|
1259
1279
|
|
|
1260
1280
|
return results
|
|
1261
1281
|
|
|
1282
|
+
def get_locked_documents(
|
|
1283
|
+
self,
|
|
1284
|
+
) -> list[DocumentLock]:
|
|
1285
|
+
"""Retrieve all currently locked documents."""
|
|
1286
|
+
results = [
|
|
1287
|
+
DocumentLock.from_string(lock)
|
|
1288
|
+
for lock in get_multipart_strings_from_marklogic_response(
|
|
1289
|
+
self._send_to_eval({}, "get_locked_documents.xqy")
|
|
1290
|
+
)
|
|
1291
|
+
]
|
|
1292
|
+
|
|
1293
|
+
return sorted(results, key=lambda lock: lock.timestamp)
|
|
1294
|
+
|
|
1262
1295
|
def get_missing_fclid(
|
|
1263
1296
|
self,
|
|
1264
1297
|
maximum_records: int = 50,
|
|
@@ -20,7 +20,7 @@ T = TypeVar("T")
|
|
|
20
20
|
|
|
21
21
|
DEFAULT_DOCUMENT_BODY_XML = """<akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn">
|
|
22
22
|
<judgment name="decision">
|
|
23
|
-
<meta/><header
|
|
23
|
+
<meta/><header><p>Header contains text</p></header>
|
|
24
24
|
<judgmentBody>
|
|
25
25
|
<decision>
|
|
26
26
|
<p>This is a document.</p>
|
|
@@ -26,6 +26,7 @@ from caselawclient.models.utilities import VersionsDict, extract_version, render
|
|
|
26
26
|
from caselawclient.models.utilities.aws import (
|
|
27
27
|
ParserInstructionsDict,
|
|
28
28
|
announce_document_event,
|
|
29
|
+
are_unpublished_assets_clean,
|
|
29
30
|
check_docx_exists,
|
|
30
31
|
delete_documents_from_private_bucket,
|
|
31
32
|
generate_docx_url,
|
|
@@ -102,6 +103,11 @@ class Document:
|
|
|
102
103
|
True,
|
|
103
104
|
"There is another document with identical content",
|
|
104
105
|
),
|
|
106
|
+
(
|
|
107
|
+
"has_only_clean_assets",
|
|
108
|
+
True,
|
|
109
|
+
"An uncleaned asset exists for this document",
|
|
110
|
+
),
|
|
105
111
|
]
|
|
106
112
|
"""
|
|
107
113
|
A list of tuples in the form:
|
|
@@ -252,7 +258,7 @@ class Document:
|
|
|
252
258
|
"""
|
|
253
259
|
if self.is_version:
|
|
254
260
|
raise NotSupportedOnVersion(
|
|
255
|
-
"Cannot get versions of a version for {self.uri}",
|
|
261
|
+
f"Cannot get versions of a version for {self.uri}",
|
|
256
262
|
)
|
|
257
263
|
docs = []
|
|
258
264
|
for version in self.versions:
|
|
@@ -370,6 +376,12 @@ class Document:
|
|
|
370
376
|
"""Check if the content hash of this document is unique compared to all other documents in MarkLogic."""
|
|
371
377
|
return self.api_client.has_unique_content_hash(self.uri)
|
|
372
378
|
|
|
379
|
+
@cached_property
|
|
380
|
+
def has_only_clean_assets(self) -> bool:
|
|
381
|
+
"""False if any non-tar.gz assets associated with this document have not been cleaned."""
|
|
382
|
+
return True # TODO: Remove this once we have enabled the asset cleaning pipeline.
|
|
383
|
+
return are_unpublished_assets_clean(self.uri)
|
|
384
|
+
|
|
373
385
|
@cached_property
|
|
374
386
|
def version_created_datetime(self) -> datetime.datetime:
|
|
375
387
|
return self.api_client.get_version_created_datetime(self.uri)
|
|
@@ -11,14 +11,10 @@ from saxonche import PySaxonProcessor
|
|
|
11
11
|
|
|
12
12
|
from caselawclient.models.utilities.dates import parse_string_date_as_utc
|
|
13
13
|
from caselawclient.types import DocumentCategory
|
|
14
|
+
from caselawclient.xml_helpers import DEFAULT_NAMESPACES
|
|
14
15
|
|
|
15
16
|
from .xml import XML
|
|
16
17
|
|
|
17
|
-
DEFAULT_NAMESPACES = {
|
|
18
|
-
"uk": "https://caselaw.nationalarchives.gov.uk/akn",
|
|
19
|
-
"akn": "http://docs.oasis-open.org/legaldocml/ns/akn/3.0",
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
|
|
23
19
|
class UnparsableDate(Warning):
|
|
24
20
|
pass
|
|
@@ -176,15 +172,12 @@ class DocumentBody:
|
|
|
176
172
|
@cached_property
|
|
177
173
|
def has_content(self) -> bool:
|
|
178
174
|
"""If we do not have a word document, the XML will not contain
|
|
179
|
-
the contents of the judgment, but will
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return True
|
|
186
|
-
|
|
187
|
-
return False
|
|
175
|
+
the contents of the judgment, but will have content in the header if a judgment.
|
|
176
|
+
All press summaries (which have <doc> not <judgment> tags) are assumed to have content"""
|
|
177
|
+
return bool(
|
|
178
|
+
self._xml.xml_as_tree.xpath("//akn:header[normalize-space(string(.))]", namespaces=DEFAULT_NAMESPACES)
|
|
179
|
+
or self._xml.xml_as_tree.xpath("//akn:doc", namespaces=DEFAULT_NAMESPACES)
|
|
180
|
+
)
|
|
188
181
|
|
|
189
182
|
@cached_property
|
|
190
183
|
def has_external_data(self) -> bool:
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from typing import Literal
|
|
3
|
+
|
|
4
|
+
from ds_caselaw_utils.courts import courts
|
|
5
|
+
from ds_caselaw_utils.types import CourtCode
|
|
6
|
+
from jinja2 import StrictUndefined, Template
|
|
7
|
+
from typing_extensions import TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PartyData(TypedDict):
|
|
11
|
+
role: Literal["Claimant", "Respondent", "Appellant", "Defendant"]
|
|
12
|
+
name: str
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class EditorStubData(TypedDict):
|
|
16
|
+
decision_date: str # day precision
|
|
17
|
+
transform_datetime: str # second precision
|
|
18
|
+
court_code: str
|
|
19
|
+
title: str
|
|
20
|
+
year: str
|
|
21
|
+
case_numbers: list[str] # can be none
|
|
22
|
+
parties: list[PartyData] # (type (claimant|defendant), name)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class RendererStubData(EditorStubData):
|
|
26
|
+
court_url: str # should be populated from utils/courts.cs
|
|
27
|
+
court_full_name: str # ditto
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def add_other_stub_fields(editor_data: EditorStubData) -> RendererStubData:
|
|
31
|
+
court = courts.get_court_by_code(CourtCode(editor_data["court_code"].upper()))
|
|
32
|
+
return {
|
|
33
|
+
**editor_data,
|
|
34
|
+
"court_url": court.identifier_iri,
|
|
35
|
+
"court_full_name": court.long_name,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def render_stub_xml(editor_data: EditorStubData) -> bytes:
|
|
40
|
+
render_data = add_other_stub_fields(editor_data)
|
|
41
|
+
from caselawclient.Client import ROOT_DIR
|
|
42
|
+
|
|
43
|
+
judgment_path = Path(ROOT_DIR) / "models" / "documents" / "templates" / "judgment.xml"
|
|
44
|
+
|
|
45
|
+
with (judgment_path).open("r") as f:
|
|
46
|
+
template = f.read()
|
|
47
|
+
|
|
48
|
+
rendered = bytes(Template(template, undefined=StrictUndefined).render(render_data).encode("utf-8"))
|
|
49
|
+
|
|
50
|
+
return rendered
|
ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/models/documents/templates/judgment.xml
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn">
|
|
3
|
+
<judgment name="decision">
|
|
4
|
+
<meta>
|
|
5
|
+
<identification source="#tna">
|
|
6
|
+
<FRBRWork>
|
|
7
|
+
<FRBRthis value="" />
|
|
8
|
+
<FRBRuri value="" />
|
|
9
|
+
<FRBRdate date="{{decision_date}}" name="decision" />
|
|
10
|
+
<FRBRauthor href="#{{court_code.lower()}}" />
|
|
11
|
+
<FRBRcountry value="GB-UKM" />
|
|
12
|
+
<FRBRname value="{{title}}" />
|
|
13
|
+
</FRBRWork>
|
|
14
|
+
<FRBRExpression>
|
|
15
|
+
<FRBRthis value="" />
|
|
16
|
+
<FRBRuri value="" />
|
|
17
|
+
<FRBRdate date="{{decision_date}}" name="decision" />
|
|
18
|
+
<FRBRauthor href="#{{court_code.lower()}}" />
|
|
19
|
+
<FRBRlanguage language="eng" />
|
|
20
|
+
</FRBRExpression>
|
|
21
|
+
<FRBRManifestation>
|
|
22
|
+
<FRBRthis value="" />
|
|
23
|
+
<FRBRuri value="" />
|
|
24
|
+
<FRBRdate date="{{transform_datetime}}" name="transform" />
|
|
25
|
+
<FRBRauthor href="#tna" />
|
|
26
|
+
<FRBRformat value="application/xml" />
|
|
27
|
+
</FRBRManifestation>
|
|
28
|
+
</identification>
|
|
29
|
+
<lifecycle source="#">
|
|
30
|
+
<eventRef date="{{decision_date}}" refersTo="#decision" source="#" />
|
|
31
|
+
</lifecycle>
|
|
32
|
+
<references source="#tna">
|
|
33
|
+
<TLCOrganization
|
|
34
|
+
eId="tna"
|
|
35
|
+
href="https://www.nationalarchives.gov.uk/"
|
|
36
|
+
showAs="The National Archives"
|
|
37
|
+
/>
|
|
38
|
+
<TLCOrganization
|
|
39
|
+
eId="{{court_code.lower()}}"
|
|
40
|
+
href="{{court_url}}"
|
|
41
|
+
showAs="{{court_full_name}}"
|
|
42
|
+
/>
|
|
43
|
+
<TLCEvent eId="decision" href="#" showAs="decision" />
|
|
44
|
+
</references>
|
|
45
|
+
<proprietary
|
|
46
|
+
xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn"
|
|
47
|
+
source="#"
|
|
48
|
+
>
|
|
49
|
+
<uk:court>{{court_code.upper()}}</uk:court>
|
|
50
|
+
<uk:year>{{year}}</uk:year>
|
|
51
|
+
{% for case_number in case_numbers %}
|
|
52
|
+
<uk:caseNumber>{{case_number}}</uk:caseNumber>
|
|
53
|
+
{% endfor %}
|
|
54
|
+
{% for party in parties %}
|
|
55
|
+
<uk:party role="{{party.role}}">{{party.name}}</uk:party>
|
|
56
|
+
{% endfor %}
|
|
57
|
+
<uk:sourceFormat>application/pdf</uk:sourceFormat>
|
|
58
|
+
</proprietary>
|
|
59
|
+
</meta>
|
|
60
|
+
<header />
|
|
61
|
+
<judgmentBody>
|
|
62
|
+
<decision>
|
|
63
|
+
<p />
|
|
64
|
+
</decision>
|
|
65
|
+
</judgmentBody>
|
|
66
|
+
</judgment>
|
|
67
|
+
</akomaNtoso>
|
ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/models/documents/templates/original.xml
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8" ?>
|
|
2
|
+
<!-- from https://github.com/nationalarchives/tna-judgments-parser/blob/main/test/backlog/expected-output/Money%20Worries%20Ltd%20v%20Office%20of%20Fair%20Trading.xml -->
|
|
3
|
+
<!-- generated by github.com/nationalarchives/tna-judgments-parser/blob/main/backlog/src/Stub.cs -->
|
|
4
|
+
<!-- we assume there are no press-releases for these documents -->
|
|
5
|
+
<akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
|
|
6
|
+
<judgment name="decision">
|
|
7
|
+
<meta>
|
|
8
|
+
<identification source="#tna">
|
|
9
|
+
<FRBRWork>
|
|
10
|
+
<FRBRthis value="" />
|
|
11
|
+
<FRBRuri value="" />
|
|
12
|
+
<FRBRdate date="2013-01-18" name="decision" />
|
|
13
|
+
<FRBRauthor href="#ukftt-grc" />
|
|
14
|
+
<FRBRcountry value="GB-UKM" />
|
|
15
|
+
<FRBRname value="Money Worries Ltd v Office of Fair Trading" />
|
|
16
|
+
</FRBRWork>
|
|
17
|
+
<FRBRExpression>
|
|
18
|
+
<FRBRthis value="" />
|
|
19
|
+
<FRBRuri value="" />
|
|
20
|
+
<FRBRdate date="2013-01-18" name="decision" />
|
|
21
|
+
<FRBRauthor href="#ukftt-grc" />
|
|
22
|
+
<FRBRlanguage language="eng" />
|
|
23
|
+
</FRBRExpression>
|
|
24
|
+
<FRBRManifestation>
|
|
25
|
+
<FRBRthis value="" />
|
|
26
|
+
<FRBRuri value="" />
|
|
27
|
+
<FRBRdate date="2025-07-29T12:47:42" name="transform" />
|
|
28
|
+
<FRBRauthor href="#tna" />
|
|
29
|
+
<FRBRformat value="application/xml" />
|
|
30
|
+
</FRBRManifestation>
|
|
31
|
+
</identification>
|
|
32
|
+
<lifecycle source="#">
|
|
33
|
+
<eventRef date="2013-01-18" refersTo="#decision" source="#" />
|
|
34
|
+
</lifecycle>
|
|
35
|
+
<references source="#tna">
|
|
36
|
+
<TLCOrganization
|
|
37
|
+
eId="tna"
|
|
38
|
+
href="https://www.nationalarchives.gov.uk/"
|
|
39
|
+
showAs="The National Archives"
|
|
40
|
+
/>
|
|
41
|
+
<TLCOrganization
|
|
42
|
+
eId="ukftt-grc"
|
|
43
|
+
href="https://www.gov.uk/courts-tribunals/first-tier-tribunal-general-regulatory-chamber"
|
|
44
|
+
showAs="United Kingdom First-tier Tribunal (General Regulatory Chamber)"
|
|
45
|
+
/>
|
|
46
|
+
<TLCEvent eId="decision" href="#" showAs="decision" />
|
|
47
|
+
</references>
|
|
48
|
+
<proprietary
|
|
49
|
+
xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn"
|
|
50
|
+
source="#"
|
|
51
|
+
>
|
|
52
|
+
<uk:court>UKFTT-GRC</uk:court>
|
|
53
|
+
<uk:year>2013</uk:year>
|
|
54
|
+
<uk:caseNumber>CCA/2012/0008</uk:caseNumber>
|
|
55
|
+
<uk:party role="Claimant">Money Worries Ltd</uk:party>
|
|
56
|
+
<uk:party role="Respondent">Office of Fair Trading</uk:party>
|
|
57
|
+
<uk:sourceFormat>application/pdf</uk:sourceFormat>
|
|
58
|
+
<uk:parser>0.27.1</uk:parser>
|
|
59
|
+
</proprietary>
|
|
60
|
+
</meta>
|
|
61
|
+
<header />
|
|
62
|
+
<judgmentBody>
|
|
63
|
+
<decision>
|
|
64
|
+
<p />
|
|
65
|
+
</decision>
|
|
66
|
+
</judgmentBody>
|
|
67
|
+
</judgment>
|
|
68
|
+
</akomaNtoso>
|
|
@@ -208,6 +208,13 @@ def announce_document_event(uri: DocumentURIString, status: str, enrich: bool =
|
|
|
208
208
|
)
|
|
209
209
|
|
|
210
210
|
|
|
211
|
+
def upload_asset_to_private_bucket(body: bytes, s3_key: str) -> None:
|
|
212
|
+
"""Upload an asset to the private bucket."""
|
|
213
|
+
bucket: str = env("PRIVATE_ASSET_BUCKET")
|
|
214
|
+
s3client = create_s3_client()
|
|
215
|
+
s3client.put_object(Body=body, Bucket=bucket, Key=s3_key, Tagging="pdfsource=custom-pdfs")
|
|
216
|
+
|
|
217
|
+
|
|
211
218
|
def copy_assets(old_uri: DocumentURIString, new_uri: DocumentURIString) -> None:
|
|
212
219
|
"""
|
|
213
220
|
Copy *unpublished* assets from one path to another,
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
from dataclasses import dataclass, field
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
|
+
|
|
4
|
+
from lxml import etree
|
|
2
5
|
|
|
3
6
|
|
|
4
7
|
@dataclass
|
|
@@ -106,3 +109,42 @@ def SuccessTuple() -> SuccessFailureMessageTuple:
|
|
|
106
109
|
def FailureTuple(message: str | list[str]) -> SuccessFailureMessageTuple:
|
|
107
110
|
messages = message if isinstance(message, list) else [message]
|
|
108
111
|
return SuccessFailureMessageTuple(success=False, messages=messages)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@dataclass
|
|
115
|
+
class DocumentLock:
|
|
116
|
+
document_uri: DocumentURIString
|
|
117
|
+
owner: str
|
|
118
|
+
timestamp: datetime
|
|
119
|
+
timeout: int
|
|
120
|
+
|
|
121
|
+
NAMESPACES = {
|
|
122
|
+
"lock": "http://marklogic.com/xdmp/lock",
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@classmethod
|
|
126
|
+
def from_string(cls, xml_string: str) -> "DocumentLock":
|
|
127
|
+
root = etree.fromstring(xml_string.encode("utf-8"))
|
|
128
|
+
|
|
129
|
+
return cls(
|
|
130
|
+
document_uri=MarkLogicDocumentURIString(root.xpath("/lock/document/text()")[0]).as_document_uri(),
|
|
131
|
+
owner=root.xpath(
|
|
132
|
+
"/lock/details/lock:lock/lock:active-locks/lock:active-lock/lock:owner/text()",
|
|
133
|
+
namespaces=cls.NAMESPACES,
|
|
134
|
+
)[0],
|
|
135
|
+
timestamp=datetime.fromtimestamp(
|
|
136
|
+
int(
|
|
137
|
+
root.xpath(
|
|
138
|
+
"/lock/details/lock:lock/lock:active-locks/lock:active-lock/lock:timestamp/text()",
|
|
139
|
+
namespaces=cls.NAMESPACES,
|
|
140
|
+
)[0]
|
|
141
|
+
),
|
|
142
|
+
tz=UTC,
|
|
143
|
+
),
|
|
144
|
+
timeout=int(
|
|
145
|
+
root.xpath(
|
|
146
|
+
"/lock/details/lock:lock/lock:active-locks/lock:active-lock/lock:timeout/text()",
|
|
147
|
+
namespaces=cls.NAMESPACES,
|
|
148
|
+
)[0]
|
|
149
|
+
),
|
|
150
|
+
)
|
ds_caselaw_marklogic_api_client-44.4.1/src/caselawclient/xquery/check_content_hash_unique_by_uri.xqy
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
xquery version "1.0-ml";
|
|
2
|
+
declare namespace akn = "http://docs.oasis-open.org/legaldocml/ns/akn/3.0";
|
|
3
|
+
declare namespace uk = "https://caselaw.nationalarchives.gov.uk/akn";
|
|
4
|
+
declare variable $uri as xs:string external;
|
|
5
|
+
|
|
6
|
+
let $doc := doc($uri)
|
|
7
|
+
let $hash := $doc//uk:hash/text()
|
|
8
|
+
let $count :=
|
|
9
|
+
if (not($hash)) then 1
|
|
10
|
+
else
|
|
11
|
+
count(cts:uris(
|
|
12
|
+
(), (),
|
|
13
|
+
cts:and-query((
|
|
14
|
+
cts:element-value-query(xs:QName("uk:hash"), $hash),
|
|
15
|
+
cts:collection-query("http://marklogic.com/collections/dls/latest-version")
|
|
16
|
+
))
|
|
17
|
+
))
|
|
18
|
+
return ($count = 1)
|
|
@@ -11,7 +11,7 @@ declare variable $version_uri as xs:string? external;
|
|
|
11
11
|
declare variable $search_query as xs:string? external;
|
|
12
12
|
|
|
13
13
|
(: Note that `xsl:output method` is changed from `html` to `xml` and we've namespaced the tag :)
|
|
14
|
-
let $
|
|
14
|
+
let $delete_meta_marks_xslt := (
|
|
15
15
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
16
16
|
xmlns:uk="https://caselaw.nationalarchives.gov.uk/akn"
|
|
17
17
|
xmlns:akn="http://docs.oasis-open.org/legaldocml/ns/akn/3.0"
|
|
@@ -25,16 +25,6 @@ let $number_marks_xslt := (
|
|
|
25
25
|
<xsl:template match="//akn:meta//uk:mark">
|
|
26
26
|
<xsl:apply-templates />
|
|
27
27
|
</xsl:template>
|
|
28
|
-
<xsl:template match="uk:mark">
|
|
29
|
-
<xsl:copy>
|
|
30
|
-
<xsl:copy-of select="@*" />
|
|
31
|
-
<xsl:attribute name="id">
|
|
32
|
-
<xsl:text>mark_</xsl:text>
|
|
33
|
-
<xsl:number count="//uk:mark" level="any" from="//*[ancestor::akn:meta]" />
|
|
34
|
-
</xsl:attribute>
|
|
35
|
-
<xsl:apply-templates />
|
|
36
|
-
</xsl:copy>
|
|
37
|
-
</xsl:template>
|
|
38
28
|
</xsl:stylesheet>
|
|
39
29
|
)
|
|
40
30
|
|
|
@@ -56,7 +46,7 @@ let $raw_xml := if ($show_unpublished) then
|
|
|
56
46
|
(: If a search query string is present, highlight instances :)
|
|
57
47
|
let $transformed := if($search_query) then
|
|
58
48
|
xdmp:xslt-eval(
|
|
59
|
-
$
|
|
49
|
+
$delete_meta_marks_xslt,
|
|
60
50
|
cts:highlight(
|
|
61
51
|
$raw_xml,
|
|
62
52
|
helper:make-q-query($search_query),
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
xquery version "1.0-ml";
|
|
2
|
+
|
|
3
|
+
declare variable $target_major_version as xs:int external;
|
|
4
|
+
declare variable $target_minor_version as xs:int external;
|
|
5
|
+
|
|
6
|
+
xdmp:to-json(xdmp:sql(
|
|
7
|
+
"SELECT COUNT(*) as count
|
|
8
|
+
FROM (
|
|
9
|
+
SELECT
|
|
10
|
+
process_data.uri,
|
|
11
|
+
parser_version_string, parser_major_version, parser_minor_version,
|
|
12
|
+
DATEDIFF('minute', last_sent_to_parser, CURRENT_TIMESTAMP) AS minutes_since_parse_request
|
|
13
|
+
FROM documents.process_data
|
|
14
|
+
JOIN documents.process_property_data ON process_data.uri = process_property_data.uri
|
|
15
|
+
)
|
|
16
|
+
WHERE (
|
|
17
|
+
(parser_version_string IS NULL) OR
|
|
18
|
+
(parser_major_version < @target_major_version) OR
|
|
19
|
+
(parser_major_version <= @target_major_version AND parser_minor_version < @target_minor_version)
|
|
20
|
+
)
|
|
21
|
+
AND (minutes_since_parse_request > 43200 OR minutes_since_parse_request IS NULL)",
|
|
22
|
+
"array",
|
|
23
|
+
map:new((
|
|
24
|
+
map:entry("target_major_version", $target_major_version),
|
|
25
|
+
map:entry("target_minor_version", $target_minor_version)
|
|
26
|
+
))
|
|
27
|
+
))
|
|
@@ -16,10 +16,11 @@ xdmp:to-json(xdmp:sql(
|
|
|
16
16
|
)
|
|
17
17
|
WHERE (
|
|
18
18
|
(parser_version_string IS NULL) OR
|
|
19
|
+
(parser_major_version < @target_major_version) OR
|
|
19
20
|
(parser_major_version <= @target_major_version AND parser_minor_version < @target_minor_version)
|
|
20
21
|
)
|
|
21
22
|
AND (minutes_since_parse_request > 43200 OR minutes_since_parse_request IS NULL)
|
|
22
|
-
ORDER BY parser_major_version ASC NULLS FIRST, parser_minor_version ASC
|
|
23
|
+
ORDER BY parser_major_version ASC NULLS FIRST, parser_minor_version ASC, minutes_since_parse_request DESC
|
|
23
24
|
LIMIT @maximum_records",
|
|
24
25
|
"array",
|
|
25
26
|
map:new((
|
|
@@ -28,4 +29,4 @@ xdmp:to-json(xdmp:sql(
|
|
|
28
29
|
map:entry("maximum_records", $maximum_records)
|
|
29
30
|
|
|
30
31
|
))
|
|
31
|
-
))
|
|
32
|
+
))
|
|
@@ -34,4 +34,4 @@ cts:search(doc($uri),
|
|
|
34
34
|
cts:element-query(xs:QName('uk:jurisdiction'),cts:and-query(()))))) then
|
|
35
35
|
if ($content = "") then local:delete($uri) else local:edit($uri, $content)
|
|
36
36
|
else
|
|
37
|
-
local:add($uri, $content)
|
|
37
|
+
if ($content != "") then local:add($uri, $content) else ()
|
|
@@ -17,27 +17,6 @@ let $xsl_path := fn:concat("judgments/xslts/", $xsl_filename)
|
|
|
17
17
|
|
|
18
18
|
let $params := map:map()
|
|
19
19
|
|
|
20
|
-
let $number_marks_xslt := (
|
|
21
|
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
22
|
-
version="2.0">
|
|
23
|
-
<xsl:output method="html" />
|
|
24
|
-
<xsl:template match="@*|node()">
|
|
25
|
-
<xsl:copy>
|
|
26
|
-
<xsl:apply-templates select="@*|node()"/>
|
|
27
|
-
</xsl:copy>
|
|
28
|
-
</xsl:template>
|
|
29
|
-
<xsl:template match="mark">
|
|
30
|
-
<xsl:copy>
|
|
31
|
-
<xsl:copy-of select="*" />
|
|
32
|
-
<xsl:attribute name="id">
|
|
33
|
-
<xsl:text>mark_</xsl:text>
|
|
34
|
-
<xsl:value-of select="count(preceding::mark)"/>
|
|
35
|
-
</xsl:attribute>
|
|
36
|
-
<xsl:apply-templates />
|
|
37
|
-
</xsl:copy>
|
|
38
|
-
</xsl:template>
|
|
39
|
-
</xsl:stylesheet>
|
|
40
|
-
)
|
|
41
20
|
(: change the image-base of the document to match the location of the assets in $image_base
|
|
42
21
|
so that references to images point to the correct places on the internet :)
|
|
43
22
|
let $_put := map:put(
|
|
@@ -59,13 +38,10 @@ let $retrieved_value := if (xs:boolean($is_published) or $show_unpublished) then
|
|
|
59
38
|
()
|
|
60
39
|
|
|
61
40
|
let $return_value := if($query) then
|
|
62
|
-
|
|
63
|
-
$
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
helper:make-q-query($query),
|
|
67
|
-
<mark>{$cts:text}</mark>
|
|
68
|
-
)
|
|
41
|
+
cts:highlight(
|
|
42
|
+
$retrieved_value,
|
|
43
|
+
helper:make-q-query($query),
|
|
44
|
+
<mark>{$cts:text}</mark>
|
|
69
45
|
)
|
|
70
46
|
else
|
|
71
47
|
$retrieved_value
|
|
@@ -105,8 +105,14 @@ class GetPendingEnrichmentForVersionDict(MarkLogicAPIDict):
|
|
|
105
105
|
target_parser_minor_version: int
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
#
|
|
109
|
-
class
|
|
108
|
+
# get_pending_parse_for_version_count.xqy
|
|
109
|
+
class GetPendingParseForVersionCountDict(MarkLogicAPIDict):
|
|
110
|
+
target_major_version: int
|
|
111
|
+
target_minor_version: int
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
# get_pending_parse_for_version_documents.xqy
|
|
115
|
+
class GetPendingParseForVersionDocumentsDict(MarkLogicAPIDict):
|
|
110
116
|
maximum_records: Optional[int]
|
|
111
117
|
target_major_version: int
|
|
112
118
|
target_minor_version: int
|
ds_caselaw_marklogic_api_client-43.1.0/src/caselawclient/xquery/check_content_hash_unique_by_uri.xqy
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
xquery version "1.0-ml";
|
|
2
|
-
declare namespace akn = "http://docs.oasis-open.org/legaldocml/ns/akn/3.0";
|
|
3
|
-
declare namespace uk = "https://caselaw.nationalarchives.gov.uk/akn";
|
|
4
|
-
declare variable $uri as xs:string external;
|
|
5
|
-
|
|
6
|
-
let $doc := doc($uri)
|
|
7
|
-
let $hash := $doc//uk:hash/text()
|
|
8
|
-
let $count := count(cts:uris(
|
|
9
|
-
(), (),
|
|
10
|
-
cts:and-query((
|
|
11
|
-
cts:element-value-query(xs:QName("uk:hash"), $hash),
|
|
12
|
-
cts:collection-query("http://marklogic.com/collections/dls/latest-version")
|
|
13
|
-
))
|
|
14
|
-
))
|
|
15
|
-
return $count = 1
|
{ds_caselaw_marklogic_api_client-43.1.0 → ds_caselaw_marklogic_api_client-44.4.1}/LICENSE.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|