Filter the gremlin results

This question is not regarding stardog but gremlin.

I am new to Gremlin and I am using Gremlin 3.0.2 with Stardog 5.0. I wrote this query to find out paths between two entities in schema.org ontology. Below is the output -

gremlin>g.V().hasLabel(‘Canal’).repeat(both().simplePath()).until(g.V().hasLabel(‘Continent’)).path().limit(5)

==>[v[Canal], v[rdf-schema#Class]]
==>[v[Canal], v[BodyOfWater], v[Landform], v[Continent]]
==>[v[Canal], v[BodyOfWater], v[rdf-schema#Class], v[Continent]]
==>[v[Canal], v[BodyOfWater], v[Pond], v[rdf-schema#Class], v[Continent]]
==>[v[Canal], v[BodyOfWater], v[OceanBodyOfWater], v[rdf-schema#Class], v[Continent]]

I am unable to figure out a way to eliminate all the paths that has “rdf-schema#Class” in them. Please could someone suggest a solution? I want to do the filtering using Gremlin. Thanks!

Hi, this question should be asked on the Gremlin support forums, as it is unrelated to Stardog. Thanks!