I have data in following format
<foo bar> <property abc> <this foo bar> .
Now there are essentially 4 parts in this string: foo bar
; property abc
; this foo bar
; and .
. How do I tokenize the above string into these four parts?
As others have suggested if you want to parse RDF graphs just use a library like Apache Jena (disclaimer - I am one of the developers).
If your problem is more that you need direct control over the parsing process then there are several options: