I have developed an ontology which you can access with the link exist in the code below. The code working fine except FILTER section. If I use equal operator in FILTER, it does not return anything. If I use not equal operator (!=), it does not filter anything. I guess my reference for Brands class in my ontology with "owl:Brands" is not working. I shortened url, because I don't want it to be indexed by web crawlers. I am using original URL in the code. You can access original url with the shortened one. You can browse the ontology by an editor. I am pretty sure that "owl:Brands" is not working, I tried many other possibilities but could not figure out how to make it work.
Without FILTER statement, it works equal to "FILTER(?sub!=owl:Brands)", because there is nothing matching with owl:Brands. FYI, I am using python and rdflib.
plugin.register(
'sparql', rdflib.query.Processor,
'rdfextras.sparql.processor', 'Processor')
plugin.register(
'sparql', rdflib.query.Result,
'rdfextras.sparql.query', 'SPARQLQueryResult')
qres = g.query(
"""
PREFIX owl: <http://goo.gl/ZwwgT>
SELECT ?class WHERE { ?sub rdfs:subClassOf ?class .
FILTER(?sub=owl:Brands)}
""")
for row in qres.result:
print(row)