No direct instances of ProductOrService are allowed, only instances of ActualProductoOrServiceInstance, ProductOrServiceModel, or ProductOrServicesSomeInstancesPlaceHolder.
Care must be taken that only instances of ActualProductoOrServiceInstance, ProductOrServiceModel, or ProductOrServicesSomeInstancesPlaceHolder exist in the model. ProductOrService is a generic absctrat class that must not be instanciated.
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix toy: <http://www.heppnetz.de/ontologies/examples/toy#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://www.heppnetz.de/ontologies/examples/gr> rdf:type owl:Ontology ;
owl:imports <http://www.heppnetz.de/ontologies/examples/toy> ,
<http://purl.org/goodrelations/v1> .
<http://www.heppnetz.de/ontologies/examples/gr#ProductOrService_1> rdf:type gr:ProductOrService
PREFIX gr:<http://purl.org/goodrelations/v1#>
SELECT ?object
WHERE
{
?object a gr:ProductOrService .
?object a ?class .
FILTER (?class != gr:ActualProductoOrServiceInstance &&
?class != gr:ProductOrServicesSomeInstancesPlaceHolder &&
?class != gr:ProductOrServiceModel)
}