我正在使用MLCP(Marklogic内容泵)将内容从一个数据库复制到另一个数据库.在这个我使用-query_filter选项,它的值是一个cts:查询以XML序列化格式的一组cts:element-range-query包装在cts:and-query中:
<cts:and-query xmlns:cts="http://marklogic.com/cts">
<cts:element-range-query operator=">">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2000-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
<cts:element-range-query operator="<">
<cts:element xmlns:c="http://iddn.icis.com/ns/core">c:released-on</cts:element>
<cts:value xsi:type="xs:dateTime" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2016-12-21T00:00:00Z</cts:value>
</cts:element-range-query>
</cts:and-query>
Run Code Online (Sandbox Code Playgroud)
现在,上面的查询在ML Qconsole上执行时返回有效结果,但是当传入MLCP的-query_filter选项时,它会给出错误"无效属性值字符"<'.
Marklogic和MLCP的版本是8.0-5.
在进一步深入研究这个问题时,我发现只有当运算符值小于'<'时才会出现问题.
注意:我已在数据库中为"已启动"元素配置了有效的范围索引.
我有以下挑战.我们有想要使用mlcp加载到MarkLogic数据库的csv文件.我们还希望在加载期间将加载的行转换为OBI源,因此我们为此构建了转换函数.
现在我正在努力改造.如果没有转换,数据将按预期加载为每行doc.
csv示例:
voornaam,achternaam
hugo,koopmans
thijs,van ulden
Run Code Online (Sandbox Code Playgroud)
变换ambulance.xqy:
xquery version "1.0-ml";
module namespace rws = "http://marklogic.com/rws";
import module namespace source = "http://marklogic.com/solutions/obi/source" at "/ext/obi/lib/source-lib.xqy";
(: If the input document is XML, create an OBI source from it, with the value
: specified in the input parameter. If the input document is not
: XML, leave it as-is.
:)
declare function rws:transform(
$content as map:map,
$context as map:map
) as map:map*
{
let $attr-value :=
(map:get($context, "transform_param"), "UNDEFINED")[1]
let $the-doc := …Run Code Online (Sandbox Code Playgroud) 我有一个JSON"聚合"文件,我希望使用mlcp将多个文档拆分并摄取到MarkLogic中.
我的JSON文件看起来像这样:
{
"type": "FeatureCollection",
"features": [
{blobA}, {blobB}, {blobC} ......
]
}Run Code Online (Sandbox Code Playgroud)
...我希望通过MLCP运行此文件,以便每个文档包含数组中的项目.
即一个文档将包含{blobA},另一个文档将包含{blobB},另一个文档将包含{blobC} ....等等.
如何编写自定义.sjs转换模块?
我正在尝试导入文档集合,其中一些文件以下划线开头.似乎Marklogic mlcp 8.0.4正在静默地跳过这些文件,即使Marklogic本身似乎对这样的文件名没有问题.
这是我正在使用的mlcp命令:
mlcp-8.0-4/bin/mlcp.sh import -host localhost -port 8012 -username xxxxx -password xxxx -mode local -input_file_path/Users/test/Downloads/tempfolder33/-output_uri_replace"^.*tempfolder33,''"
其中mlcp一直忽略"/Users/test/Downloads/tempfolder33/schemas/bwb/_manifest.xml"等文件名.
有关如何解决此问题的任何想法?
mlcp 一定需要 XDBC 服务器还是它也可以与 HTTP 服务器一起使用?
我正在使用MarkLogic Content Pump来提取XML文档。我想使用“ -transform模块和-transform名称空间”选项在mlcp提取过程中转换这些xml文档。我已经为转换创建了XSLT,并将其加载到ML“模块”数据库中,但是mlcp不接受xslt文件并抛出错误:
命令:
mlcp.sh import \
-username $username -password $passwd \
-host $host -port $port \
-input_file_path $inpath \
-input_compressed true \
-input_file_type aggregates \
-aggregate_record_element $splittag \
-aggregate_uri_id $uriid \
-aggregate_record_namespace "http://www.fda.gov/cdrh/gudid" \
-output_collections $collection \
-output_permissions my-app-role,read,my-app-role,update \
-output_uri_suffix .xml \
-transform_module /marklogic.rest.transform/xml-transform-xsl/assets/transform.xsl \
-transform_namespace "http://marklogic.com/rest-api/transform/xml-transform-xsl" \
-transform_function transform
Run Code Online (Sandbox Code Playgroud)
下面的错误抛出ERROR:
15/09/27 15:34:19 WARN mapreduce.ContentWriter: XDMP-MODNOTTEXT: Module /marklogic.rest.transform/fda-transform-xsl/assets/transform.xsl is not a text document
Run Code Online (Sandbox Code Playgroud)
我想知道mlcp是否接受xslt转换?如果没有,那有什么选择呢?
MarkLogic在模块数据库中创建等效的xqy文件。通过在“ .xqy”文件下面调用,将引发参数不匹配错误:我认为这是由于错误的返回类型造成的:
xquery version "1.0-ml";
module namespace simple-xsl = "http://marklogic.com/rest-api/transform/simple-xsl";
import module namespace …Run Code Online (Sandbox Code Playgroud) CORB 和 MLCP MarkLogic 之间有什么区别吗?
我看到他们做同样的工作。你在什么情况下使用这个和那个?