@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(); }
@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)); }
@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())); }
@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(); }
@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("")); }
@Test public void testDocumentGraphCreatesMetadataFromJCas() throws UIMAException { DocumentGraphOptions options = DocumentGraphOptions.builder().withMeta(true).build(); DocumentGraphFactory factory = createfactory(options); JCas jCas = JCasFactory.createJCas(); JCasTestGraphUtil.populateJcas(jCas); Graph graph = factory.create(jCas); assertMetadata(jCas, graph.variables().asMap()); }
@Test public void testStopFetures() throws UIMAException { EntityGraphOptions options = EntityGraphOptions.builder().withStopFeatures("gender").build(); EntityGraphFactory factory = createfactory(options); JCas jCas = JCasFactory.createJCas(); JCasTestGraphUtil.populateJcas(jCas); Graph graph = factory.create(jCas); final GraphTraversalSource traversal = graph.traversal(); assertTrue(traversal.V().not(has("gender")).hasNext()); }
@Test public void testNoEvents() throws UIMAException { EntityGraphOptions options = EntityGraphOptions.builder().withEvents(false).build(); EntityGraphFactory factory = createfactory(options); JCas jCas = JCasFactory.createJCas(); JCasTestGraphUtil.populateJcas(jCas); Graph graph = factory.create(jCas); final GraphTraversalSource traversal = graph.traversal(); assertEquals(3, traversal.V().hasLabel(ENTITY).count().next().intValue()); assertEquals(0, traversal.V().hasLabel(EVENT).count().next().intValue()); assertEquals(0, traversal.E().hasLabel(PARTICIPANT_IN).count().next().intValue()); assertEquals(2, traversal.E().hasLabel(RELATION).count().next().intValue()); assertEquals(3, IteratorUtils.count(graph.vertices())); assertEquals(2, IteratorUtils.count(graph.edges())); }