问题
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