Realizing and Retrieving information from a producer-consumer OWL model

Solution 1:

Negations are possible in SPARQL using the NOT BOUND filter or more easily in SPARQL 1.1 using MINUS:

SELECT ?resource WHERE
{
  ?resource a :Resource.

  ?consumer a :Consumer;
    ?consumer :consumesResource ?resource.

 MINUS {?producer a :Producer; :producesResource ?resource.}
}

You can also use ASK to get a boolean result but SELECT allows easier debugging to verify if your query is working correctly.

As SHACL allows integrating SPARQL queries, this answers your second question too but in that case it is easier to just use the SPARQL query on its own.