PREFIX ed: <http://ggen.io/ontology/editor#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

# Query: Find all code smells detected in files
SELECT ?smell ?type ?severity ?file ?line
WHERE {
  ?operation a ed:EditOperation ;
             ed:detectsSmell ?smell ;
             ed:targetFile ?file ;
             ed:lineNumber ?line .

  ?smell a ?type ;
         ed:severity ?severity .

  FILTER(?type != ed:CodeSmell)
}
ORDER BY DESC(?severity) ?file ?line
