Class not displayed in GraphDB

好久不见. 提交于 2021-01-29 07:44:36

问题


I have the following class:

:Foo rdf:type owl:Class ;
           rdfs:subClassOf [ rdf:type owl:Restriction ;
                             owl:onProperty :hasId ;
                             owl:someValuesFrom rdfs:Literal
                           ] .

Strangely, that does not appear in the Class hierarchy tab of Ontotext's GraphDB.

Is there any specific reason?


回答1:


Is there any specific reason?

From 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)

Note isURI(?parent), whereas […] is a blank node.



来源:https://stackoverflow.com/questions/57360949/class-not-displayed-in-graphdb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!