Created
June 14, 2016 17:21
-
-
Save amihalik/9e8099be64ee232b75ec1b7edc2bea22 to your computer and use it in GitHub Desktop.
RYA-86 Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.io.IOUtils; | |
import org.openrdf.rio.ntriples.NTriplesWriter; | |
import org.openrdf.rio.turtle.TurtleParser; | |
public class TurtleFileParsingExample { | |
public static final String TTL = "@prefix images: <http://www.somepublisher.com/img/> . \n" | |
+ "@prefix isi: <http://www.isi.edu/ikcap/Wingse/fileOntology.owl#> . \n" | |
+ "images:f43240.jpg isi:hasMetadata <http://www.somepublisher.com/ns/m43240> ."; | |
// public static final String TTL = "<http://www.somepublisher.com/img/f43240.jpg> <http://www.isi.edu/ikcap/Wingse/fileOntology.owl#hasMetadata> <http://www.somepublisher.com/ns/m43240> ."; | |
public static void main(String[] args) throws Exception { | |
TurtleParser p = new TurtleParser(); | |
p.setRDFHandler(new NTriplesWriter(System.out)); | |
p.parse(IOUtils.toInputStream(TTL), ""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment