@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); tempDirectory = Files.createTempDirectory(RdfFileTest.class.getSimpleName()); tempDirectory.toFile().deleteOnExit(); }
@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); tempDirectory = Files.createTempDirectory(RdfEntityGraphFileTest.class.getSimpleName()); tempDirectory.toFile().deleteOnExit(); }
@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); tempDirectory = Files.createTempDirectory(EntityGraphFileTest.class.getSimpleName()); tempDirectory.toFile().deleteOnExit(); }
@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); tempDirectory = Files.createTempDirectory(DocumentGraphFileTest.class.getSimpleName()); tempDirectory.toFile().deleteOnExit(); }
@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); tempDirectory = Files.createTempDirectory(EntityGraphConsumerTest.class.getSimpleName()); tempDirectory.toFile().deleteOnExit(); graphFile = tempDirectory.resolve("testgraph.json").toFile(); graphFile.deleteOnExit(); propertiesFile = tempDirectory.resolve("graph.properties").toFile(); propertiesFile.deleteOnExit(); properties = new Properties(); properties.setProperty(Graph.GRAPH, TinkerGraph.class.getName()); properties.setProperty( TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, GraphFormat.GRAPHSON.toString().toLowerCase()); properties.setProperty( TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphFile.getAbsolutePath()); }
@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); tempDirectory = Files.createTempDirectory(DocumentGraphConsumerTest.class.getSimpleName()); tempDirectory.toFile().deleteOnExit(); graphFile = tempDirectory.resolve("testgraph.json").toFile(); graphFile.deleteOnExit(); propertiesFile = tempDirectory.resolve("graph.properties").toFile(); propertiesFile.deleteOnExit(); properties = new Properties(); properties.setProperty( Graph.GRAPH, "org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph"); properties.setProperty( TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_FORMAT, GraphFormat.GRAPHSON.toString().toLowerCase()); properties.setProperty( TinkerGraph.GREMLIN_TINKERGRAPH_GRAPH_LOCATION, graphFile.getAbsolutePath()); }
@Test public void testGraph() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline(jCas, AnalysisEngineFactory.createEngine(DocumentGraph.class)); } }
@Test public void testGraph() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline(jCas, AnalysisEngineFactory.createEngine(EntityGraph.class)); } }
@Test public void testGraph() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline(jCas, AnalysisEngineFactory.createEngine(RdfEntityGraph.class)); } }
@Test public void testRdfXml() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline(jCas, AnalysisEngineFactory.createEngine(Rdf.class)); }
setPassword(rootUrl); JCasTestGraphUtil.populateJcas(jCas);
@Test public void testRdfJson() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline( jCas, AnalysisEngineFactory.createEngine( Rdf.class, Rdf.PARAM_OUTPUT_FORMAT, RdfFormat.RDF_JSON.toString())); }
@Test public void testTurtle() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline( jCas, AnalysisEngineFactory.createEngine( Rdf.class, Rdf.PARAM_OUTPUT_FORMAT, RdfFormat.TURTLE.toString())); } }
@Test public void testRdfXmlAbv() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline( jCas, AnalysisEngineFactory.createEngine( Rdf.class, Rdf.PARAM_OUTPUT_FORMAT, RdfFormat.RDF_XML_ABBREV.toString())); }
@Test public void testNTriples() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline( jCas, AnalysisEngineFactory.createEngine( Rdf.class, Rdf.PARAM_OUTPUT_FORMAT, RdfFormat.N_TRIPLES.toString())); }
@Test public void testJsonLD() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline( jCas, AnalysisEngineFactory.createEngine( Rdf.class, Rdf.PARAM_OUTPUT_FORMAT, RdfFormat.JSONLD.toString())); }
@Test public void testN3() throws UIMAException { JCasTestGraphUtil.populateJcas(jCas); SimplePipeline.runPipeline( jCas, AnalysisEngineFactory.createEngine( Rdf.class, Rdf.PARAM_OUTPUT_FORMAT, RdfFormat.N3.toString())); }
@Test public void testValueCoerser() throws UIMAException { EntityGraphOptions options = EntityGraphOptions.builder().withValueCoercer((v) -> 1).build(); EntityGraphFactory factory = createfactory(options); JCas jCas = JCasFactory.createJCas(); JCasTestGraphUtil.populateJcas(jCas); Graph graph = factory.create(jCas); final GraphTraversalSource traversal = graph.traversal(); traversal .V() .forEachRemaining( v -> { Set<Object> values = ElementHelper.propertyValueMap(v).values().stream().collect(Collectors.toSet()); assertAllValuesCoerceTo1(v, values); }); traversal .E() .forEachRemaining( v -> { Set<Object> values = ElementHelper.propertyValueMap(v).values().stream().collect(Collectors.toSet()); assertTrue(values.contains(1) && values.size() == 1 || values.size() == 0); }); }
@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); port = getPort(); ds = DatasetFactory.createTxnMem(); server = FusekiServer.make(port, "/ds", ds.asDatasetGraph()).start(); }
@Before public void setup() throws IOException { JCasTestGraphUtil.populateJcas(jCas); ds = DatasetFactory.createTxnMem(); server = FusekiServer.create().add("/ds", ds).build(); server.start(); }