from rdflib import Graph # Load the RDF file g = Graph() g.parse("navipod.nt", format="nt") # Define the query query = ''' SELECT DISTINCT ?appname WHERE { ?s ?appname . ?s ?metric . FILTER regex(str(?metric), "jvm", "i") } ''' # Execute the query results = g.query(query) # Print the results for result in results: print(result[0])