# Filter the gremlin results

**URL:** https://community.stardog.com/t/filter-the-gremlin-results/343
**Category:** Support
**Created:** [May 23, 2017, 10:47am UTC](https://community.stardog.com/t/filter-the-gremlin-results/343 "2017-05-23T10:47:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sunilkumar](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@sunilkumar](https://community.stardog.com/u/sunilkumar)
#### Post date: [May 23, 2017, 10:47am UTC](https://community.stardog.com/t/filter-the-gremlin-results/343/1 "2017-05-23T10:47:26Z")

</div>

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](http://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!

---

<div class="post-metadata">

### Author: ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)
#### Post date: [May 23, 2017, 2:06pm UTC](https://community.stardog.com/t/filter-the-gremlin-results/343/2 "2017-05-23T14:06:41Z")

</div>

Hi, this question should be asked on the [Gremlin support forums](https://groups.google.com/forum/#!forum/gremlin-users), as it is unrelated to Stardog. Thanks!

---

<div class="post-metadata">

### Author: ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)
#### Post date: [May 23, 2017, 2:06pm UTC](https://community.stardog.com/t/filter-the-gremlin-results/343/3 "2017-05-23T14:06:49Z")

</div>


