[英]extract elasticsearch date from a <start-date>/<duration> XBRL-JSON format
I am storing XBRL JSON using elasticsearch.我正在使用 elasticsearch 存储 XBRL JSON。
This xBRL-JSON OIM spec describes the oim:period
property: 这个 xBRL-JSON OIM 规范描述了
oim:period
属性:
Otherwise, an ISO 8601 time interval representing the {interval} property, expressed in one of the following forms:
否则,表示 {interval} 属性的 ISO 8601 时间间隔,以下列形式之一表示:
<start>/<end>
<开始>/<结束>
<start>/<duration>
<开始>/<持续时间>
<duration>/<end>
<持续时间>/<结束>
Where <start> and <end> are valid according to the xsd:dateTime datatype, and <duration> is valid according to xsd:duration.
其中 <start> 和 <end> 根据 xsd:dateTime 数据类型有效,<duration> 根据 xsd:duration 有效。
Examples from arelle's plugin look like this:来自areelle 插件的示例如下所示:
I notice that arelle's plugin exclusively produces this format:我注意到 arelle 的插件专门生成这种格式:
My question我的问题
Is there a way to save at least the <start>
part as a date type in elasticsearch?有没有办法至少将
<start>
部分保存为 elasticsearch 中的日期类型?
Ideas I had:我的想法:
elastichsearch only (my preference)仅弹性搜索(我的偏好)
/<duration>
part, but ignores it/<duration>
部分但忽略它的自定义日期格式
PT0S
and P1Y
above)?PT0S
和P1Y
)?yyyy'/P'
will accept a value '2015/P'.yyyy'/P'
将接受值 '2015/P'。 However, the rest of the duration could be more dynamicP
? P
之后的所有可能的变化?/<duration>
part before saving only <start>
as datetime.<start>
保存为日期/<duration>
之前,使用字符过滤器去除/<duration>
部分。 But I don't know if character filters happen before saving as type: date./
, and at least the two parts will be saved as separate tokens./
上拆分,至少这两个部分将保存为单独的标记。 Can't use date math, though.copy_to
instead, but that seems to combine terms, and I want to break this term apartcopy_to
代替,但似乎方面结合起来,我想除了打破这个词 change my application (I prefer to use elasticsearch-only techniques if possible)更改我的应用程序(如果可能,我更喜欢使用仅使用 elasticsearch 的技术)
<start>
and <end>
parts, and saves both into separate fields;<start>
和<end>
部分,并将它们保存到单独的字段中;
PT0S
examples above);PT0S
示例); I guess I just use the same value for end
property as start
property... Not more awkward than a 0-length duration ( PT0S
) I guess.end
属性使用与start
属性相同的值......我猜不会比 0 长度持续时间( PT0S
)更尴尬。Not a direct answer, but it's worth noting that the latest internal drafts of the xBRL-JSON specification have moved away from the the single-field representation.不是直接的答案,但值得注意的是,xBRL-JSON 规范的最新内部草案已经脱离了单字段表示。 Although the "/" separated notation is an ISO standard, tool support for it appears to be extremely poor, and so the working group has chosen to switch to separate fields for start and end dates.
虽然“/”分隔符号是 ISO 标准,但对它的工具支持似乎非常差,因此工作组选择切换到单独的开始日期和结束日期字段。 I would expect Arelle support to follow suit in due course.
我希望 Arelle 支持在适当的时候效仿。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.