【问题标题】:GraphDB Lucene connector: indexing rdfs:label values of a single languageGraphDB Lucene 连接器:索引 rdfs:单一语言的标签值
【发布时间】:2021-06-09 23:22:10
【问题描述】:

我将提出一个关于 GraphDB Lucene 连接器中的索引的问题。

在多语言 rdf 资源的上下文中,如何索引单一语言(例如英语)的 rdfs:label 值?

我试过这个:

PREFIX inst: <http://www.ontotext.com/connectors/lucene/instance#>
PREFIX : <http://www.ontotext.com/connectors/lucene#>

INSERT DATA {
     inst:lexicalEntryIndex :createConnector '''
 {
   "types": [
     "http://www.w3.org/ns/lemon/ontolex#LexicalEntry"
   ],
   "fields": [
     {
         "fieldName": "type",
         "propertyChain": [
           "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
           "http://www.w3.org/2000/01/rdf-schema#label"
         ],
         "languages": [
           "en"
         ]
     }
   ]
 }
 ''' .
 }

所有语言都已编入索引。

提前致谢, 安德烈亚

【问题讨论】:

    标签: lucene graphdb


    【解决方案1】:

    GraphDB Lucene Connector documentation 清楚地展示了如何为单一语言编制索引。

    这里是一个示例 sn-p 怎么做:

    PREFIX luc: <http://www.ontotext.com/connectors/lucene#>
    PREFIX luc-index: <http://www.ontotext.com/connectors/lucene/instance#>
    
    INSERT DATA {
      luc-index:my_index luc:createConnector '''
        {
          "types": ["http://www.ontotext.com/example#gadget"],
          "fields": [
             {
               "fieldName": "name",
               "propertyChain": [
                 "http://www.ontotext.com/example#name"
               ]
             },
             {
               "fieldName": "nameLanguage",
               "propertyChain": [
                 "http://www.ontotext.com/example#name",
                 "lang()"
               ]
             }
          ], "entityFilter":"?nameLanguage in (\\"en\\")"
        }
      ''' .
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-13
      • 1970-01-01
      • 2012-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多