<commit_before>package com.orientechnologies.orient.graph.gremlin;

import java.util.List;

import org.testng.annotations.Test;

import com.orientechnologies.orient.core.db.graph.OGraphDatabase;
import com.orientechnologies.orient.core.sql.OSQLEngine;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;
import com.orientechnologies.orient.graph.gremlin.OSQLFunctionGremlin;

public class SQLGremlinTest {
	@Test
	public void f() {
		OSQLEngine.getInstance().registerFunction(OSQLFunctionGremlin.NAME, OSQLFunctionGremlin.class);

		OGraphDatabase db = new OGraphDatabase("local:C:/temp/databases/gremlin");
		if (db.exists())
			db.open("admin", "admin");
		else
			db.create();

		// ODocument vertex1 = (ODocument) db.createVertex().field("label", "car").save();
		// ODocument vertex2 = (ODocument) db.createVertex().field("label", "pilot").save();
		// ODocument edge = (ODocument) db.createEdge(vertex1, vertex2).field("label", "drives").save();

		List<?> result = db.query(new OSQLSynchQuery<Object>(
				"select gremlin('current.out.in') as value from V where out.size() > 0 limit 3"));
		System.out.println("Result: " + result);

		result = db.query(new OSQLSynchQuery<Object>("select gremlin('current.out') as value from V"));
		System.out.println("Result: " + result);
<commit_msg>GraphDB: Fixed Gremlin test<commit_after>package com.orientechnologies.orient.graph.gremlin;

import java.util.List;

import org.testng.annotations.Test;

import com.orientechnologies.orient.core.db.graph.OGraphDatabase;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.sql.OSQLEngine;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;

public class SQLGremlinTest {
	@Test
	public void f() {
		OSQLEngine.getInstance().registerFunction(OSQLFunctionGremlin.NAME, OSQLFunctionGremlin.class);

		OGraphDatabase db = new OGraphDatabase("local:target/databases/gremlin");
		if (db.exists())
			db.open("admin", "admin");
		else
			db.create();

		ODocument vertex1 = (ODocument) db.createVertex().field("label", "car").save();
		ODocument vertex2 = (ODocument) db.createVertex().field("label", "pilot").save();
		ODocument edge = (ODocument) db.createEdge(vertex1, vertex2).field("label", "drives").save();

		List<?> result = db.query(new OSQLSynchQuery<Object>(
				"select gremlin('current.out.in') as value from V where out.size() > 0 limit 3"));
		System.out.println("Result: " + result);

		result = db.query(new OSQLSynchQuery<Object>("select gremlin('current.out') as value from V"));
		System.out.println("Result: " + result);

{'fraction_non_alphanumeric': 0.15384615384615385, 'fraction_numerical': 0.004592422502870264, 'mean_word_length': 5.6177215189873415, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6443919', 'n_tokens_mistral': 923, 'n_tokens_neox': 849, 'n_words': 155}