Java Code Examples for org.apache.tinkerpop.gremlin.structure.Graph#variables()
The following examples show how to use
org.apache.tinkerpop.gremlin.structure.Graph#variables() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DocumentGraphFactory.java From baleen with Apache License 2.0 | 5 votes |
private void loadGraphMetadata(JCas jCas, Graph graph, Optional<Vertex> document) { if (!document.isPresent()) { Variables variables = graph.variables(); getGraphMetadata(jCas).entrySet().stream() .forEach(e -> variables.set(e.getKey(), e.getValue())); } }
Example 2
Source File: DocumentGraphFactoryTest.java From baleen with Apache License 2.0 | 5 votes |
@Test public void testDocumentGraphMetadataHasContentFromJCas() throws UIMAException { DocumentGraphOptions options = DocumentGraphOptions.builder().withContent(true).build(); DocumentGraphFactory factory = createfactory(options); JCas jCas = JCasFactory.createJCas(); JCasTestGraphUtil.populateJcas(jCas); Graph graph = factory.create(jCas); Variables variables = graph.variables(); assertEquals(JCasTestGraphUtil.CONTENT, variables.get(FIELD_CONTENT).orElse("")); }