ds-caselaw-marklogic-api-client 18.0.0__py3-none-any.whl → 19.0.0__py3-none-any.whl
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.
Potentially problematic release.
This version of ds-caselaw-marklogic-api-client might be problematic. Click here for more details.
- caselawclient/Client.py +19 -1
- caselawclient/models/documents.py +6 -1
- caselawclient/xquery/get_pending_enrichment_for_version.xqy +18 -0
- caselawclient/xquery_type_dicts.py +5 -0
- {ds_caselaw_marklogic_api_client-18.0.0.dist-info → ds_caselaw_marklogic_api_client-19.0.0.dist-info}/METADATA +1 -1
- {ds_caselaw_marklogic_api_client-18.0.0.dist-info → ds_caselaw_marklogic_api_client-19.0.0.dist-info}/RECORD +8 -7
- {ds_caselaw_marklogic_api_client-18.0.0.dist-info → ds_caselaw_marklogic_api_client-19.0.0.dist-info}/LICENSE.md +0 -0
- {ds_caselaw_marklogic_api_client-18.0.0.dist-info → ds_caselaw_marklogic_api_client-19.0.0.dist-info}/WHEEL +0 -0
caselawclient/Client.py
CHANGED
|
@@ -795,7 +795,7 @@ class MarklogicApiClient:
|
|
|
795
795
|
return content == "true"
|
|
796
796
|
|
|
797
797
|
def set_published(
|
|
798
|
-
self, judgment_uri: DocumentURIString, published: bool
|
|
798
|
+
self, judgment_uri: DocumentURIString, published: bool
|
|
799
799
|
) -> requests.Response:
|
|
800
800
|
return self.set_boolean_property(judgment_uri, "published", published)
|
|
801
801
|
|
|
@@ -951,3 +951,21 @@ class MarklogicApiClient:
|
|
|
951
951
|
)
|
|
952
952
|
|
|
953
953
|
return results
|
|
954
|
+
|
|
955
|
+
def get_pending_enrichment_for_version(
|
|
956
|
+
self, target_version: int
|
|
957
|
+
) -> list[list[Any]]:
|
|
958
|
+
"""Retrieve documents which are not yet enriched with a given version."""
|
|
959
|
+
vars: query_dicts.GetPendingEnrichmentForVersionDict = {
|
|
960
|
+
"target_version": target_version
|
|
961
|
+
}
|
|
962
|
+
results: list[list[Any]] = json.loads(
|
|
963
|
+
get_single_string_from_marklogic_response(
|
|
964
|
+
self._send_to_eval(
|
|
965
|
+
vars,
|
|
966
|
+
"get_pending_enrichment_for_version.xqy",
|
|
967
|
+
)
|
|
968
|
+
)
|
|
969
|
+
)
|
|
970
|
+
|
|
971
|
+
return results
|
|
@@ -458,8 +458,13 @@ class Document:
|
|
|
458
458
|
|
|
459
459
|
def enrich(self) -> None:
|
|
460
460
|
"""
|
|
461
|
-
|
|
461
|
+
Request enrichment of the document
|
|
462
462
|
"""
|
|
463
|
+
|
|
464
|
+
self.api_client.set_property(
|
|
465
|
+
self.uri, "last_sent_to_enrichment", datetime.datetime.now().isoformat()
|
|
466
|
+
)
|
|
467
|
+
|
|
463
468
|
announce_document_event(
|
|
464
469
|
uri=self.uri,
|
|
465
470
|
status="enrich",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
xquery version "1.0-ml";
|
|
2
|
+
|
|
3
|
+
declare variable $target_version as xs:int external;
|
|
4
|
+
|
|
5
|
+
xdmp:to-json(xdmp:sql(
|
|
6
|
+
"SELECT process_data.uri, enrich_version_string, minutes_since_enrichment_request
|
|
7
|
+
FROM (
|
|
8
|
+
SELECT process_data.uri, enrich_version_string, enrich_major_version, DATEDIFF('minute', last_sent_to_enrichment, CURRENT_TIMESTAMP) AS minutes_since_enrichment_request
|
|
9
|
+
FROM documents.process_data
|
|
10
|
+
JOIN documents.process_property_data ON process_data.uri = process_property_data.uri
|
|
11
|
+
)
|
|
12
|
+
WHERE ((enrich_version_string IS NULL) OR (enrich_major_version < @target_version))
|
|
13
|
+
AND (minutes_since_enrichment_request > 43200 OR minutes_since_enrichment_request IS NULL)
|
|
14
|
+
ORDER BY enrich_major_version ASC NULLS FIRST",
|
|
15
|
+
"array",
|
|
16
|
+
map:new(map:entry("target_version", $target_version))
|
|
17
|
+
))
|
|
18
|
+
|
|
@@ -78,6 +78,11 @@ class GetLastModifiedDict(MarkLogicAPIDict):
|
|
|
78
78
|
uri: MarkLogicDocumentURIString
|
|
79
79
|
|
|
80
80
|
|
|
81
|
+
# get_pending_enrichment_for_version.xqy
|
|
82
|
+
class GetPendingEnrichmentForVersionDict(MarkLogicAPIDict):
|
|
83
|
+
target_version: int
|
|
84
|
+
|
|
85
|
+
|
|
81
86
|
# get_properties_for_search_results.xqy
|
|
82
87
|
class GetPropertiesForSearchResultsDict(MarkLogicAPIDict):
|
|
83
88
|
uris: list[Any]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ds-caselaw-marklogic-api-client
|
|
3
|
-
Version:
|
|
3
|
+
Version: 19.0.0
|
|
4
4
|
Summary: An API client for interacting with the underlying data in Find Caselaw.
|
|
5
5
|
Home-page: https://github.com/nationalarchives/ds-caselaw-custom-api-client
|
|
6
6
|
Keywords: national archives,caselaw
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
caselawclient/Client.py,sha256=
|
|
1
|
+
caselawclient/Client.py,sha256=ta7VC6xxC9zLmcZvjcf-V8HonvC60G4WMfppYctXKq0,35180
|
|
2
2
|
caselawclient/__init__.py,sha256=DY-caubLDQWWingSdsBWgovDNXh8KcnkI6kwz08eIFk,612
|
|
3
3
|
caselawclient/client_helpers/__init__.py,sha256=6vUjIwi777iaNDBUYwWmpzgAXeFHeXnmmMBniVmjUP8,3830
|
|
4
4
|
caselawclient/client_helpers/search_helpers.py,sha256=DYgUltPq8fFI2KkLRqH1-8zpbb8_swBFyBvvgBbinig,1514
|
|
5
5
|
caselawclient/content_hash.py,sha256=DF7ujrQPNf1bTSbK0mIIaC5qx6CmF5I0xlQ7uIG0zYI,2236
|
|
6
6
|
caselawclient/errors.py,sha256=3rsbOQ11hIhm7-UABcHNMcs9XgcrIzytAP0koyZBLWM,3195
|
|
7
7
|
caselawclient/models/__init__.py,sha256=kd23EUpvaC7aLHdgk8farqKAQEx3lf7RvNT2jEatvlg,68
|
|
8
|
-
caselawclient/models/documents.py,sha256=
|
|
8
|
+
caselawclient/models/documents.py,sha256=gZGXBBzuTQdOAiQ86yn_v91ycUisMEAAa5lQvz821j0,19542
|
|
9
9
|
caselawclient/models/judgments.py,sha256=TcAsn27K--QQAfaaUZ8biybB9OeVS__91FRlwaG16HY,1020
|
|
10
10
|
caselawclient/models/neutral_citation_mixin.py,sha256=qqB1K4IHVy0XvdY40sfVywZ6VGaZ9ojHcVOQRyi0Vhc,1752
|
|
11
11
|
caselawclient/models/press_summaries.py,sha256=5c1jpVhVtmIMN8AeHMywGXvz4H55kKAIUaaaVims6Tw,994
|
|
@@ -32,6 +32,7 @@ caselawclient/xquery/get_judgment.xqy,sha256=xg66A1xslgwds670gu_9DFcOmxYGoo8sA2E
|
|
|
32
32
|
caselawclient/xquery/get_judgment_checkout_status.xqy,sha256=mdY9UXLyzQdB7byEERPqentlr0YDLbXRVqH0h4UuZTQ,193
|
|
33
33
|
caselawclient/xquery/get_judgment_version.xqy,sha256=wF9k9-CBrqo8VbxxyTrD-AGzR3-3jMm25tRVCjxPLrU,292
|
|
34
34
|
caselawclient/xquery/get_last_modified.xqy,sha256=8fCm_7o_kkytCEmEeSTLWzLP7iOjuPV01IfHDgf6HaQ,172
|
|
35
|
+
caselawclient/xquery/get_pending_enrichment_for_version.xqy,sha256=z4_I9qdPJOi03zWpkWNb5uHWchco-tl9i9S_6UmQMiU,794
|
|
35
36
|
caselawclient/xquery/get_properties_for_search_results.xqy,sha256=Tlv3EKwVV_q-JyQyhjWVHIleicPDpucxP4ScuQjpgSw,625
|
|
36
37
|
caselawclient/xquery/get_property.xqy,sha256=RHlOTrK0aH-S7s_ykYzGmUeKOJxXlI4vE5sKRt556NY,209
|
|
37
38
|
caselawclient/xquery/get_version_annotation.xqy,sha256=pFDMGA9SxI59iUPaoAeUsq23kUp4Op7cUg-PFNFqxcI,262
|
|
@@ -52,8 +53,8 @@ caselawclient/xquery/user_has_role.xqy,sha256=52YuFZnXqaDDJs-j_UanpqcLNEiw_m9xb0
|
|
|
52
53
|
caselawclient/xquery/validate_all_documents.xqy,sha256=z_0YEXmRcZ-FaJM0ouKiTjdI4tLKQ4FTssRihR07qFk,156
|
|
53
54
|
caselawclient/xquery/xslt.xqy,sha256=w57wNijH3dkwHkpKeAxqjlghVflQwo8cq6jS_sm-erM,199
|
|
54
55
|
caselawclient/xquery/xslt_transform.xqy,sha256=smyFFxqmtkuOzBd2l7uw6K2oAsYctudrP8omdv_XNAM,2463
|
|
55
|
-
caselawclient/xquery_type_dicts.py,sha256=
|
|
56
|
-
ds_caselaw_marklogic_api_client-
|
|
57
|
-
ds_caselaw_marklogic_api_client-
|
|
58
|
-
ds_caselaw_marklogic_api_client-
|
|
59
|
-
ds_caselaw_marklogic_api_client-
|
|
56
|
+
caselawclient/xquery_type_dicts.py,sha256=F2kXvXuLUzBK0ZQqZfvYean9WftlNQcLaQj1hfAHNa0,4853
|
|
57
|
+
ds_caselaw_marklogic_api_client-19.0.0.dist-info/LICENSE.md,sha256=fGMzyyLuQW-IAXUeDSCrRdsYW536aEWThdbpCjo6ZKg,1108
|
|
58
|
+
ds_caselaw_marklogic_api_client-19.0.0.dist-info/METADATA,sha256=S7gaZixMqntVtAPgBDMcKfSEgTHEs2ZYWP-Tkl36FiU,4006
|
|
59
|
+
ds_caselaw_marklogic_api_client-19.0.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
|
60
|
+
ds_caselaw_marklogic_api_client-19.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|