简体   繁体   English

搜索TinCan动词

[英]Search TinCan Verbs

Is it possible to filter/search for verbs containing some text in the ID using TinCan? 是否可以使用TinCan过滤/搜索ID中包含某些文本的动词?

Ie below I want to find all verbs that start with a particular ID in the URL? 即在下面,我想找到URL中以特定ID开头的所有动词?

Or do I have to download all of them and filter? 还是我必须全部下载并过滤?

lrs.queryStatements(
        {
            params: {
                verb: new TinCan.Verb(
                    {
                        id: "http://example.com/g*"
                    }
                ),
                since: "2016-01-05T08:34:16Z"
            },
            callback: function (err, sr) {
                if (err !== null) {
                    console.log("Failed to query statements: " + err);
                    // TODO: do something with error, didn't get statements
                    return;
                }

                if (sr.more !== null) {
                    // TODO: additional page(s) of statements should be fetched
                }
                console.log('query complete');
                console.log(sr);
                // TODO: do something with statements in sr.statements
            }
        }
    );

It isn't possible from the LRS' /statements resource. 从LRS的/statements资源中不可能。 That resource was never intended as a full query interface and the LRS isn't intended to be searched for direct reporting purposes. 该资源从来都不打算用作完整的查询界面,也不希望出于直接报告的目的搜索LRS。 It should be thought of more as a stream of data with limited filter capabilities to allow the stream to be manageable for specific long term use cases. 应该将其更多地视为具有有限过滤器功能的数据流,以允许该流对于特定的长期使用案例是可管理的。 So you can "filter" the stream on a specific single identifier, but you can't "search" the statements. 因此,您可以根据特定的单个标识符“过滤”流,但是不能“搜索”语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM