@Test public void resolveTest() { assertThat( resources.client().target("/cypher/resolve?cypherQuery=foo!").request().get(String.class), equalTo("foo")); }
@GET @Timed @Produces({MediaType.TEXT_PLAIN}) @Path("/resolve") @ApiOperation(value = "Cypher query resolver", response = String.class, notes = "Resolves curies and relationships.") public String resolve( @ApiParam(value = "The cypher query to resolve", required = true) @QueryParam("cypherQuery") String cypherQuery) { return cypherUtil.resolveRelationships(cypherUtil.resolveNodeIris(cypherQuery)); }
CypherUtilService extends BaseResource { @GET @Timed @Produces({MediaType.TEXT_PLAIN}) @Path("/resolve") @ApiOperation(value = "Cypher query resolver", response = String.class, notes = "Resolves curies and relationships.") public String resolve( @ApiParam(value = "The cypher query to resolve", required = true) @QueryParam("cypherQuery") String cypherQuery) { return cypherUtil.resolveRelationships(cypherUtil.resolveNodeIris(cypherQuery)); } }
CypherUtilService extends BaseResource { @GET @Timed @Produces({MediaType.TEXT_PLAIN}) @Path("/resolve") @ApiOperation(value = "Cypher query resolver", response = String.class, notes = "Resolves curies and relationships.") public String resolve( @ApiParam(value = "The cypher query to resolve", required = true) @QueryParam("cypherQuery") String cypherQuery) { return cypherUtil.resolveRelationships(cypherUtil.resolveNodeIris(cypherQuery)); } @Inject  CypherUtilService(CypherUtil cypherUtil, GraphDatabaseService graphDb); }
CypherUtilService extends BaseResource { @GET @Timed @Produces({MediaType.TEXT_PLAIN}) @Path("/resolve") @ApiOperation(value = "Cypher query resolver", response = String.class, notes = "Resolves curies and relationships.") public String resolve( @ApiParam(value = "The cypher query to resolve", required = true) @QueryParam("cypherQuery") String cypherQuery) { return cypherUtil.resolveRelationships(cypherUtil.resolveNodeIris(cypherQuery)); } @Inject  CypherUtilService(CypherUtil cypherUtil, GraphDatabaseService graphDb); @GET @Timed @Produces({MediaType.TEXT_PLAIN}) @Path("/resolve") @ApiOperation(value = "Cypher query resolver", response = String.class, notes = "Resolves curies and relationships.") String resolve(
      @ApiParam(value = "The cypher query to resolve", required = true) @QueryParam("cypherQuery") String cypherQuery); @GET @Path("/curies") @ApiOperation(value = "Get the curie map", response = String.class, responseContainer = "Map") @Timed @CacheControl(maxAge = 2, maxAgeUnit = TimeUnit.HOURS) @Produces({MediaType.APPLICATION_JSON}) Object getCuries(
      @ApiParam(value = DocumentationStrings.JSONP_DOC, required = false) @QueryParam("callback") String callback); @GET @Path("/execute") @ApiOperation( value = "Execute an arbitrary Cypher query.", response = String.class, notes = "The graph is in read-only mode, this service will fail with queries which alter the graph, like CREATE, DELETE or REMOVE. Example: MATCH (n:Node{iri:'DOID:4'}) return n") @Timed @CacheControl(maxAge = 2, maxAgeUnit = TimeUnit.HOURS) @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON}) String execute(
      @ApiParam(value = "The cypher query to execute", required = true) @QueryParam("cypherQuery") String cypherQuery,
      @ApiParam(value = "Limit", required = true) @QueryParam("limit") @DefaultValue("10") IntParam limit); }
CypherUtilService extends BaseResource { @GET @Timed @Produces({MediaType.TEXT_PLAIN}) @Path("/resolve") @ApiOperation(value = "Cypher query resolver", response = String.class, notes = "Resolves curies and relationships.") public String resolve( @ApiParam(value = "The cypher query to resolve", required = true) @QueryParam("cypherQuery") String cypherQuery) { return cypherUtil.resolveRelationships(cypherUtil.resolveNodeIris(cypherQuery)); } @Inject  CypherUtilService(CypherUtil cypherUtil, GraphDatabaseService graphDb); @GET @Timed @Produces({MediaType.TEXT_PLAIN}) @Path("/resolve") @ApiOperation(value = "Cypher query resolver", response = String.class, notes = "Resolves curies and relationships.") String resolve(
      @ApiParam(value = "The cypher query to resolve", required = true) @QueryParam("cypherQuery") String cypherQuery); @GET @Path("/curies") @ApiOperation(value = "Get the curie map", response = String.class, responseContainer = "Map") @Timed @CacheControl(maxAge = 2, maxAgeUnit = TimeUnit.HOURS) @Produces({MediaType.APPLICATION_JSON}) Object getCuries(
      @ApiParam(value = DocumentationStrings.JSONP_DOC, required = false) @QueryParam("callback") String callback); @GET @Path("/execute") @ApiOperation( value = "Execute an arbitrary Cypher query.", response = String.class, notes = "The graph is in read-only mode, this service will fail with queries which alter the graph, like CREATE, DELETE or REMOVE. Example: MATCH (n:Node{iri:'DOID:4'}) return n") @Timed @CacheControl(maxAge = 2, maxAgeUnit = TimeUnit.HOURS) @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON}) String execute(
      @ApiParam(value = "The cypher query to execute", required = true) @QueryParam("cypherQuery") String cypherQuery,
      @ApiParam(value = "Limit", required = true) @QueryParam("limit") @DefaultValue("10") IntParam limit);  }