From abad44909559e31b12ec2b4fc126b91b4932a749 Mon Sep 17 00:00:00 2001 From: David McKee Date: Fri, 6 Dec 2024 15:26:12 +0000 Subject: [PATCH] Resolve identifier URIs to MarkLogic URIs --- src/caselawclient/xquery/resolve_from_identifier.xqy | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/caselawclient/xquery/resolve_from_identifier.xqy diff --git a/src/caselawclient/xquery/resolve_from_identifier.xqy b/src/caselawclient/xquery/resolve_from_identifier.xqy new file mode 100644 index 00000000..cc6b9bce --- /dev/null +++ b/src/caselawclient/xquery/resolve_from_identifier.xqy @@ -0,0 +1,12 @@ +xquery version "1.0-ml"; + +declare namespace xdmp="http://marklogic.com/xdmp"; +declare variable $uri as xs:string external; + +xdmp:sql( + "SELECT * from compiled_url_slugs WHERE documents.compiled_url_slugs.identifier_slug = @uri", + "array", + map:new(( + map:entry("uri", $uri) + )) +)