yes SPARQL is indeed possible. But in that case, I'd go the SPARQL 1.1 way:
|SELECT DISTINCT ?s||
||WHERE||
|| { ?s a owl:Class||
|| FILTER ( ! isBlank(?s) )||
|| FILTER ( ?s NOT IN (owl:Thing, owl:Nothing) )||
|| FILTER NOT EXISTS { ?s rdfs:subClassOf ?super||
||
Thanks Lorenz
I figured out the union thing too so I ended up using the below SPARQL
instead and it seems to work fine but would love to know what is the
equivalent using Jena API
"SELECT DISTINCT ?s WHERE { " +
"?s a owl:Class . " +
"FILTER (!isBlank(?s)) " +
"FILTER (?s
schema.org contains a bunch of anonymous classes like the union of other
classes which are used as domain or range of a property, that's why you
get null values because they do not have a URI. If you'd just call
|System.out.println(clazz);|
you'd see the blank node Ids.
Among all those blank
Hi I am trying to load schema.org ontology and get all top classes
using ontModel.listHierarchyRootClasses() but can't get the expected
results with different OntModelSpec.
If I use OWL_MEM, it lists 2500+ records with all the records have "null"
URI.
If I use OWL_DL_MEM, it lists 0 records
The