R2RML 是否适用于 EAV 表?

Is R2RML suitable for EAV tables?

开始阅读 R2RML 我想知道这种语言是否也适用于 table 映射数据库 table 遵循 entity-attribute-value 模型到 RDF 以及一个简单示例的样子。

RDB 到 RDF 转换方法的调查和 tools 指的是“1 table 到 n 类” 特征如下:

Ability to use the values of a column as a categorization pattern: tuples of the table will be translated into instances of different ontological classes based on the value of this attribute. This feature can be seen as an extension of the "select conditions" feature as it results in not only filtering out rows, but the filter helps selecting rows to be converted into instance of one class or another.

一个简单的映射可能如下所示:

[
  rr:logicalTable [ rr:tableName "eav_table" ] ;
  rr:subjectMap [ rr:template "http://example.com/ontology.rdf#Entity/{entity_column}/" ] ;
  rr:predicateObjectMap [
    rr:predicateMap [
      rr:template "http://example.com/ontology.rdf#{attribute_column}"
    ] ;
    rr:objectMap [
      rr:template "http://example.com/ontology.rdf#Value/{value_column}/"
    ]
  ]
] .

如果需要更复杂的 SQL 语句,可以使用 rr:sqlQuery 而不是 rr:tableName:

  rr:logicalTable [
    rr:sqlQuery "SELECT entity_column, attribute_column, value_column FROM eav_table;"
  ] ;

对于可用属性集,相应的谓词可以通过附加映射进一步表征。