类未显示在GraphDB中

时间:2019-08-05 14:45:20

标签: rdf owl graphdb

我有以下课程:

datatable

奇怪的是,它没有出现在Ontotext的GraphDB的“类层次结构”选项卡中。

有什么具体原因吗?

1 个答案:

答案 0 :(得分:4)

  

有什么具体原因吗?

来自graphdb-framework-graph-explore-8.7.0.jar/dataviz-queries/getRdfClassHierarchy.sparql

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX sesame: <http://www.openrdf.org/schema/sesame#>

SELECT ?parent ?class ?count  {
    ?class sesame:directSubClassOf ?parent .
    FILTER (isURI(?parent) && isURI(?class)
        && !strstarts(str(?parent), "http://www.w3.org/2002/07/owl#")
        && !strstarts(str(?parent), "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
        && !strstarts(str(?parent), "http://www.w3.org/2000/01/rdf-schema#")
    ).
    {
        SELECT ?class (COUNT(*) as ?count) {
            ?s a ?class
        } GROUP BY ?class
    }
} ORDER BY DESC (?count)

请注意isURI(?parent),而[…] is a空白节点。