AbstractRDFParser implements RDFParser, Cloneable { protected static Optional<RDFSyntax> guessRDFSyntax(final Path path) { return fileExtension(path).flatMap(RDFSyntax::byFileExtension); }  Optional<RDF> getRdfTermFactory(); Optional<RDFSyntax> getContentTypeSyntax(); final Optional<String> getContentType(); Consumer<Quad> getTarget(); Optional<Dataset> getTargetDataset(); Optional<Graph> getTargetGraph(); Optional<IRI> getBase(); Optional<InputStream> getSourceInputStream(); Optional<Path> getSourceFile(); Optional<IRI> getSourceIri(); @SuppressWarnings("unchecked") @Override T clone(); @Override T rdfTermFactory(final RDF rdfTermFactory); @Override T contentType(final RDFSyntax rdfSyntax); @Override T contentType(final String contentType); @Override T base(final IRI base); @Override T base(final String base); @Override T source(final InputStream inputStream); @Override T source(final Path file); @Override T source(final IRI iri); @Override T source(final String iri); @Override Future<ParseResult> parse(); @Override T target(final Consumer<Quad> consumer); @Override T target(final Dataset dataset); @Override T target(final Graph graph); static final ThreadGroup threadGroup; }
@Test public void guessRDFSyntax() throws Exception { assertEquals(RDFSyntax.NTRIPLES, AbstractRDFParser.guessRDFSyntax(testNt).get()); assertEquals(RDFSyntax.TURTLE, AbstractRDFParser.guessRDFSyntax(testTtl).get()); assertFalse(AbstractRDFParser.guessRDFSyntax(testXml).isPresent()); }