public <S> GraphTraversal<S,?> sparql(final String query) {
        final SparqlTraversalSource clone = this.withStrategies(SparqlStrategy.instance()).clone();

        // the inject() holds the sparql which the SparqlStrategy then detects and converts to a traversal
        clone.gremlinLang.addStep(GraphTraversal.Symbols.inject, query);
        final GraphTraversal.Admin<S, S> traversal = new DefaultGraphTraversal(clone);
        return traversal.addStep(new InjectStep<>(traversal, query));
    }
The start step for a SPARQL based traversal that accepts a string representation of the query to execute.
sparql-gremlin/src/main/java/org/apache/tinkerpop/gremlin/sparql/process/traversal/dsl/sparql/SparqlTraversalSource.java