DataExtractorConformant { public DataView extractConformantPart(BaseShapeMap shapeMap) { Graph graph = GlobalFactory.RDFFactory.createGraph(); return extractConformantPart(shapeMap,graph); } DataExtractorConformant(ShexSchema schema, Graph inputGraph); DataView extractConformantPart(BaseShapeMap shapeMap); DataView extractConformantPart(BaseShapeMap shapeMap, Graph resultGraph);  }
@Test public void test() { String schemaSt = "<http: String shMap = "{ FOCUS a <http: try { ShexSchema schema = new ShexSchema(shexParser.getRules(new ByteArrayInputStream(schemaSt.getBytes()))); BaseShapeMap shapeMap = parser.parse(new ByteArrayInputStream(shMap.getBytes())); DataExtractorConformant extractor = new DataExtractorConformant(schema,graph); Graph result = GlobalFactory.RDFFactory.createGraph(); extractor.extractConformantPart(shapeMap, result); assertEquals(result.size(),6); assertTrue(result.contains(n1_a_human)); assertTrue(result.contains(n1_first_john)); assertTrue(result.contains(n2_a_human)); assertTrue(result.contains(n2_first_paul)); assertTrue(result.contains(n3_a_human)); assertTrue(result.contains(n3_first_alien)); } catch ( Exception e) { fail("Exception during the parsing"); } }
@Test public void test2() { String schemaSt = "<http: String shMap = "{ FOCUS a <http: try { ShexSchema schema = new ShexSchema(shexParser.getRules(new ByteArrayInputStream(schemaSt.getBytes()))); BaseShapeMap shapeMap = parser.parse(new ByteArrayInputStream(shMap.getBytes())); DataExtractorConformant extractor = new DataExtractorConformant(schema,graph); Graph result = GlobalFactory.RDFFactory.createGraph(); extractor.extractConformantPart(shapeMap, result); assertEquals(result.size(),4); assertTrue(result.contains(n1_a_human)); assertTrue(result.contains(n1_last_smith)); assertTrue(result.contains(n2_a_human)); assertTrue(result.contains(n2_last_east)); } catch ( Exception e) { fail("Exception during the parsing"); } }
@Test public void test3() { String schemaSt = "<http: String shMap = "{ FOCUS a <http: try { ShexSchema schema = new ShexSchema(shexParser.getRules(new ByteArrayInputStream(schemaSt.getBytes()))); BaseShapeMap shapeMap = parser.parse(new ByteArrayInputStream(shMap.getBytes())); DataExtractorConformant extractor = new DataExtractorConformant(schema,graph); Graph result = GlobalFactory.RDFFactory.createGraph(); extractor.extractConformantPart(shapeMap, result); assertEquals(result.size(),4); assertTrue(result.contains(n1_first_john)); assertTrue(result.contains(n1_last_smith)); assertTrue(result.contains(n2_first_paul)); assertTrue(result.contains(n2_last_east)); } catch ( Exception e) { fail("Exception during the parsing"); } }