Java Code Examples for org.eclipse.rdf4j.rio.RDFFormat#TURTLE

The following examples show how to use org.eclipse.rdf4j.rio.RDFFormat#TURTLE . 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: TripleStoreRDF4J.java    From powsybl-core with Mozilla Public License 2.0 5 votes vote down vote up
private static RDFFormat guessFormatFromName(String name) {
    if (name.endsWith(".ttl")) {
        return RDFFormat.TURTLE;
    } else if (name.endsWith(".xml")) {
        return RDFFormat.RDFXML;
    }
    return RDFFormat.RDFXML;
}
 
Example 2
Source File: RestUtils.java    From mobi with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Returns the specified RDFFormat. Currently supports Turtle, TRiG, RDF/XML, and JSON-LD.
 *
 * @param format The abbreviated name of a RDFFormat.
 * @return A RDFFormat object with the requested format.
 */
public static RDFFormat getRDFFormat(String format) {
    switch (format.toLowerCase()) {
        case "turtle":
            return RDFFormat.TURTLE;
        case "trig":
            return RDFFormat.TRIG;
        case "rdf/xml":
            return RDFFormat.RDFXML;
        case "jsonld":
        default:
            return RDFFormat.JSONLD;
    }
}
 
Example 3
Source File: RdfConverterTest.java    From Wikidata-Toolkit with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
	this.out = new ByteArrayOutputStream();
	this.rdfWriter = new RdfWriter(RDFFormat.TURTLE, out);
	this.sites = new SitesImpl();
	this.rdfConverter = new RdfConverter(this.rdfWriter, this.sites,
			new MockPropertyRegister());
	this.rdfWriter.start();
}
 
Example 4
Source File: ValueRdfConverterTest.java    From Wikidata-Toolkit with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
	this.out = new ByteArrayOutputStream();
	this.rdfWriter = new RdfWriter(RDFFormat.TURTLE, this.out);
	this.rdfConversionBuffer = new OwlDeclarationBuffer();
	this.rdfWriter.start();
}
 
Example 5
Source File: RdfSerializerTest.java    From Wikidata-Toolkit with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
	this.out = new ByteArrayOutputStream();
	this.rdfSerializer = new RdfSerializer(RDFFormat.TURTLE, this.out,
			new SitesImpl(), new MockPropertyRegister());

}
 
Example 6
Source File: TurtleParserFactory.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Returns {@link RDFFormat#TURTLE}.
 */
@Override
public RDFFormat getRDFFormat() {
	return RDFFormat.TURTLE;
}
 
Example 7
Source File: TurtleWriter.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public RDFFormat getRDFFormat() {
	return RDFFormat.TURTLE;
}
 
Example 8
Source File: TurtleParser.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public RDFFormat getRDFFormat() {
	return RDFFormat.TURTLE;
}
 
Example 9
Source File: TurtleWriterFactory.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Returns {@link RDFFormat#TURTLE}.
 */
@Override
public RDFFormat getRDFFormat() {
	return RDFFormat.TURTLE;
}