@Test public void testAbsentUri() { Query query = new Vocabulary.Query.Builder("http: assertThat(vocabulary.getConceptFromId(query).isPresent(), is(false)); }
@Override public Optional<Concept> getConceptFromId(Query query) { String idQuery = StringUtils.strip(query.getInput(), "\""); idQuery = curieUtil.getIri(idQuery).orElse(idQuery); try (Transaction tx = graph.beginTx()) { Node node = graph.index().getNodeAutoIndexer().getAutoIndex().get(CommonProperties.IRI, idQuery) .getSingle(); tx.success(); Concept concept = null; if (null != node) { concept = transformer.apply(node); } return Optional.ofNullable(concept); } }
VocabularyNeo4jImpl implements Vocabulary { @Override public Optional<Concept> getConceptFromId(Query query) { String idQuery = StringUtils.strip(query.getInput(), "\""); idQuery = curieUtil.getIri(idQuery).orElse(idQuery); try (Transaction tx = graph.beginTx()) { Node node = graph.index().getNodeAutoIndexer().getAutoIndex().get(CommonProperties.IRI, idQuery) .getSingle(); tx.success(); Concept concept = null; if (null != node) { concept = transformer.apply(node); } return Optional.ofNullable(concept); } } }
VocabularyNeo4jImpl implements Vocabulary { @Override public Optional<Concept> getConceptFromId(Query query) { String idQuery = StringUtils.strip(query.getInput(), "\""); idQuery = curieUtil.getIri(idQuery).orElse(idQuery); try (Transaction tx = graph.beginTx()) { Node node = graph.index().getNodeAutoIndexer().getAutoIndex().get(CommonProperties.IRI, idQuery) .getSingle(); tx.success(); Concept concept = null; if (null != node) { concept = transformer.apply(node); } return Optional.ofNullable(concept); } } @Inject  VocabularyNeo4jImpl(GraphDatabaseService graph,
      @Nullable @IndicatesNeo4jGraphLocation String neo4jLocation, CurieUtil curieUtil,
      NodeTransformer transformer); }
VocabularyNeo4jImpl implements Vocabulary { @Override public Optional<Concept> getConceptFromId(Query query) { String idQuery = StringUtils.strip(query.getInput(), "\""); idQuery = curieUtil.getIri(idQuery).orElse(idQuery); try (Transaction tx = graph.beginTx()) { Node node = graph.index().getNodeAutoIndexer().getAutoIndex().get(CommonProperties.IRI, idQuery) .getSingle(); tx.success(); Concept concept = null; if (null != node) { concept = transformer.apply(node); } return Optional.ofNullable(concept); } } @Inject  VocabularyNeo4jImpl(GraphDatabaseService graph,
      @Nullable @IndicatesNeo4jGraphLocation String neo4jLocation, CurieUtil curieUtil,
      NodeTransformer transformer); @Override Optional<Concept> getConceptFromId(Query query); @Override List<Concept> getConceptsFromPrefix(Query query); @Override List<Concept> searchConcepts(Query query); @Override List<Concept> getConceptsFromTerm(Query query); @Override Set<String> getAllCategories(); @Override Set<String> getAllCuriePrefixes(); @Override List<String> getSuggestions(String query); }
VocabularyNeo4jImpl implements Vocabulary { @Override public Optional<Concept> getConceptFromId(Query query) { String idQuery = StringUtils.strip(query.getInput(), "\""); idQuery = curieUtil.getIri(idQuery).orElse(idQuery); try (Transaction tx = graph.beginTx()) { Node node = graph.index().getNodeAutoIndexer().getAutoIndex().get(CommonProperties.IRI, idQuery) .getSingle(); tx.success(); Concept concept = null; if (null != node) { concept = transformer.apply(node); } return Optional.ofNullable(concept); } } @Inject  VocabularyNeo4jImpl(GraphDatabaseService graph,
      @Nullable @IndicatesNeo4jGraphLocation String neo4jLocation, CurieUtil curieUtil,
      NodeTransformer transformer); @Override Optional<Concept> getConceptFromId(Query query); @Override List<Concept> getConceptsFromPrefix(Query query); @Override List<Concept> searchConcepts(Query query); @Override List<Concept> getConceptsFromTerm(Query query); @Override Set<String> getAllCategories(); @Override Set<String> getAllCuriePrefixes(); @Override List<String> getSuggestions(String query);  }