ds-caselaw-marklogic-api-client 28.2.0__tar.gz → 29.0.0__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-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/PKG-INFO +1 -1
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/pyproject.toml +1 -1
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/documents/__init__.py +11 -8
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/identifiers/__init__.py +32 -1
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/identifiers/fclid.py +2 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/identifiers/neutral_citation.py +2 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/judgments.py +10 -13
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/neutral_citation_mixin.py +8 -4
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/press_summaries.py +9 -12
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/LICENSE.md +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/README.md +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/Client.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/client_helpers/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/client_helpers/search_helpers.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/content_hash.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/errors.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/factories.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/identifier_resolution.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/documents/body.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/documents/exceptions.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/documents/statuses.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/documents/transforms/html.xsl +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/documents/xml.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/identifiers/unpacker.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/utilities/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/utilities/aws.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/utilities/dates.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/models/utilities/move.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/py.typed +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/responses/__init__.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/responses/search_response.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/responses/search_result.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/responses/xsl/search_match.xsl +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/search_parameters.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xml_helpers.py +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/break_judgment_checkout.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/checkin_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/checkout_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/copy_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/delete_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/document_collections.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/document_exists.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_combined_stats_table.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_components_for_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_highest_enrichment_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_highest_parser_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_judgment_checkout_status.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_judgment_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_last_modified.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_next_document_sequence_number.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_pending_enrichment_for_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_pending_parse_for_version.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_properties_for_search_results.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_property.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_property_as_node.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_recently_enriched.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_recently_parsed.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_version_annotation.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/get_version_created.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/insert_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/list_judgment_versions.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/resolve_from_identifier.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_boolean_property.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_metadata_citation.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_metadata_court.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_metadata_jurisdiction.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_metadata_name.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_metadata_this_uri.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_metadata_work_expression_date.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_property.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/set_property_as_node.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/update_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/update_locked_judgment.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/user_has_privilege.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/user_has_role.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/validate_all_documents.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/validate_document.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/xslt.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery/xslt_transform.xqy +0 -0
- {ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/src/caselawclient/xquery_type_dicts.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ds-caselaw-marklogic-api-client
|
|
3
|
-
Version:
|
|
3
|
+
Version: 29.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
|
{ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/pyproject.toml
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "ds-caselaw-marklogic-api-client"
|
|
3
|
-
version = "
|
|
3
|
+
version = "29.0.0"
|
|
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"
|
|
@@ -15,6 +15,7 @@ from caselawclient.errors import (
|
|
|
15
15
|
NotSupportedOnVersion,
|
|
16
16
|
OnlySupportedOnVersion,
|
|
17
17
|
)
|
|
18
|
+
from caselawclient.models.identifiers import Identifier
|
|
18
19
|
from caselawclient.models.identifiers.fclid import FindCaseLawIdentifier, FindCaseLawIdentifierSchema
|
|
19
20
|
from caselawclient.models.identifiers.unpacker import unpack_all_identifiers_from_etree
|
|
20
21
|
from caselawclient.models.utilities import VersionsDict, extract_version, render_versions
|
|
@@ -171,13 +172,11 @@ class Document:
|
|
|
171
172
|
self.identifiers = unpack_all_identifiers_from_etree(identifiers_element_as_etree)
|
|
172
173
|
|
|
173
174
|
@property
|
|
174
|
-
def best_human_identifier(self) -> Optional[
|
|
175
|
-
"""
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Should typically be overridden in subclasses.
|
|
180
|
-
"""
|
|
175
|
+
def best_human_identifier(self) -> Optional[Identifier]:
|
|
176
|
+
"""Return the preferred identifier for the document, providing that it is considered human readable."""
|
|
177
|
+
preferred_identifier = self.identifiers.preferred()
|
|
178
|
+
if preferred_identifier and preferred_identifier.schema.human_readable:
|
|
179
|
+
return preferred_identifier
|
|
181
180
|
return None
|
|
182
181
|
|
|
183
182
|
@property
|
|
@@ -507,13 +506,17 @@ class Document:
|
|
|
507
506
|
"documentType": parser_type_noun,
|
|
508
507
|
"metadata": {
|
|
509
508
|
"name": self.body.name or None,
|
|
510
|
-
"cite":
|
|
509
|
+
"cite": None,
|
|
511
510
|
"court": self.body.court or None,
|
|
512
511
|
"date": checked_date,
|
|
513
512
|
"uri": self.uri,
|
|
514
513
|
},
|
|
515
514
|
}
|
|
516
515
|
|
|
516
|
+
## TODO: Remove this hack around the fact that NCNs are assumed to be present for all documents' metadata, but actually different document classes may have different metadata
|
|
517
|
+
if hasattr(self, "neutral_citation"):
|
|
518
|
+
parser_instructions["metadata"]["cite"] = self.neutral_citation
|
|
519
|
+
|
|
517
520
|
request_parse(
|
|
518
521
|
uri=self.uri,
|
|
519
522
|
reference=self.consignment_reference,
|
|
@@ -32,13 +32,20 @@ class IdentifierSchema(ABC):
|
|
|
32
32
|
name: str
|
|
33
33
|
namespace: str
|
|
34
34
|
|
|
35
|
+
human_readable: bool
|
|
36
|
+
""" Should this identifier type be considered for display as a 'human readable' identifier? """
|
|
37
|
+
|
|
38
|
+
base_score_multiplier: float = 1.0
|
|
39
|
+
""" A multiplier used to adjust the relative ranking of this identifier when calculating preferred identifiers. """
|
|
40
|
+
|
|
35
41
|
def __init_subclass__(cls: type["IdentifierSchema"], **kwargs: Any) -> None:
|
|
36
42
|
"""Ensure that subclasses have the required attributes set."""
|
|
37
43
|
for required in (
|
|
38
44
|
"name",
|
|
39
45
|
"namespace",
|
|
46
|
+
"human_readable",
|
|
40
47
|
):
|
|
41
|
-
if not
|
|
48
|
+
if not hasattr(cls, required):
|
|
42
49
|
raise NotImplementedError(f"Can't instantiate IdentifierSchema without {required} attribute.")
|
|
43
50
|
super().__init_subclass__(**kwargs)
|
|
44
51
|
|
|
@@ -101,6 +108,11 @@ class Identifier(ABC):
|
|
|
101
108
|
def url_slug(self) -> str:
|
|
102
109
|
return self.schema.compile_identifier_url_slug(self.value)
|
|
103
110
|
|
|
111
|
+
@property
|
|
112
|
+
def score(self) -> float:
|
|
113
|
+
"""Return the score of this identifier, used to calculate the preferred identifier for a document."""
|
|
114
|
+
return 1 * self.schema.base_score_multiplier
|
|
115
|
+
|
|
104
116
|
def same_as(self, other: "Identifier") -> bool:
|
|
105
117
|
"Is this the same as another identifier (in value and schema)?"
|
|
106
118
|
return self.value == other.value and self.schema == other.schema
|
|
@@ -149,3 +161,22 @@ class Identifiers(dict[str, Identifier]):
|
|
|
149
161
|
identifiers_root.append(identifier.as_xml_tree)
|
|
150
162
|
|
|
151
163
|
return identifiers_root
|
|
164
|
+
|
|
165
|
+
def by_score(self, type: Optional[type[Identifier]] = None) -> list[Identifier]:
|
|
166
|
+
"""
|
|
167
|
+
:param type: Optionally, an identifier type to constrain this list to.
|
|
168
|
+
|
|
169
|
+
:return: Return a list of identifiers, sorted by their score in descending order.
|
|
170
|
+
"""
|
|
171
|
+
identifiers = self.of_type(type) if type else list(self.values())
|
|
172
|
+
return sorted(identifiers, key=lambda v: v.score, reverse=True)
|
|
173
|
+
|
|
174
|
+
def preferred(self, type: Optional[type[Identifier]] = None) -> Optional[Identifier]:
|
|
175
|
+
"""
|
|
176
|
+
:param type: Optionally, an identifier type to constrain the results to.
|
|
177
|
+
|
|
178
|
+
:return: Return the highest scoring identifier of the given type (or of any type, if none is specified). Returns `None` if no identifier is available.
|
|
179
|
+
"""
|
|
180
|
+
if len(self) == 0:
|
|
181
|
+
return None
|
|
182
|
+
return self.by_score(type)[0]
|
|
@@ -25,20 +25,17 @@ class Judgment(NeutralCitationMixin, Document):
|
|
|
25
25
|
super().__init__(self.document_noun, uri, *args, **kwargs)
|
|
26
26
|
|
|
27
27
|
@cached_property
|
|
28
|
-
def neutral_citation(self) -> NeutralCitationString:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
)
|
|
28
|
+
def neutral_citation(self) -> Optional[NeutralCitationString]:
|
|
29
|
+
value_in_xml = self.body.get_xpath_match_string(
|
|
30
|
+
"/akn:akomaNtoso/akn:*/akn:meta/akn:proprietary/uk:cite/text()",
|
|
31
|
+
{
|
|
32
|
+
"uk": "https://caselaw.nationalarchives.gov.uk/akn",
|
|
33
|
+
"akn": "http://docs.oasis-open.org/legaldocml/ns/akn/3.0",
|
|
34
|
+
},
|
|
37
35
|
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return self.neutral_citation
|
|
36
|
+
if value_in_xml:
|
|
37
|
+
return NeutralCitationString(value_in_xml)
|
|
38
|
+
return None
|
|
42
39
|
|
|
43
40
|
@cached_property
|
|
44
41
|
def linked_document(self) -> Optional["PressSummary"]:
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
2
|
from functools import cached_property
|
|
3
|
-
from typing import Any
|
|
3
|
+
from typing import Any, Optional
|
|
4
4
|
|
|
5
5
|
from ds_caselaw_utils import neutral_url
|
|
6
6
|
from ds_caselaw_utils.types import NeutralCitationString
|
|
7
|
+
from typing_extensions import deprecated
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class NeutralCitationMixin(ABC):
|
|
@@ -38,12 +39,15 @@ class NeutralCitationMixin(ABC):
|
|
|
38
39
|
|
|
39
40
|
@cached_property
|
|
40
41
|
@abstractmethod
|
|
41
|
-
|
|
42
|
+
@deprecated("Legacy usage of NCNs is deprecated; you should be moving to the Identifiers framework")
|
|
43
|
+
def neutral_citation(self) -> Optional[NeutralCitationString]: ...
|
|
42
44
|
|
|
43
45
|
@cached_property
|
|
46
|
+
@deprecated("Legacy usage of NCNs is deprecated; you should be moving to the Identifiers framework")
|
|
44
47
|
def has_ncn(self) -> bool:
|
|
45
|
-
return
|
|
48
|
+
return self.neutral_citation is not None and self.neutral_citation != ""
|
|
46
49
|
|
|
47
50
|
@cached_property
|
|
51
|
+
@deprecated("Legacy usage of NCNs is deprecated; you should be moving to the Identifiers framework")
|
|
48
52
|
def has_valid_ncn(self) -> bool:
|
|
49
|
-
return self.
|
|
53
|
+
return self.neutral_citation is not None and neutral_url(self.neutral_citation) is not None
|
|
@@ -27,19 +27,16 @@ class PressSummary(NeutralCitationMixin, Document):
|
|
|
27
27
|
super().__init__(self.document_noun, uri, *args, **kwargs)
|
|
28
28
|
|
|
29
29
|
@cached_property
|
|
30
|
-
def neutral_citation(self) -> NeutralCitationString:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
)
|
|
30
|
+
def neutral_citation(self) -> Optional[NeutralCitationString]:
|
|
31
|
+
value_in_xml = self.body.get_xpath_match_string(
|
|
32
|
+
"/akn:akomaNtoso/akn:doc/akn:preface/akn:p/akn:neutralCitation/text()",
|
|
33
|
+
{
|
|
34
|
+
"akn": "http://docs.oasis-open.org/legaldocml/ns/akn/3.0",
|
|
35
|
+
},
|
|
38
36
|
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return self.neutral_citation
|
|
37
|
+
if value_in_xml:
|
|
38
|
+
return NeutralCitationString(value_in_xml)
|
|
39
|
+
return None
|
|
43
40
|
|
|
44
41
|
@cached_property
|
|
45
42
|
def linked_document(self) -> Optional[Judgment]:
|
{ds_caselaw_marklogic_api_client-28.2.0 → ds_caselaw_marklogic_api_client-29.0.0}/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
|