Search code examples
rdfowlgraphdb

Class not displayed in GraphDB


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?


Solution

  • 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.