All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.unlaxer.jaddress.parser.GraphDBBuildingHierarchyResolver Maven / Gradle / Ivy

package org.unlaxer.jaddress.parser;

import java.util.Map;

import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection;
import org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.unlaxer.jaddress.entity.standard.郵便番号;
import org.unlaxer.jaddress.entity.standard.階層要素;
import org.unlaxer.jaddress.gremlin.GremlinUtil;

public class GraphDBBuildingHierarchyResolver implements BuildingHierarchyResolver {

	@Override
	public BuildingHierarchyResolverResult resolve(郵便番号 zip, Map<階層要素, AddressElement> 丁目以降枝番までBy階層要素) {
		BuildingHierarchyResolverResult ret = null;
		try (DriverRemoteConnection conn = DriverRemoteConnection.using("localhost", 8182, "g");
				GraphTraversalSource g = AnonymousTraversalSource.traversal().withRemote(conn);) {

			GremlinUtil gremlinUtil = new GremlinUtil(g);
			ret = gremlinUtil.searchBuildings(zip, 丁目以降枝番までBy階層要素);
		} catch (Exception e) {
			throw new UnsupportedOperationException(e);
		}
		return ret;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy